summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorCorey Farrell <git@cfware.com>2017-10-30 18:30:18 -0400
committerCorey Farrell <git@cfware.com>2017-11-02 08:29:47 -0400
commitaf2947c013b2ce15c2e65f10fd80df233ec58569 (patch)
tree1f6494f53b8daa57ad0ed3960f5eb25bae7c9fd3 /include
parent21b922b565bdba9254445d1002a8a077d50ebe88 (diff)
Modules: Additional improvements to CLI completion.
Replace 'needsreload' argument with a 'type' argument to specify which type of modules you want completion. This provides more accurate CLI completion for load and unload commands. * 'module unload' now excludes modules that have active references or are not running. * 'module load' now excludes modules that are already running. * 'core set debug [atleast] <level> [module]' shows running modules only. ASTERISK-27378 Change-Id: Iea3e00054461484196c46f688f02635cc886bad1
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/module.h21
1 files changed, 17 insertions, 4 deletions
diff --git a/include/asterisk/module.h b/include/asterisk/module.h
index e614a726f..6c60429c9 100644
--- a/include/asterisk/module.h
+++ b/include/asterisk/module.h
@@ -94,6 +94,20 @@ enum ast_module_support_level {
AST_MODULE_SUPPORT_DEPRECATED,
};
+/*! Used to specify which modules should be returned by ast_module_helper. */
+enum ast_module_helper_type {
+ /*! Modules that are loaded by dlopen. */
+ AST_MODULE_HELPER_LOADED = 0,
+ /*! Running modules that include a reload callback. */
+ AST_MODULE_HELPER_RELOAD = 1,
+ /*! Modules that can be loaded or started. */
+ AST_MODULE_HELPER_LOAD,
+ /*! Modules that can be unloaded. */
+ AST_MODULE_HELPER_UNLOAD,
+ /*! Running modules */
+ AST_MODULE_HELPER_RUNNING,
+};
+
/*!
* \brief Load a module.
* \param resource_name The name of the module to load.
@@ -237,14 +251,13 @@ int ast_loader_unregister(int (*updater)(void));
* \param state The possible match to return.
* \param rpos The position we should be matching. This should be the same as
* pos.
- * \param needsreload This should be 1 if we need to reload this module and 0
- * otherwise. This function will only return modules that are reloadble
- * if this is 1.
+ * \param type The type of action that will be performed by CLI.
+ * This argument accepts values of enum ast_module_helper_type.
*
* \retval A possible completion of the partial match.
* \retval NULL if no matches were found.
*/
-char *ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, int needsreload);
+char *ast_module_helper(const char *line, const char *word, int pos, int state, int rpos, int type);
/* Opaque type for module handles generated by the loader */