diff options
author | Sean Bright <sean.bright@gmail.com> | 2017-02-21 09:56:54 -0500 |
---|---|---|
committer | Sean Bright <sean.bright@gmail.com> | 2017-02-21 10:53:17 -0600 |
commit | 6e6c96d713be2b745c4e033b6e5710dea72088df (patch) | |
tree | f112d117f05eaf4ea86b4c08317304ddaf20f0b0 /include/asterisk/config.h | |
parent | 144b09ab41274498637a6cd8601f653658ecca8b (diff) |
realtime: Centralize some common realtime backend code
All of the realtime backends create artificial ast_categorys to pass
back into the core as query results. These categories have no filename
or line number information associated with them and the backends differ
slightly on how they create them. So create a couple helper macros to
help make things more consistent.
Also updated the call sites to remove redundant error messages about
memory allocation failure.
Note that res_config_ldap sets the category filename to the 'table name'
but that is not read by anything in the core, so I've dropped it.
Change-Id: I3a1fd91e0c807dea1ce3b643b0a6fe5be9002897
Diffstat (limited to 'include/asterisk/config.h')
-rw-r--r-- | include/asterisk/config.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/include/asterisk/config.h b/include/asterisk/config.h index 4944a3af2..f57966b0b 100644 --- a/include/asterisk/config.h +++ b/include/asterisk/config.h @@ -834,6 +834,18 @@ const char *ast_config_option(struct ast_config *cfg, const char *cat, const cha struct ast_category *ast_category_new(const char *name, const char *in_file, int lineno); /*! + * \brief Create a category that is not backed by a file + * + * \param name name of new category + */ +#define ast_category_new_dynamic(name) ast_category_new(name, "", -1) + +/*! + * \brief Create a nameless category that is not backed by a file + */ +#define ast_category_new_anonymous() ast_category_new_dynamic("") + +/*! * \brief Create a category making it a template * * \param name name of new template |