[vlc-devel] [PATCH 1/2] modules: inline module_exists()

Lyndon Brown jnqnfe at gmail.com
Sun Sep 27 01:35:04 CEST 2020


From: Lyndon Brown <jnqnfe at gmail.com>
Date: Mon, 8 Apr 2019 15:01:32 +0100
Subject: modules: inline module_exists()


diff --git a/include/vlc_modules.h b/include/vlc_modules.h
index 6dbb891240..3927252469 100644
--- a/include/vlc_modules.h
+++ b/include/vlc_modules.h
@@ -124,15 +124,6 @@ static inline module_t *module_need_var(vlc_object_t *obj, const char *cap,
 VLC_API void module_unneed( vlc_object_t *, module_t * );
 #define module_unneed(a,b) module_unneed(VLC_OBJECT(a),b)
 
-/**
- * Checks if a module exists.
- *
- * \param name name of the module
- * \retval true if the module exists
- * \retval false if the module does not exist (in the running installation)
- */
-VLC_API bool module_exists(const char *) VLC_USED;
-
 /**
  * Get a pointer to a module_t given it's name.
  *
@@ -141,6 +132,18 @@ VLC_API bool module_exists(const char *) VLC_USED;
  */
 VLC_API module_t *module_find(const char *name) VLC_USED;
 
+/**
+ * Checks if a module exists.
+ *
+ * \param name name of the module
+ * \retval true if the module exists
+ * \retval false if the module does not exist (in the running installation)
+ */
+VLC_USED static inline bool module_exists (const char * name)
+{
+    return module_find(name) != NULL;
+}
+
 /**
  * Gets the table of module configuration items.
  *
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 4c6c588f73..f2ec433f02 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -253,7 +253,6 @@ vlc_uri_fixup
 vlc_tick_now
 module_config_free
 module_config_get
-module_exists
 module_find
 module_get_capability
 module_get_help
diff --git a/src/modules/modules.c b/src/modules/modules.c
index 2b9ed30fe0..1b8cab86a6 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -329,11 +329,6 @@ module_t *module_find (const char *name)
     return NULL;
 }
 
-bool module_exists (const char * psz_name)
-{
-    return module_find (psz_name) != NULL;
-}
-
 module_config_t *module_config_get( const module_t *module, unsigned *restrict psize )
 {
     const vlc_plugin_t *plugin = module->plugin;



More information about the vlc-devel mailing list