summaryrefslogtreecommitdiff
path: root/include/json_lib.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/json_lib.h')
-rw-r--r--include/json_lib.h13
1 files changed, 5 insertions, 8 deletions
diff --git a/include/json_lib.h b/include/json_lib.h
index 6d802860cff..de3bc1a47ec 100644
--- a/include/json_lib.h
+++ b/include/json_lib.h
@@ -80,6 +80,7 @@ enum json_path_step_types
JSON_PATH_KEY_OR_ARRAY=3,
JSON_PATH_WILD=4, /* Step like .* or [*] */
JSON_PATH_DOUBLE_WILD=8, /* Step like **.k or **[1] */
+ JSON_PATH_NEGATIVE_INDEX=16, /* Step like [-1] */
JSON_PATH_KEY_WILD= 1+4,
JSON_PATH_KEY_DOUBLEWILD= 1+8,
JSON_PATH_ARRAY_WILD= 2+4,
@@ -93,7 +94,7 @@ typedef struct st_json_path_step_t
/* see json_path_step_types */
const uchar *key; /* Pointer to the beginning of the key. */
const uchar *key_end; /* Pointer to the end of the key. */
- uint n_item; /* Item number in an array. No meaning for the key step. */
+ int n_item; /* Item number in an array. No meaning for the key step. */
} json_path_step_t;
@@ -355,7 +356,7 @@ int json_skip_level_and_count(json_engine_t *j, int *n_items_skipped);
*/
int json_find_path(json_engine_t *je,
json_path_t *p, json_path_step_t **p_cur_step,
- uint *array_counters);
+ int *array_counters);
typedef struct st_json_find_paths_t
@@ -364,7 +365,7 @@ typedef struct st_json_find_paths_t
json_path_t *paths;
uint cur_depth;
uint *path_depths;
- uint array_counters[JSON_DEPTH_LIMIT];
+ int array_counters[JSON_DEPTH_LIMIT];
} json_find_paths_t;
@@ -419,12 +420,8 @@ int json_get_path_start(json_engine_t *je, CHARSET_INFO *i_cs,
int json_get_path_next(json_engine_t *je, json_path_t *p);
-int json_path_parts_compare(
- const json_path_step_t *a, const json_path_step_t *a_end,
- const json_path_step_t *b, const json_path_step_t *b_end,
- enum json_value_types vt);
int json_path_compare(const json_path_t *a, const json_path_t *b,
- enum json_value_types vt);
+ enum json_value_types vt, const int *array_sizes);
int json_valid(const char *js, size_t js_len, CHARSET_INFO *cs);