summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2021-08-29 14:37:45 +0300
committerSergei Petrunia <psergey@askmonty.org>2022-01-19 18:10:09 +0300
commit2a1cdbabec1d918562d2cc87c710e9fe21afbf00 (patch)
treeb9fdaaac6443a69fe75e39d4d9c46d333846c99b /include
parenta0b4a86822292929ada9186b899ac5c4f3c96b60 (diff)
downloadmariadb-git-2a1cdbabec1d918562d2cc87c710e9fe21afbf00.tar.gz
Fix JSON parsing: future-proof data representation in JSON, code cleanup
Diffstat (limited to 'include')
-rw-r--r--include/json_lib.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/include/json_lib.h b/include/json_lib.h
index 2248b1a9388..e9f3deea415 100644
--- a/include/json_lib.h
+++ b/include/json_lib.h
@@ -283,12 +283,13 @@ int json_key_matches(json_engine_t *je, json_string_t *k);
int json_read_value(json_engine_t *j);
/*
- * json_smart_read_value() reads parses a scalar value and value length from the json engine,
- * and copies them into `value` and `value_length` respectively.
- * It should only be called when the json_engine state is JST_VALUE.
- * If it encounters a non-scalar value (say object or array) before getting to value_len,
- * such value is also read and copied into value.
- */
+ json_smart_read_value() reads a JSON value. Pointer to value is stored in
+ *value and its length in *value_len.
+
+ if the value is non a scalar, it returns pointers to its JSON
+ representation.
+ The function should only be called when je->state==JST_VALUE.
+*/
enum json_types json_smart_read_value(json_engine_t *je, const char **value, int *value_len);
/*