summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_conf.h
diff options
context:
space:
mode:
authorValentin Bartenev <vbart@nginx.com>2019-04-24 20:31:00 +0300
committerValentin Bartenev <vbart@nginx.com>2019-04-24 20:31:00 +0300
commit6a6bc63c48501027f01d16fbd211eb4425c1a1e8 (patch)
treed718054805235dad13d0d06cf33e291cc385ce1b /src/nxt_conf.h
parent4d35a7bbacb1013388491140964dab8ffab1d0ae (diff)
downloadunit-6a6bc63c48501027f01d16fbd211eb4425c1a1e8.tar.gz
unit-6a6bc63c48501027f01d16fbd211eb4425c1a1e8.tar.bz2
Configuration: support for POST operations on arrays.
It allows to add an array element without specifying the index.
Diffstat (limited to '')
-rw-r--r--src/nxt_conf.h13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/nxt_conf.h b/src/nxt_conf.h
index 20ff3b1e..2435b0e2 100644
--- a/src/nxt_conf.h
+++ b/src/nxt_conf.h
@@ -20,6 +20,14 @@ typedef enum {
} nxt_conf_type_t;
+typedef enum {
+ NXT_CONF_OP_OK = 0,
+ NXT_CONF_OP_NOT_FOUND,
+ NXT_CONF_OP_NOT_ALLOWED,
+ NXT_CONF_OP_ERROR,
+} nxt_conf_op_ret_t;
+
+
typedef struct nxt_conf_value_s nxt_conf_value_t;
typedef struct nxt_conf_op_s nxt_conf_op_t;
@@ -80,8 +88,9 @@ NXT_EXPORT nxt_conf_value_t *nxt_conf_get_array_element(nxt_conf_value_t *value,
NXT_EXPORT 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_int_t 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_conf_op_ret_t 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_bool_t add);
nxt_conf_value_t *nxt_conf_clone(nxt_mp_t *mp, nxt_conf_op_t *op,
nxt_conf_value_t *value);