[vlc-devel] [PATCH] add module_get_shortcuts

Francois Cartegnie fcvlcdev at free.fr
Wed Feb 25 14:48:29 CET 2015


We only had a way to get the first shortcut.
There's was way to know which module handles a
shortcut which isn't first one.
---
 include/vlc_modules.h |  1 +
 src/libvlccore.sym    |  1 +
 src/modules/modules.c | 13 +++++++++++++
 3 files changed, 15 insertions(+)

diff --git a/include/vlc_modules.h b/include/vlc_modules.h
index 7f45217..2c7ecf5 100644
--- a/include/vlc_modules.h
+++ b/include/vlc_modules.h
@@ -58,6 +58,7 @@ VLC_API module_t ** module_list_get(size_t *n) VLC_USED;
 
 VLC_API bool module_provides( const module_t *m, const char *cap );
 VLC_API const char * module_get_object( const module_t *m ) VLC_USED;
+VLC_API int module_get_shortcuts( const module_t *m, const char ***ppp_shortcuts ) VLC_USED;
 VLC_API const char * module_get_name( const module_t *m, bool long_name ) VLC_USED;
 #define module_GetLongName( m ) module_get_name( m, true )
 VLC_API const char * module_get_help( const module_t *m ) VLC_USED;
diff --git a/src/libvlccore.sym b/src/libvlccore.sym
index 7f06ed6..781d126 100644
--- a/src/libvlccore.sym
+++ b/src/libvlccore.sym
@@ -252,6 +252,7 @@ module_get_help
 module_get_name
 module_get_object
 module_get_score
+module_get_shortcuts
 module_gettext
 module_list_free
 module_list_get
diff --git a/src/modules/modules.c b/src/modules/modules.c
index 2fa9928..9d05b30 100644
--- a/src/modules/modules.c
+++ b/src/modules/modules.c
@@ -69,6 +69,19 @@ const char *module_get_object( const module_t *m )
 }
 
 /**
+ * Get shortcuts names of a module
+ *
+ * \param m the module
+ * \param ppp_shortcuts the module shortcuts
+ * \return int number of module shortcuts
+ */
+int module_get_shortcuts( const module_t *m, const char ***ppp_shortcuts )
+{
+    *ppp_shortcuts = m->pp_shortcuts;
+    return m->i_shortcuts;
+}
+
+/**
  * Get the human-friendly name of a module.
  *
  * \param m the module
-- 
2.1.0




More information about the vlc-devel mailing list