[vlc-devel] [PATCH 4/7] modules: export vlc_module_match()

RĂ©mi Denis-Courmont remi at remlab.net
Thu Sep 24 22:00:22 CEST 2020


---
 include/vlc_modules.h | 21 +++++++++++++++++++++
 src/libvlccore.sym    |  1 +
 src/modules/modules.c | 17 -----------------
 3 files changed, 22 insertions(+), 17 deletions(-)

diff --git a/include/vlc_modules.h b/include/vlc_modules.h
index 430863953c..791bc6d2a4 100644
--- a/include/vlc_modules.h
+++ b/include/vlc_modules.h
@@ -35,6 +35,27 @@ struct vlc_logger;
  * Exported functions.
  *****************************************************************************/
 
+/**
+ * Finds the candidate modules for given criteria.
+ *
+ * All candidates modules having the specified capability and name will be
+ * sorted in decreasing order of priority and returned in a heap-allocated
+ * table.
+ *
+ * \param capability capability, i.e. class of module
+ * \param names string of comma-separated requested module shortcut names
+ * \param strict whether to exclude modules with no unmatching shortcut names
+ * \param modules storage location for the base address of a sorted table
+ *                of candidate modules [OUT]
+ * \param strict_matches storage location for the count of strictly matched
+ *                       modules [OUT]
+ * \return number of modules found or a strictly negative value on error
+ */
+VLC_API
+ssize_t vlc_module_match(const char *capability, const char *names,
+                         bool strict, module_t ***restrict modules,
+                         size_t *restrict strict_matches);
+
 /**
  * Finds and instantiates the best module of a certain type.
  * All candidates modules having the specified capability and name will be
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index fec60a194c..961ee48122 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -267,6 +267,7 @@ module_need
 module_provides
 module_unneed
 vlc_module_load
+vlc_module_match
 vlc_memstream_open
 vlc_memstream_flush
 vlc_memstream_close
diff --git a/src/modules/modules.c b/src/modules/modules.c
index 004e56c18f..339b893531 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -102,23 +102,6 @@ static bool module_match_name(const module_t *m, const char *name, size_t len)
      return false;
 }
 
-/**
- * Finds the candidate modules for given criteria.
- *
- * All candidates modules having the specified capability and name will be
- * sorted in decreasing order of priority and returned in a heap-allocated
- * table.
- *
- * \param capability capability, i.e. class of module
- * \param names string of comma-separated requested module shortcut names
- * \param strict whether to exclude modules with no unmatching shortcut names
- * \param modules storage location for the base address of a sorted table
- *                of candidate modules [OUT]
- * \param strict_matches storage location for the count of strictly matched
- *                       modules (optional) [OUT]
- * \return number of modules found or a strictly negative value on error
- */
-static
 ssize_t vlc_module_match(const char *capability, const char *names,
                          bool strict, module_t ***restrict modules,
                          size_t *restrict strict_matches)
-- 
2.28.0



More information about the vlc-devel mailing list