[polypaudio-commits] r702 - /trunk/src/daemon/dumpmodules.c

svnmailer-noreply at 0pointer.de svnmailer-noreply at 0pointer.de
Thu Apr 13 10:33:09 PDT 2006


Author: lennart
Date: Thu Apr 13 19:33:06 2006
New Revision: 702

URL: http://0pointer.de/cgi-bin/viewcvs.cgi?rev=702&root=polypaudio&view=rev
Log:
add code to allow polypaudio dump preloaded modules using "--dump-modules"

Modified:
    trunk/src/daemon/dumpmodules.c

Modified: trunk/src/daemon/dumpmodules.c
URL: http://0pointer.de/cgi-bin/viewcvs.cgi/trunk/src/daemon/dumpmodules.c?rev=702&root=polypaudio&r1=701&r2=702&view=diff
==============================================================================
--- trunk/src/daemon/dumpmodules.c (original)
+++ trunk/src/daemon/dumpmodules.c Thu Apr 13 19:33:06 2006
@@ -78,15 +78,41 @@
     }
 }
 
+extern const lt_dlsymlist lt_preloaded_symbols[];
+
+static int is_preloaded(const char *name) {
+    const lt_dlsymlist *l;
+
+    for (l = lt_preloaded_symbols; l->name; l++) {
+        char buf[64], *e;
+            
+        if (l->address)
+            continue;
+        
+        snprintf(buf, sizeof(buf), "%s", l->name);
+        if ((e = strrchr(buf, '.')))
+            *e = 0;
+
+        if (!strcmp(name, buf))
+            return 1;
+    }
+
+    return 0;
+}
+
 static int callback(const char *path, lt_ptr data) {
     const char *e;
     pa_daemon_conf *c = (data);
 
     e = pa_path_get_filename(path);
 
-    if (strlen(e) > sizeof(PREFIX)-1 && !strncmp(e, PREFIX, sizeof(PREFIX)-1))
-        show_info(e, path, c->log_level >= PA_LOG_INFO ? long_info : short_info);
+    if (strlen(e) <= sizeof(PREFIX)-1 || strncmp(e, PREFIX, sizeof(PREFIX)-1))
+        return 0;
+
+    if (is_preloaded(e))
+        return 0;
     
+    show_info(e, path, c->log_level >= PA_LOG_INFO ? long_info : short_info);
     return 0;
 }
 
@@ -95,6 +121,25 @@
         int i;
         for (i = 0; i < argc; i++)
             show_info(argv[i], NULL, long_info);
-    } else
+    } else {
+        const lt_dlsymlist *l;
+
+        for (l = lt_preloaded_symbols; l->name; l++) {
+            char buf[64], *e;
+            
+            if (l->address)
+                continue;
+
+            if (strlen(l->name) <= sizeof(PREFIX)-1 || strncmp(l->name, PREFIX, sizeof(PREFIX)-1))
+                continue;
+            
+            snprintf(buf, sizeof(buf), "%s", l->name);
+            if ((e = strrchr(buf, '.')))
+                *e = 0;
+            
+            show_info(buf, NULL, c->log_level >= PA_LOG_INFO ? long_info : short_info);
+        }
+        
         lt_dlforeachfile(NULL, callback, c);
+    }
 }




More information about the pulseaudio-commits mailing list