diff options
author | Lennart Poettering <lennart@poettering.net> | 2009-05-28 02:47:36 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2009-05-28 02:47:36 +0200 |
commit | c224aace42ca3b59d18a5bc7d5f33aed7d9fb99c (patch) | |
tree | 53dac2f344317c18f90f3669935b9371a8534b6c /src/pulsecore/module.c | |
parent | 1c4393acf0a641a4f462cfa6c368d23d9e55a1b8 (diff) |
modules: introduce PA_MODULE_DEPRECATED() macro for marking modules deprecated
Diffstat (limited to 'src/pulsecore/module.c')
-rw-r--r-- | src/pulsecore/module.c | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/pulsecore/module.c b/src/pulsecore/module.c index 42fd912c..5bcdd898 100644 --- a/src/pulsecore/module.c +++ b/src/pulsecore/module.c @@ -48,10 +48,12 @@ #define PA_SYMBOL_DONE "pa__done" #define PA_SYMBOL_LOAD_ONCE "pa__load_once" #define PA_SYMBOL_GET_N_USED "pa__get_n_used" +#define PA_SYMBOL_GET_DEPRECATE "pa__get_deprecated" pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) { pa_module *m = NULL; pa_bool_t (*load_once)(void); + const char* (*get_deprecated)(void); pa_modinfo *mi; pa_assert(c); @@ -89,6 +91,13 @@ pa_module* pa_module_load(pa_core *c, const char *name, const char *argument) { } } + if ((get_deprecated = (const char* (*) (void)) pa_load_sym(m->dl, name, PA_SYMBOL_GET_DEPRECATE))) { + const char *t; + + if ((t = get_deprecated())) + pa_log_warn("%s is deprecated: %s", name, t); + } + if (!(m->init = (int (*)(pa_module*_m)) pa_load_sym(m->dl, name, PA_SYMBOL_INIT))) { pa_log("Failed to load module \"%s\": symbol \""PA_SYMBOL_INIT"\" not found.", name); goto fail; |