]>
code.delx.au - pulseaudio/blob - polyp/pamodinfo.c
6eb147f08df4ad6f811f344a6e1d903924d1ddcf
4 This file is part of polypaudio.
6 polypaudio is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published
8 by the Free Software Foundation; either version 2 of the License,
9 or (at your option) any later version.
11 polypaudio is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with polypaudio; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
34 #define PREFIX "module-"
36 static int verbose
= 0;
38 static void short_info(const char *name
, const char *path
, struct pa_modinfo
*i
) {
40 printf("%-40s%s\n", name
, i
->description
? i
->description
: "n/a");
43 static void long_info(const char *name
, const char *path
, struct pa_modinfo
*i
) {
52 printf("Name: %s\n", name
);
54 if (!i
->description
&& !i
->version
&& !i
->author
&& !i
->usage
)
55 printf("No module information available\n");
58 printf("Version: %s\n", i
->version
);
60 printf("Description: %s\n", i
->description
);
62 printf("Author: %s\n", i
->author
);
64 printf("Usage: %s\n", i
->usage
);
68 printf("Path: %s\n", path
);
71 static void show_info(const char *name
, const char *path
, void (*info
)(const char *name
, const char *path
, struct pa_modinfo
*i
)) {
74 if ((i
= pa_modinfo_get_by_name(path
? path
: name
))) {
80 static int callback(const char *path
, lt_ptr data
) {
83 if ((e
= (const char*) strrchr(path
, '/')))
88 if (strlen(e
) > sizeof(PREFIX
)-1 && !strncmp(e
, PREFIX
, sizeof(PREFIX
)-1))
89 show_info(e
, path
, verbose
? long_info
: short_info
);
94 int main(int argc
, char *argv
[]) {
100 while ((c
= getopt(argc
, argv
, "p:v")) != -1) {
114 lt_dlsetsearchpath(path
);
117 lt_dlsetsearchpath(DLSEARCHPATH
);
121 show_info(argv
[optind
], NULL
, long_info
);
123 lt_dlforeachfile(NULL
, callback
, NULL
);