diff options
Diffstat (limited to 'src/nxt_conf.c')
-rw-r--r-- | src/nxt_conf.c | 24 |
1 files changed, 19 insertions, 5 deletions
diff --git a/src/nxt_conf.c b/src/nxt_conf.c index 79e776a0..c6312f3d 100644 --- a/src/nxt_conf.c +++ b/src/nxt_conf.c @@ -102,7 +102,7 @@ typedef struct { static nxt_int_t nxt_conf_path_next_token(nxt_conf_path_parse_t *parse, nxt_str_t *token); -static u_char *nxt_conf_json_skip_space(u_char *start, u_char *end); +static u_char *nxt_conf_json_skip_space(u_char *start, const u_char *end); static u_char *nxt_conf_json_parse_value(nxt_mp_t *mp, nxt_conf_value_t *value, u_char *start, u_char *end, nxt_conf_json_error_t *error); static u_char *nxt_conf_json_parse_object(nxt_mp_t *mp, nxt_conf_value_t *value, @@ -266,7 +266,7 @@ nxt_conf_create_object(nxt_mp_t *mp, nxt_uint_t count) void nxt_conf_set_member(nxt_conf_value_t *object, nxt_str_t *name, - nxt_conf_value_t *value, uint32_t index) + const nxt_conf_value_t *value, uint32_t index) { nxt_conf_object_member_t *member; @@ -278,6 +278,20 @@ nxt_conf_set_member(nxt_conf_value_t *object, nxt_str_t *name, } +nxt_int_t +nxt_conf_set_member_dup(nxt_conf_value_t *object, nxt_mp_t *mp, nxt_str_t *name, + nxt_conf_value_t *value, uint32_t index) +{ + nxt_conf_object_member_t *member; + + member = &object->u.object->members[index]; + + member->value = *value; + + return nxt_conf_set_string_dup(&member->name, mp, name); +} + + void nxt_conf_set_member_string(nxt_conf_value_t *object, nxt_str_t *name, nxt_str_t *value, uint32_t index) @@ -367,7 +381,7 @@ nxt_conf_create_array(nxt_mp_t *mp, nxt_uint_t count) void nxt_conf_set_element(nxt_conf_value_t *array, nxt_uint_t index, - nxt_conf_value_t *value) + const nxt_conf_value_t *value) { array->u.array->elements[index] = *value; } @@ -1271,7 +1285,7 @@ nxt_conf_json_parse(nxt_mp_t *mp, u_char *start, u_char *end, static u_char * -nxt_conf_json_skip_space(u_char *start, u_char *end) +nxt_conf_json_skip_space(u_char *start, const u_char *end) { u_char *p, ch; @@ -2605,7 +2619,7 @@ nxt_conf_json_escape(u_char *dst, u_char *src, size_t size) void -nxt_conf_json_position(u_char *start, u_char *pos, nxt_uint_t *line, +nxt_conf_json_position(u_char *start, const u_char *pos, nxt_uint_t *line, nxt_uint_t *column) { u_char *p; |