[pulseaudio-commits] r1981 - in /trunk/src/pulsecore: namereg.c namereg.h

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Mon Oct 29 13:01:50 PDT 2007


Author: lennart
Date: Mon Oct 29 21:01:49 2007
New Revision: 1981

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1981&root=pulseaudio&view=rev
Log:
export pa_namereg_is_valid_name()

Modified:
    trunk/src/pulsecore/namereg.c
    trunk/src/pulsecore/namereg.h

Modified: trunk/src/pulsecore/namereg.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/namereg.c?rev=1981&root=pulseaudio&r1=1980&r2=1981&view=diff
==============================================================================
--- trunk/src/pulsecore/namereg.c (original)
+++ trunk/src/pulsecore/namereg.c Mon Oct 29 21:01:49 2007
@@ -56,20 +56,20 @@
         c == '_';
 }
 
-static int is_valid_name(const char *name) {
+pa_bool_t pa_namereg_is_valid_name(const char *name) {
     const char *c;
 
     if (*name == 0)
-        return 0;
+        return FALSE;
 
     for (c = name; *c && (c-name < PA_NAME_MAX); c++)
         if (!is_valid_char(*c))
-            return 0;
+            return FALSE;
 
     if (*c)
-        return 0;
-
-    return 1;
+        return FALSE;
+
+    return TRUE;
 }
 
 static char* cleanup_name(const char *name) {
@@ -111,7 +111,7 @@
         return NULL;
 
     if ((type == PA_NAMEREG_SINK || type == PA_NAMEREG_SOURCE) &&
-        !is_valid_name(name) ) {
+        !pa_namereg_is_valid_name(name) ) {
 
         if (fail)
             return NULL;
@@ -253,7 +253,7 @@
     if (name && *s && !strcmp(name, *s))
         return 0;
 
-    if (!is_valid_name(name))
+    if (!pa_namereg_is_valid_name(name))
         return -1;
 
     pa_xfree(*s);

Modified: trunk/src/pulsecore/namereg.h
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/pulsecore/namereg.h?rev=1981&root=pulseaudio&r1=1980&r2=1981&view=diff
==============================================================================
--- trunk/src/pulsecore/namereg.h (original)
+++ trunk/src/pulsecore/namereg.h Mon Oct 29 21:01:49 2007
@@ -25,6 +25,7 @@
 ***/
 
 #include <pulsecore/core.h>
+#include <pulsecore/macro.h>
 
 #define PA_NAME_MAX 128
 
@@ -44,4 +45,6 @@
 const char *pa_namereg_get_default_sink_name(pa_core *c);
 const char *pa_namereg_get_default_source_name(pa_core *c);
 
+pa_bool_t pa_namereg_is_valid_name(const char *name);
+
 #endif




More information about the pulseaudio-commits mailing list