diff options
author | Valentin Bartenev <vbart@nginx.com> | 2017-08-11 19:54:40 +0300 |
---|---|---|
committer | Valentin Bartenev <vbart@nginx.com> | 2017-08-11 19:54:40 +0300 |
commit | 80deee3903e70287f18e0d296d53caae077e6f99 (patch) | |
tree | df447d1ea0e9da893de291a22d4dc10ea7e0475c /src/nxt_conf.h | |
parent | 8bb88aaf5186721db20dd07e1976d52a1bc8332a (diff) | |
download | unit-80deee3903e70287f18e0d296d53caae077e6f99.tar.gz unit-80deee3903e70287f18e0d296d53caae077e6f99.tar.bz2 |
Controller: more HTTP headers and detailed JSON parsing errors.
Diffstat (limited to 'src/nxt_conf.h')
-rw-r--r-- | src/nxt_conf.h | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/nxt_conf.h b/src/nxt_conf.h index 7262d890..30863fbf 100644 --- a/src/nxt_conf.h +++ b/src/nxt_conf.h @@ -22,6 +22,12 @@ typedef struct nxt_conf_value_s nxt_conf_value_t; typedef struct nxt_conf_op_s nxt_conf_op_t; +typedef struct { + u_char *pos; + u_char *detail; +} nxt_conf_json_error_t; + + typedef enum { NXT_CONF_MAP_INT8, NXT_CONF_MAP_INT32, @@ -65,15 +71,18 @@ nxt_int_t nxt_conf_op_compile(nxt_mp_t *mp, nxt_conf_op_t **ops, nxt_conf_value_t *nxt_conf_clone(nxt_mp_t *mp, nxt_conf_op_t *op, nxt_conf_value_t *value); -nxt_conf_value_t *nxt_conf_json_parse(nxt_mp_t *mp, u_char *start, u_char *end); +nxt_conf_value_t *nxt_conf_json_parse(nxt_mp_t *mp, u_char *start, u_char *end, + nxt_conf_json_error_t *error); #define nxt_conf_json_parse_str(mp, str) \ - nxt_conf_json_parse(mp, (str)->start, (str)->start + (str)->length) + nxt_conf_json_parse(mp, (str)->start, (str)->start + (str)->length, NULL) size_t nxt_conf_json_length(nxt_conf_value_t *value, nxt_conf_json_pretty_t *pretty); u_char *nxt_conf_json_print(u_char *p, nxt_conf_value_t *value, nxt_conf_json_pretty_t *pretty); +void nxt_conf_json_position(u_char *start, u_char *pos, nxt_uint_t *line, + nxt_uint_t *column); nxt_int_t nxt_conf_validate(nxt_conf_value_t *value); @@ -82,8 +91,12 @@ void nxt_conf_get_string(nxt_conf_value_t *value, nxt_str_t *str); // FIXME reimplement and reorder functions below nxt_uint_t nxt_conf_object_members_count(nxt_conf_value_t *value); nxt_conf_value_t *nxt_conf_create_object(nxt_mp_t *mp, nxt_uint_t count); -nxt_int_t nxt_conf_set_object_member(nxt_conf_value_t *object, nxt_str_t *name, +void nxt_conf_set_member(nxt_conf_value_t *object, nxt_str_t *name, nxt_conf_value_t *value, uint32_t index); +void nxt_conf_set_member_string(nxt_conf_value_t *object, nxt_str_t *name, + nxt_str_t *value, uint32_t index); +void nxt_conf_set_member_integer(nxt_conf_value_t *object, nxt_str_t *name, + int64_t value, uint32_t index); #endif /* _NXT_CONF_INCLUDED_ */ |