[vlc-devel] [PATCH 1/7] modules: rename plugin functions
Thomas Guillem
thomas at gllm.fr
Fri Sep 25 10:32:13 CEST 2020
On Thu, Sep 24, 2020, at 22:00, RĂ©mi Denis-Courmont wrote:
> (no functional changes)
> ---
> src/config/core.c | 4 ++--
> src/modules/bank.c | 20 ++++++++++----------
> src/modules/modules.c | 2 +-
> src/modules/modules.h | 4 ++--
> 4 files changed, 15 insertions(+), 15 deletions(-)
>
> diff --git a/src/config/core.c b/src/config/core.c
> index ce05d20afd..b24ef59ab4 100644
> --- a/src/config/core.c
> +++ b/src/config/core.c
> @@ -207,7 +207,7 @@ ssize_t config_GetIntChoices(const char *name,
> {
> int (*cb)(const char *, int64_t **, char ***);
>
> - cb = module_Symbol(NULL, cfg->owner, "vlc_entry_cfg_int_enum");
> + cb = vlc_plugin_Symbol(NULL, cfg->owner, "vlc_entry_cfg_int_enum");
> if (cb == NULL)
> return 0;
>
> @@ -330,7 +330,7 @@ ssize_t config_GetPszChoices(const char *name,
> {
> int (*cb)(const char *, char ***, char ***);
>
> - cb = module_Symbol(NULL, cfg->owner, "vlc_entry_cfg_str_enum");
> + cb = vlc_plugin_Symbol(NULL, cfg->owner, "vlc_entry_cfg_str_enum");
> if (cb == NULL)
> return 0;
>
> diff --git a/src/modules/bank.c b/src/modules/bank.c
> index d3f89b60e8..12330d695d 100644
> --- a/src/modules/bank.c
> +++ b/src/modules/bank.c
> @@ -542,7 +542,7 @@ static void AllocateAllPlugins (vlc_object_t *p_this)
> *
> * \return 0 on success, -1 on failure
> */
> -int module_Map(struct vlc_logger *log, vlc_plugin_t *plugin)
> +int vlc_plugin_Map(struct vlc_logger *log, vlc_plugin_t *plugin)
> {
> static vlc_mutex_t lock = VLC_STATIC_MUTEX;
>
> @@ -594,7 +594,7 @@ error:
> * \note This function is not thread-safe. The caller must ensure that the
> * plug-in is no longer used before calling this function.
> */
> -static void module_Unmap(vlc_plugin_t *plugin)
> +static void vlc_plugin_Unmap(vlc_plugin_t *plugin)
> {
> if (!plugin->unloadable)
> return;
> @@ -605,10 +605,10 @@ static void module_Unmap(vlc_plugin_t *plugin)
> vlc_dlclose(handle);
> }
>
> -void *module_Symbol(struct vlc_logger *log,
> - vlc_plugin_t *plugin, const char *name)
> +void *vlc_plugin_Symbol(struct vlc_logger *log,
> + vlc_plugin_t *plugin, const char *name)
> {
> - if (plugin->abspath == NULL || module_Map(log, plugin))
> + if (plugin->abspath == NULL || vlc_plugin_Map(log, plugin))
> return NULL;
>
> void *handle = (void *)atomic_load_explicit(&plugin->handle,
> @@ -617,19 +617,19 @@ void *module_Symbol(struct vlc_logger *log,
> return vlc_dlsym(handle, name);
> }
> #else
> -int module_Map(struct vlc_logger *log, vlc_plugin_t *plugin)
> +int vlc_plugin_Map(struct vlc_logger *log, vlc_plugin_t *plugin)
> {
> (void) log; (void) plugin;
> return 0;
> }
>
> -static void module_Unmap(vlc_plugin_t *plugin)
> +static void vlc_plugin_Unmap(vlc_plugin_t *plugin)
> {
> (void) plugin;
> }
>
> -void *module_Symbol(struct vlc_logger *log,
> - vlc_plugin_t *plugin, const char *name)
> +void *vlc_plugin_Symbol(struct vlc_logger *log,
> + vlc_plugin_t *plugin, const char *name)
> {
> (void) log; (void) plugin; (void) name;
> return NULL;
> @@ -707,7 +707,7 @@ void module_EndBank (bool b_plugins)
> vlc_plugin_t *lib = libs;
>
> libs = lib->next;
> - module_Unmap(lib);
> + vlc_plugin_Unmap(lib);
> vlc_plugin_destroy(lib);
> }
>
> diff --git a/src/modules/modules.c b/src/modules/modules.c
> index ee47ec30c3..cc6e91d9d7 100644
> --- a/src/modules/modules.c
> +++ b/src/modules/modules.c
> @@ -201,7 +201,7 @@ static int module_load(vlc_logger_t *log, module_t *m,
> {
> int ret = VLC_SUCCESS;
>
> - if (module_Map(log, m->plugin))
> + if (vlc_plugin_Map(log, m->plugin))
> return VLC_EGENERIC;
>
> if (m->pf_activate != NULL)
> diff --git a/src/modules/modules.h b/src/modules/modules.h
> index 075f6d85f5..bcb1b71116 100644
> --- a/src/modules/modules.h
> +++ b/src/modules/modules.h
> @@ -110,8 +110,8 @@ void module_InitBank (void);
> void module_LoadPlugins(vlc_object_t *);
> #define module_LoadPlugins(a) module_LoadPlugins(VLC_OBJECT(a))
> void module_EndBank (bool);
> -int module_Map(struct vlc_logger *, vlc_plugin_t *);
> -void *module_Symbol(struct vlc_logger *, vlc_plugin_t *, const char *name);
> +int vlc_plugin_Map(struct vlc_logger *, vlc_plugin_t *);
> +void *vlc_plugin_Symbol(struct vlc_logger *, vlc_plugin_t *, const char *name);
Nit: I expect that the first argument of a vlc_foo_Function() is some vlc_foo_t struct. Here, it is the logger.
Maybe it's a good time to swap the arguments, or it can be done later.
>
> /**
> * Lists of all VLC modules with a given capability.
> --
> 2.28.0
>
> _______________________________________________
> vlc-devel mailing list
> To unsubscribe or modify your subscription options:
> https://mailman.videolan.org/listinfo/vlc-devel
More information about the vlc-devel
mailing list