summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/asterisk.h20
-rw-r--r--include/asterisk/app.h2
-rw-r--r--include/asterisk/module.h2
-rw-r--r--include/asterisk/stasis_cache_pattern.h21
4 files changed, 29 insertions, 16 deletions
diff --git a/include/asterisk.h b/include/asterisk.h
index c501c44ce..873ed5c34 100644
--- a/include/asterisk.h
+++ b/include/asterisk.h
@@ -222,6 +222,9 @@ char *ast_complete_source_filename(const char *partial, int n);
* SVN from modifying them in this file; under normal circumstances they would
* not be present and SVN would expand the Revision keyword into the file's
* revision number.
+ *
+ * \deprecated All new files should use ASTERISK_REGISTER_FILE instead.
+ * \version 11.22.0 deprecated
*/
#ifdef MTX_PROFILE
#define HAVE_MTX_PROFILE /* used in lock.h */
@@ -251,6 +254,23 @@ char *ast_complete_source_filename(const char *partial, int n);
#define ASTERISK_FILE_VERSION(file, x)
#endif /* LOW_MEMORY */
+/*!
+ * \since 11.22.0
+ * \brief Register/unregister a source code file with the core.
+ *
+ * This macro will place a file-scope constructor and destructor into the
+ * source of the module using it; this will cause the file to be
+ * registered with the Asterisk core (and unregistered) at the appropriate
+ * times.
+ *
+ * Example:
+ *
+ * \code
+ * ASTERISK_REGISTER_FILE()
+ * \endcode
+ */
+#define ASTERISK_REGISTER_FILE() ASTERISK_FILE_VERSION(__FILE__, NULL)
+
#if !defined(LOW_MEMORY)
/*!
* \brief support for event profiling
diff --git a/include/asterisk/app.h b/include/asterisk/app.h
index 6171dd4f2..86336e32b 100644
--- a/include/asterisk/app.h
+++ b/include/asterisk/app.h
@@ -580,6 +580,7 @@ int ast_vm_is_registered(void);
*
* \retval 0 on success.
* \retval -1 on error.
+ * \retval AST_MODULE_LOAD_DECLINE if there's already another provider registered.
*/
int __ast_vm_register(const struct ast_vm_functions *vm_table, struct ast_module *module);
@@ -648,6 +649,7 @@ int ast_vm_greeter_is_registered(void);
*
* \retval 0 on success.
* \retval -1 on error.
+ * \retval AST_MODULE_LOAD_DECLINE if there's already another greeter registered.
*/
int __ast_vm_greeter_register(const struct ast_vm_greeter_functions *vm_table, struct ast_module *module);
diff --git a/include/asterisk/module.h b/include/asterisk/module.h
index d201aacc8..35ee8bbd7 100644
--- a/include/asterisk/module.h
+++ b/include/asterisk/module.h
@@ -68,7 +68,7 @@ enum ast_module_unload_mode {
enum ast_module_load_result {
AST_MODULE_LOAD_SUCCESS = 0, /*!< Module loaded and configured */
AST_MODULE_LOAD_DECLINE = 1, /*!< Module is not configured */
- AST_MODULE_LOAD_SKIP = 2, /*!< Module was skipped for some reason */
+ AST_MODULE_LOAD_SKIP = 2, /*!< Module was skipped for some reason (For loader.c use only. Should never be returned by modules)*/
AST_MODULE_LOAD_PRIORITY = 3, /*!< Module is not loaded yet, but is added to prioity heap */
AST_MODULE_LOAD_FAILURE = -1, /*!< Module could not be loaded properly */
};
diff --git a/include/asterisk/stasis_cache_pattern.h b/include/asterisk/stasis_cache_pattern.h
index 27761351a..e61d3e931 100644
--- a/include/asterisk/stasis_cache_pattern.h
+++ b/include/asterisk/stasis_cache_pattern.h
@@ -121,9 +121,12 @@ struct stasis_cp_single *stasis_cp_single_create(struct stasis_cp_all *all,
const char *name);
/*!
- * \brief Create the 'one' side of the cache pattern.
+ * \brief Create a sink in the cache pattern
*
- * Create the 'one' but do not automatically forward.
+ * Create the 'one' but do not automatically forward to the all's topic.
+ * This is useful when aggregating other topic's messages created with
+ * \c stasis_cp_single_create in another caching topic without replicating
+ * those messages in the all's topics.
*
* Dispose of using stasis_cp_single_unsubscribe().
*
@@ -131,22 +134,10 @@ struct stasis_cp_single *stasis_cp_single_create(struct stasis_cp_all *all,
* \param name Base name for the topics.
* \return One side instance
*/
-struct stasis_cp_single *stasis_cp_single_create_only(struct stasis_cp_all *all,
+struct stasis_cp_single *stasis_cp_sink_create(struct stasis_cp_all *all,
const char *name);
/*!
- * \brief Set up a topic and topic cache forward.
- *
- * Forward 'from' to 'to'.
- *
- * \param from Source 'one' side instance.
- * \param to Destination 'one' side instance.
- * \retval 0 Success
- * \retval -1 Failure
- */
-int stasis_cp_single_forward(struct stasis_cp_single *from, struct stasis_cp_single *to);
-
-/*!
* \brief Stops caching and forwarding messages.
*
* \param one One side of the cache pattern.