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

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Fri Aug 11 09:58:28 PDT 2006


Author: lennart
Date: Fri Aug 11 18:58:21 2006
New Revision: 1199

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=1199&root=pulseaudio&view=rev
Log:
do not export name validity checking routes and apply them only to sink/source names, not sample names

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=1199&root=pulseaudio&r1=1198&r2=1199&view=diff
==============================================================================
--- trunk/src/pulsecore/namereg.c (original)
+++ trunk/src/pulsecore/namereg.c Fri Aug 11 18:58:21 2006
@@ -54,7 +54,7 @@
         c == '_';
 }
 
-int pa_namereg_is_valid_name(const char *name) {
+static int is_valid_name(const char *name) {
     const char *c;
 
     if (*name == 0)
@@ -70,7 +70,7 @@
     return 1;
 }
 
-char* pa_namereg_cleanup_name(const char *name) {
+static char* cleanup_name(const char *name) {
     const char *a;
     char *b, *n;
 
@@ -109,12 +109,13 @@
     if (!*name)
         return NULL;
     
-    if (!pa_namereg_is_valid_name(name)) {
+    if ((type == PA_NAMEREG_SINK || type == PA_NAMEREG_SOURCE) &&
+        !is_valid_name(name) ) {
         
         if (fail)
             return NULL;
 
-        if (!(name = n = pa_namereg_cleanup_name(name)))
+        if (!(name = n = cleanup_name(name)))
             return NULL;
     }
 
@@ -253,7 +254,7 @@
     if (name && *s && !strcmp(name, *s))
         return 0;
 
-    if (!pa_namereg_is_valid_name(name))
+    if (!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=1199&root=pulseaudio&r1=1198&r2=1199&view=diff
==============================================================================
--- trunk/src/pulsecore/namereg.h (original)
+++ trunk/src/pulsecore/namereg.h Fri Aug 11 18:58:21 2006
@@ -34,10 +34,6 @@
 
 void pa_namereg_free(pa_core *c);
 
-int pa_namereg_is_valid_name(const char *name);
-
-char* pa_namereg_cleanup_name(const char *name);
-
 const char *pa_namereg_register(pa_core *c, const char *name, pa_namereg_type_t type, void *data, int fail);
 void pa_namereg_unregister(pa_core *c, const char *name);
 void* pa_namereg_get(pa_core *c, const char *name, pa_namereg_type_t type, int autoload);




More information about the pulseaudio-commits mailing list