]>
code.delx.au - pulseaudio/blob - polyp/modinfo.c
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 PA_SYMBOL_AUTHOR "pa__get_author"
35 #define PA_SYMBOL_DESCRIPTION "pa__get_description"
36 #define PA_SYMBOL_USAGE "pa__get_usage"
37 #define PA_SYMBOL_VERSION "pa__get_version"
39 struct pa_modinfo
*pa_modinfo_get_by_handle(lt_dlhandle dl
) {
41 const char* (*func
)(void);
44 i
= pa_xmalloc0(sizeof(struct pa_modinfo
));
46 if ((func
= (const char* (*)(void)) lt_dlsym(dl
, PA_SYMBOL_AUTHOR
)))
47 i
->author
= pa_xstrdup(func());
49 if ((func
= (const char* (*)(void)) lt_dlsym(dl
, PA_SYMBOL_DESCRIPTION
)))
50 i
->description
= pa_xstrdup(func());
52 if ((func
= (const char* (*)(void)) lt_dlsym(dl
, PA_SYMBOL_USAGE
)))
53 i
->usage
= pa_xstrdup(func());
55 if ((func
= (const char* (*)(void)) lt_dlsym(dl
, PA_SYMBOL_VERSION
)))
56 i
->version
= pa_xstrdup(func());
61 struct pa_modinfo
*pa_modinfo_get_by_name(const char *name
) {
66 if (!(dl
= lt_dlopenext(name
))) {
67 pa_log(__FILE__
": Failed to open module \"%s\": %s\n", name
, lt_dlerror());
71 i
= pa_modinfo_get_by_handle(dl
);
77 void pa_modinfo_free(struct pa_modinfo
*i
) {
80 pa_xfree(i
->description
);