summaryrefslogtreecommitdiff
path: root/include/apr_json.h
diff options
context:
space:
mode:
authorGraham Leggett <minfrin@apache.org>2018-09-01 10:04:16 +0000
committerGraham Leggett <minfrin@apache.org>2018-09-01 10:04:16 +0000
commit5f2629a7697bf106e7473c854674384443d1a763 (patch)
tree1c3bd8600a297e1b33fcca12698e3e5b3a2db0c4 /include/apr_json.h
parent42fb641622c00adc6c822cdfc78ebecc73cfc3fe (diff)
downloadapr-5f2629a7697bf106e7473c854674384443d1a763.tar.gz
Revert 1839755 for now to unblock apr_jose.h.
git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@1839813 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'include/apr_json.h')
-rw-r--r--include/apr_json.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/include/apr_json.h b/include/apr_json.h
index a41180eae..06ec58ebf 100644
--- a/include/apr_json.h
+++ b/include/apr_json.h
@@ -178,7 +178,7 @@ struct apr_json_object_t {
* Use apr_json_array_create() to allocate.
*/
struct apr_json_array_t {
- /** The values in the array are in this list */
+ /** The key value pairs in the object are in this list */
APR_RING_HEAD(apr_json_array_list_t, apr_json_value_t) list;
/** Array of JSON objects */
apr_array_header_t *array;
@@ -271,9 +271,8 @@ APR_DECLARE(apr_json_value_t *)
/**
* Associate a value with a key in a JSON object.
* @param obj The JSON object.
- * @param key Pointer to the key.
- * @param klen Length of the key, or APR_JSON_VALUE_STRING if NUL
- * terminated.
+ * @param key Pointer to the key string, including any whitespace
+ * required.
* @param val Value to associate with the key.
* @param pool Pool to use.
* @return APR_SUCCESS on success, APR_EINVAL if the key is
@@ -281,19 +280,20 @@ APR_DECLARE(apr_json_value_t *)
* @remark If the value is NULL the key value pair is deleted.
*/
APR_DECLARE(apr_status_t) apr_json_object_set(apr_json_value_t *obj,
- const char *key, apr_ssize_t klen, apr_json_value_t *val,
- apr_pool_t *pool) __attribute__((nonnull(1, 2, 5)));
+ apr_json_value_t *key, apr_json_value_t *val,
+ apr_pool_t *pool) __attribute__((nonnull(1, 4)));
/**
* Look up the value associated with a key in a JSON object.
* @param obj The JSON object.
* @param key Pointer to the key.
* @param klen Length of the key, or APR_JSON_VALUE_STRING if NUL
- * terminated.
+ * terminated.
* @return Returns NULL if the key is not present.
*/
-APR_DECLARE(apr_json_kv_t *) apr_json_object_get(apr_json_value_t *obj,
- const char *key, apr_ssize_t klen)
+APR_DECLARE(apr_json_kv_t *)
+ apr_json_object_get(apr_json_value_t *obj, const char *key,
+ apr_ssize_t klen)
__attribute__((nonnull(1, 2)));
/**
@@ -325,12 +325,13 @@ APR_DECLARE(apr_json_kv_t *) apr_json_object_next(apr_json_value_t *obj,
* Add the value to the end of this array.
* @param arr The JSON array.
* @param val Value to add to the array.
+ * @param pool Pool to use.
* @return APR_SUCCESS on success, APR_EINVAL if the array value is not
* an APR_JSON_ARRAY.
*/
APR_DECLARE(apr_status_t) apr_json_array_add(apr_json_value_t *arr,
- apr_json_value_t *val)
- __attribute__((nonnull(1, 2)));
+ apr_json_value_t *val, apr_pool_t *pool)
+ __attribute__((nonnull(1, 2, 3)));
/**
* Look up the value associated with a key in a JSON object.