Introduced nxt_conf_get_array_element().
This commit is contained in:
@@ -600,6 +600,25 @@ nxt_conf_next_object_member(nxt_conf_value_t *value, nxt_str_t *name,
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
nxt_conf_value_t *
|
||||||
|
nxt_conf_get_array_element(nxt_conf_value_t *value, uint32_t index)
|
||||||
|
{
|
||||||
|
nxt_conf_array_t *array;
|
||||||
|
|
||||||
|
if (value->type != NXT_CONF_VALUE_ARRAY) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
array = value->u.array;
|
||||||
|
|
||||||
|
if (index >= array->count) {
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
return &array->elements[index];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
nxt_int_t
|
nxt_int_t
|
||||||
nxt_conf_op_compile(nxt_mp_t *mp, nxt_conf_op_t **ops, nxt_conf_value_t *root,
|
nxt_conf_op_compile(nxt_mp_t *mp, nxt_conf_op_t **ops, nxt_conf_value_t *root,
|
||||||
nxt_str_t *path, nxt_conf_value_t *value)
|
nxt_str_t *path, nxt_conf_value_t *value)
|
||||||
|
|||||||
@@ -64,6 +64,8 @@ nxt_conf_value_t *nxt_conf_get_object_member(nxt_conf_value_t *value,
|
|||||||
nxt_str_t *name, uint32_t *index);
|
nxt_str_t *name, uint32_t *index);
|
||||||
nxt_conf_value_t *nxt_conf_next_object_member(nxt_conf_value_t *value,
|
nxt_conf_value_t *nxt_conf_next_object_member(nxt_conf_value_t *value,
|
||||||
nxt_str_t *name, uint32_t *next);
|
nxt_str_t *name, uint32_t *next);
|
||||||
|
nxt_conf_value_t *nxt_conf_get_array_element(nxt_conf_value_t *value,
|
||||||
|
uint32_t index);
|
||||||
|
|
||||||
nxt_int_t nxt_conf_map_object(nxt_mp_t *mp, nxt_conf_value_t *value,
|
nxt_int_t nxt_conf_map_object(nxt_mp_t *mp, nxt_conf_value_t *value,
|
||||||
nxt_conf_map_t *map, nxt_uint_t n, void *data);
|
nxt_conf_map_t *map, nxt_uint_t n, void *data);
|
||||||
|
|||||||
Reference in New Issue
Block a user