nxt_conf.h (2076:1be3131609fd) nxt_conf.h (2139:99d792169ffb)
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#ifndef _NXT_CONF_INCLUDED_

--- 95 unchanged lines hidden (view full) ---

104
105#define nxt_conf_json_parse_str(mp, str) \
106 nxt_conf_json_parse(mp, (str)->start, (str)->start + (str)->length, NULL)
107
108size_t nxt_conf_json_length(nxt_conf_value_t *value,
109 nxt_conf_json_pretty_t *pretty);
110u_char *nxt_conf_json_print(u_char *p, nxt_conf_value_t *value,
111 nxt_conf_json_pretty_t *pretty);
1
2/*
3 * Copyright (C) Igor Sysoev
4 * Copyright (C) Valentin V. Bartenev
5 * Copyright (C) NGINX, Inc.
6 */
7
8#ifndef _NXT_CONF_INCLUDED_

--- 95 unchanged lines hidden (view full) ---

104
105#define nxt_conf_json_parse_str(mp, str) \
106 nxt_conf_json_parse(mp, (str)->start, (str)->start + (str)->length, NULL)
107
108size_t nxt_conf_json_length(nxt_conf_value_t *value,
109 nxt_conf_json_pretty_t *pretty);
110u_char *nxt_conf_json_print(u_char *p, nxt_conf_value_t *value,
111 nxt_conf_json_pretty_t *pretty);
112void nxt_conf_json_position(u_char *start, u_char *pos, nxt_uint_t *line,
112void nxt_conf_json_position(u_char *start, const u_char *pos, nxt_uint_t *line,
113 nxt_uint_t *column);
114
115nxt_int_t nxt_conf_validate(nxt_conf_validation_t *vldt);
116
117NXT_EXPORT void nxt_conf_get_string(nxt_conf_value_t *value, nxt_str_t *str);
118NXT_EXPORT void nxt_conf_set_string(nxt_conf_value_t *value, nxt_str_t *str);
119NXT_EXPORT nxt_int_t nxt_conf_set_string_dup(nxt_conf_value_t *value,
120 nxt_mp_t *mp, const nxt_str_t *str);
121NXT_EXPORT double nxt_conf_get_number(nxt_conf_value_t *value);
122NXT_EXPORT uint8_t nxt_conf_get_boolean(nxt_conf_value_t *value);
123
124// FIXME reimplement and reorder functions below
125NXT_EXPORT nxt_uint_t nxt_conf_object_members_count(nxt_conf_value_t *value);
126nxt_conf_value_t *nxt_conf_create_object(nxt_mp_t *mp, nxt_uint_t count);
127void nxt_conf_set_member(nxt_conf_value_t *object, nxt_str_t *name,
113 nxt_uint_t *column);
114
115nxt_int_t nxt_conf_validate(nxt_conf_validation_t *vldt);
116
117NXT_EXPORT void nxt_conf_get_string(nxt_conf_value_t *value, nxt_str_t *str);
118NXT_EXPORT void nxt_conf_set_string(nxt_conf_value_t *value, nxt_str_t *str);
119NXT_EXPORT nxt_int_t nxt_conf_set_string_dup(nxt_conf_value_t *value,
120 nxt_mp_t *mp, const nxt_str_t *str);
121NXT_EXPORT double nxt_conf_get_number(nxt_conf_value_t *value);
122NXT_EXPORT uint8_t nxt_conf_get_boolean(nxt_conf_value_t *value);
123
124// FIXME reimplement and reorder functions below
125NXT_EXPORT nxt_uint_t nxt_conf_object_members_count(nxt_conf_value_t *value);
126nxt_conf_value_t *nxt_conf_create_object(nxt_mp_t *mp, nxt_uint_t count);
127void nxt_conf_set_member(nxt_conf_value_t *object, nxt_str_t *name,
128 nxt_conf_value_t *value, uint32_t index);
128 const nxt_conf_value_t *value, uint32_t index);
129void nxt_conf_set_member_string(nxt_conf_value_t *object, nxt_str_t *name,
130 nxt_str_t *value, uint32_t index);
131nxt_int_t nxt_conf_set_member_string_dup(nxt_conf_value_t *object, nxt_mp_t *mp,
132 nxt_str_t *name, nxt_str_t *value, uint32_t index);
133void nxt_conf_set_member_integer(nxt_conf_value_t *object, nxt_str_t *name,
134 int64_t value, uint32_t index);
135void nxt_conf_set_member_null(nxt_conf_value_t *object, nxt_str_t *name,
136 uint32_t index);
137
138nxt_conf_value_t *nxt_conf_create_array(nxt_mp_t *mp, nxt_uint_t count);
139void nxt_conf_set_element(nxt_conf_value_t *array, nxt_uint_t index,
129void nxt_conf_set_member_string(nxt_conf_value_t *object, nxt_str_t *name,
130 nxt_str_t *value, uint32_t index);
131nxt_int_t nxt_conf_set_member_string_dup(nxt_conf_value_t *object, nxt_mp_t *mp,
132 nxt_str_t *name, nxt_str_t *value, uint32_t index);
133void nxt_conf_set_member_integer(nxt_conf_value_t *object, nxt_str_t *name,
134 int64_t value, uint32_t index);
135void nxt_conf_set_member_null(nxt_conf_value_t *object, nxt_str_t *name,
136 uint32_t index);
137
138nxt_conf_value_t *nxt_conf_create_array(nxt_mp_t *mp, nxt_uint_t count);
139void nxt_conf_set_element(nxt_conf_value_t *array, nxt_uint_t index,
140 nxt_conf_value_t *value);
140 const nxt_conf_value_t *value);
141nxt_int_t nxt_conf_set_element_string_dup(nxt_conf_value_t *array, nxt_mp_t *mp,
142 nxt_uint_t index, nxt_str_t *value);
143NXT_EXPORT nxt_uint_t nxt_conf_array_elements_count(nxt_conf_value_t *value);
144NXT_EXPORT nxt_uint_t nxt_conf_array_elements_count_or_1(
145 nxt_conf_value_t *value);
146void nxt_conf_array_qsort(nxt_conf_value_t *value,
147 int (*compare)(const void *, const void *));
148
149
150#endif /* _NXT_CONF_INCLUDED_ */
141nxt_int_t nxt_conf_set_element_string_dup(nxt_conf_value_t *array, nxt_mp_t *mp,
142 nxt_uint_t index, nxt_str_t *value);
143NXT_EXPORT nxt_uint_t nxt_conf_array_elements_count(nxt_conf_value_t *value);
144NXT_EXPORT nxt_uint_t nxt_conf_array_elements_count_or_1(
145 nxt_conf_value_t *value);
146void nxt_conf_array_qsort(nxt_conf_value_t *value,
147 int (*compare)(const void *, const void *));
148
149
150#endif /* _NXT_CONF_INCLUDED_ */