mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-20 08:40:16 +00:00
Add support for retrieving multiple objects from sorcery using a regex on their id.
Review: https://reviewboard.asterisk.org/r/2329/ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@381614 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -197,6 +197,9 @@ struct ast_sorcery_wizard {
|
||||
/*! \brief Callback for retrieving an object using an id */
|
||||
void *(*retrieve_id)(const struct ast_sorcery *sorcery, void *data, const char *type, const char *id);
|
||||
|
||||
/*! \brief Callback for retrieving multiple objects using a regex on their id */
|
||||
void (*retrieve_regex)(const struct ast_sorcery *sorcery, void *data, const char *type, struct ao2_container *objects, const char *regex);
|
||||
|
||||
/*! \brief Optional callback for retrieving an object using fields */
|
||||
void *(*retrieve_fields)(const struct ast_sorcery *sorcery, void *data, const char *type, const struct ast_variable *fields);
|
||||
|
||||
@@ -548,6 +551,20 @@ void *ast_sorcery_retrieve_by_id(const struct ast_sorcery *sorcery, const char *
|
||||
*/
|
||||
void *ast_sorcery_retrieve_by_fields(const struct ast_sorcery *sorcery, const char *type, unsigned int flags, struct ast_variable *fields);
|
||||
|
||||
/*!
|
||||
* \brief Retrieve multiple objects using a regular expression on their id
|
||||
*
|
||||
* \param sorcery Pointer to a sorcery structure
|
||||
* \param type Type of object to retrieve
|
||||
* \param regex Regular expression
|
||||
*
|
||||
* \retval non-NULL if error occurs
|
||||
* \retval NULL success
|
||||
*
|
||||
* \note The provided regex is treated as extended case sensitive.
|
||||
*/
|
||||
struct ao2_container *ast_sorcery_retrieve_by_regex(const struct ast_sorcery *sorcery, const char *type, const char *regex);
|
||||
|
||||
/*!
|
||||
* \brief Update an object
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user