[asterisk-commits] eliel: branch group/data_api_gsoc2009 r199280 - in /team/group/data_api_gsoc2...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Fri Jun 5 13:45:32 CDT 2009
Author: eliel
Date: Fri Jun 5 13:45:28 2009
New Revision: 199280
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199280
Log:
Specify the data api iterators.
Modified:
team/group/data_api_gsoc2009/include/asterisk/data.h
team/group/data_api_gsoc2009/main/data.c
Modified: team/group/data_api_gsoc2009/include/asterisk/data.h
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/include/asterisk/data.h?view=diff&rev=199280&r1=199279&r2=199280
==============================================================================
--- team/group/data_api_gsoc2009/include/asterisk/data.h (original)
+++ team/group/data_api_gsoc2009/include/asterisk/data.h Fri Jun 5 13:45:28 2009
@@ -77,11 +77,9 @@
/*! \brief opaque definition of an ast_data handler. */
struct ast_data;
-/*! \brief opaque definition of an ast_data_node result. */
-struct ast_data_node;
-
-typedef struct ast_data_node *(*ast_data_get_cb)(void);
-typedef struct ast_data_node *(*ast_data_put_cb)(void);
+
+typedef struct ast_data *(*ast_data_get_cb)(void);
+typedef struct ast_data *(*ast_data_put_cb)(void);
/*! \brief The structure of the node handler. */
struct ast_data_handler {
@@ -170,6 +168,31 @@
*/
void ast_data_free(struct ast_data *res);
+/*!
+ * \brief Initialize an iterator.
+ * \param[in] tree The returned tree by a call to ast_data_get.
+ * \param[in] elements Which elements to iterate through.
+ * \retval NULL on error.
+ * \retval A dinamically allocated iterator structure.
+ */
+struct ast_data_iterator *ast_data_iterator_start(struct ast_data *tree, const char *elements);
+
+/*!
+ * \brief Release (stop using) an iterator.
+ * \param[in] iterator The iterator created by ast_data_iterator_start.
+ * \see ast_data_iterator_start
+ */
+struct ast_data *ast_data_iterator_stop(struct ast_data_iterator *iterator);
+
+/*!
+ * \brief Get the next node of the tree.
+ * \param[in] iterator The iterator structure returned by ast_data_iterator_start.
+ * \retval NULL when no more nodes to return.
+ * \retval A node of the ast_data tree.
+ * \see ast_data_iterator_start, ast_data_iterator_stop
+ */
+struct ast_data *ast_data_iterator_next(struct ast_data_iterator *iterator);
+
#if defined(__cplusplus) || defined(c_plusplus)
}
#endif
Modified: team/group/data_api_gsoc2009/main/data.c
URL: http://svn.asterisk.org/svn-view/asterisk/team/group/data_api_gsoc2009/main/data.c?view=diff&rev=199280&r1=199279&r2=199280
==============================================================================
--- team/group/data_api_gsoc2009/main/data.c (original)
+++ team/group/data_api_gsoc2009/main/data.c Fri Jun 5 13:45:28 2009
@@ -433,9 +433,9 @@
}
/* XXX: test callback */
-static struct ast_data_node *test_data_provider(void)
-{
- struct ast_data_node *res = NULL;
+static struct ast_data *test_data_provider(void)
+{
+ struct ast_data *res = NULL;
return res;
}
More information about the asterisk-commits
mailing list