mirror of
https://gitlab.freedesktop.org/pulseaudio/pulseaudio.git
synced 2025-11-06 13:29:56 -05:00
tag modules that may only be loaded once at most especially, and enforce that in the module loader
git-svn-id: file:///home/lennart/svn/public/pulseaudio/trunk@2043 fefdeb5f-60dc-0310-8127-8f9354f1896f
This commit is contained in:
parent
d8e0c1c6bd
commit
e313fe1b3d
42 changed files with 233 additions and 160 deletions
|
|
@ -40,10 +40,12 @@
|
|||
#define PA_SYMBOL_DESCRIPTION "pa__get_description"
|
||||
#define PA_SYMBOL_USAGE "pa__get_usage"
|
||||
#define PA_SYMBOL_VERSION "pa__get_version"
|
||||
#define PA_SYMBOL_LOAD_ONCE "pa__load_once"
|
||||
|
||||
pa_modinfo *pa_modinfo_get_by_handle(lt_dlhandle dl, const char *module_name) {
|
||||
pa_modinfo *i;
|
||||
const char* (*func)(void);
|
||||
pa_bool_t (*func2) (void);
|
||||
|
||||
pa_assert(dl);
|
||||
|
||||
|
|
@ -61,6 +63,9 @@ pa_modinfo *pa_modinfo_get_by_handle(lt_dlhandle dl, const char *module_name) {
|
|||
if ((func = (const char* (*)(void)) pa_load_sym(dl, module_name, PA_SYMBOL_VERSION)))
|
||||
i->version = pa_xstrdup(func());
|
||||
|
||||
if ((func2 = (pa_bool_t (*)(void)) pa_load_sym(dl, module_name, PA_SYMBOL_LOAD_ONCE)))
|
||||
i->load_once = func2();
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue