[asterisk-commits] dlee: branch dlee/jansson r378910 - /team/dlee/jansson/include/asterisk/
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Jan 10 12:27:52 CST 2013
Author: dlee
Date: Thu Jan 10 12:27:48 2013
New Revision: 378910
URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=378910
Log:
Added /since tags
Modified:
team/dlee/jansson/include/asterisk/json.h
team/dlee/jansson/include/asterisk/test.h
Modified: team/dlee/jansson/include/asterisk/json.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/jansson/include/asterisk/json.h?view=diff&rev=378910&r1=378909&r2=378910
==============================================================================
--- team/dlee/jansson/include/asterisk/json.h (original)
+++ team/dlee/jansson/include/asterisk/json.h Thu Jan 10 12:27:48 2013
@@ -23,6 +23,8 @@
*
* \brief Asterisk JSON abstraction layer.
*
+ * \since 12.0.0
+ *
* This is a very thin wrapper around the Jansson API. For more details on it, see its
* docs at http://www.digip.org/jansson/doc/2.4/apiref.html.
@@ -34,6 +36,8 @@
/*!
* \brief Specifies custom allocators instead of the standard ast_malloc() and ast_free().
*
+ * \since 12.0.0
+ *
* This is used by the unit tests to do JSON specific memory leak detection. Since it
* affects all users of the JSON library, shouldn't normally be used.
*/
@@ -42,17 +46,24 @@
/*!
* \struct ast_json
* \brief Abstract JSON element (object, array, string, int)
+ *
+ * \since 12.0.0
*/
struct ast_json;
/*!
* \brief Increase refcount on \a value.
+ *
+ * \since 12.0.0
+ *
* \return The given \a value.
*/
struct ast_json *ast_json_ref(struct ast_json *value);
/*!
* \brief Decrease refcount on \a value. If refcount reaches zero, \a value is freed.
+ *
+ * \since 12.0.0
*/
void ast_json_unref(struct ast_json *value);
@@ -62,6 +73,8 @@
/*!
* \brief Valid types of a JSON element.
+ *
+ * \since 12.0.0
*/
enum ast_json_type
{
@@ -77,6 +90,8 @@
/*!
* \brief Return the type of \a value.
+ *
+ * \since 12.0.0
*/
enum ast_json_type ast_json_typeof(const struct ast_json *value);
@@ -86,39 +101,53 @@
/*!
* \brief Gets the JSON true value.
+ *
+ * \since 12.0.0
*/
struct ast_json *ast_json_true(void);
/*!
* \brief Gets the JSON false value.
+ *
+ * \since 12.0.0
*/
struct ast_json *ast_json_false(void);
/*!
* \brief Returns JSON false if \a value is 0, JSON true otherwise.
+ *
+ * \since 12.0.0
*/
struct ast_json *ast_json_boolean(int value);
/*!
* \brief Gets the JSON null value.
+ *
+ * \since 12.0.0
*/
struct ast_json *ast_json_null(void);
/*!
* \brief Returns true (non-zero) if \a value is the JSON true value, false (zero)
* otherwise.
+ *
+ * \since 12.0.0
*/
int ast_json_is_true(const struct ast_json *value);
/*!
* \brief Returns true (non-zero) if \a value is the JSON false value, false (zero)
* otherwise.
+ *
+ * \since 12.0.0
*/
int ast_json_is_false(const struct ast_json *value);
/*!
* \brief Returns true (non-zero) if \a value is the JSON null value, false (zero)
* otherwise.
+ *
+ * \since 12.0.0
*/
int ast_json_is_null(const struct ast_json *value);
@@ -129,6 +158,8 @@
/*!
* \brief Constructs a JSON string from \a value.
*
+ * \since 12.0.0
+ *
* \a value must be a valid ASCII or UTF-8 encoded string.
*
* \return Newly constructed string element, or \c NULL on failure.
@@ -137,12 +168,16 @@
/*!
* \brief Returns the string value of \a string, or \c NULL if it's not a JSON string.
+ *
+ * \since 12.0.0
*/
const char *ast_json_string_get(const struct ast_json *string);
/*!
* \brief Changes the string value of \a string to \a value.
*
+ * \since 12.0.0
+ *
* \return 0 on success, or -1 on error.
*/
int ast_json_string_set(struct ast_json *string, const char *value);
@@ -150,6 +185,8 @@
/*!
* \brief Create a JSON string, printf style.
*
+ * \since 12.0.0
+ *
* \return Newly allocated string, or \c NULL if allocation fails.
*/
struct ast_json *ast_json_stringf(const char *format, ...) __attribute__((format(printf, 1, 2)));
@@ -157,6 +194,8 @@
/*!
* \brief Create a JSON string, vprintf style.
*
+ * \since 12.0.0
+ *
* \return Newly allocated string, or \c NULL if allocation fails.
*/
struct ast_json *ast_json_vstringf(const char *format, va_list args) __attribute__((format(printf, 1, 0)));
@@ -168,6 +207,8 @@
/*!
* \brief Create a JSON integer with the give \a value.
*
+ * \since 12.0.0
+ *
* \return Newly allocated integer, or \c NULL if allocation fails.
*/
struct ast_json *ast_json_integer_create(intmax_t value);
@@ -175,6 +216,8 @@
/*!
* \brief Get the value from \a integer.
*
+ * \since 12.0.0
+ *
* \return integer value, or 0 for non-integers.
*/
intmax_t ast_json_integer_get(const struct ast_json *integer);
@@ -182,6 +225,8 @@
/*!
* \brief Sets the value of \a integer.
*
+ * \since 12.0.0
+ *
* \return 0 on success, -1 on failure
*/
int ast_json_integer_set(struct ast_json *integer, intmax_t value);
@@ -193,17 +238,23 @@
/*!
* \brief Create a empty JSON array.
*
+ * \since 12.0.0
+ *
* \return Newly allocated array, or \c NULL if allocation fails.
*/
struct ast_json *ast_json_array_create(void);
/*!
* \brief Returns the size of \a array, or 0 if argument is not an array.
+ *
+ * \since 12.0.0
*/
size_t ast_json_array_size(const struct ast_json *array);
/*!
* \brief Returns the element in the \a index position from the \a array.
+ *
+ * \since 12.0.0
*
* The returned element is a borrowed reference; use ast_json_ref() to safely keep a
* pointer to it.
@@ -216,6 +267,8 @@
/*!
* \brief Changes the \a index element in \a array to \a value.
*
+ * \since 12.0.0
+ *
* The array steals the \a value reference; use ast_json_ref() to safely keep a pointer
* to it.
*
@@ -226,6 +279,8 @@
/*!
* \brief Appends \a value to \a array.
*
+ * \since 12.0.0
+ *
* The array steals the \a value reference; use ast_json_ref() to safely keep a pointer
* to it.
*
@@ -236,6 +291,8 @@
/*!
* \brief Inserts \a value into \a array at position \a index.
*
+ * \since 12.0.0
+ *
* The array steals the \a value reference; use ast_json_ref() to safely keep a pointer
* to it.
*
@@ -246,6 +303,8 @@
/*!
* \brief Removes the element at position \a index from \a array.
*
+ * \since 12.0.0
+ *
* \return 0 on success, or -1 on failure.
*/
int ast_json_array_remove(struct ast_json *array, size_t index);
@@ -253,12 +312,16 @@
/*!
* \brief Removes all elements from \a array.
*
+ * \since 12.0.0
+ *
* \return 0 on success, or -1 on failure.
*/
int ast_json_array_clear(struct ast_json *array);
/*!
* \brief Appends all elements from \a tail to \a array.
+ *
+ * \since 12.0.0
*
* The \a tail argument is left alone, so ast_json_unref() it when you are done with it.
*
Modified: team/dlee/jansson/include/asterisk/test.h
URL: http://svnview.digium.com/svn/asterisk/team/dlee/jansson/include/asterisk/test.h?view=diff&rev=378910&r1=378909&r2=378910
==============================================================================
--- team/dlee/jansson/include/asterisk/test.h (original)
+++ team/dlee/jansson/include/asterisk/test.h Thu Jan 10 12:27:48 2013
@@ -285,11 +285,15 @@
/*!
* \ref ast_test_check
+ *
+ * \since 12.0.0
*/
enum ast_test_result_state __ast_test_check(const char *file, const char *function, int line, struct ast_test *test, const char *condition_str, enum ast_test_result_state current_res, int condition);
/*!
* \brief Accumulate test results for a test.
+ *
+ * \since 12.0.0
*
* This macro evaluates \a condition, then updates \a res and the test status accordingly. If the condition evaluates to
* true (non-zero), nothing happens. If it evaluates to false (zero), then res is set to \a AST_TEST_FAIL and the failure
More information about the asterisk-commits
mailing list