summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_var.h
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2022-09-13 13:17:16 +0400
committerKonstantin Pavlov <thresh@nginx.com>2022-09-13 13:17:16 +0400
commitce964aa30b163e2b3263c5af57c1a6dae7d0cebb (patch)
tree26bf70c1a5991f6471fc4caed8628e068fdc0b7b /src/nxt_var.h
parenteba4c3c98fa1bf275d94df8c727f70692ae7eae1 (diff)
parent38bd7e76a134084ab95a4ee3125af1ccd7b35864 (diff)
downloadunit-ce964aa30b163e2b3263c5af57c1a6dae7d0cebb.tar.gz
unit-ce964aa30b163e2b3263c5af57c1a6dae7d0cebb.tar.bz2
Merged with the default branch.1.28.0-1
Diffstat (limited to 'src/nxt_var.h')
-rw-r--r--src/nxt_var.h39
1 files changed, 29 insertions, 10 deletions
diff --git a/src/nxt_var.h b/src/nxt_var.h
index 3b7d0c28..cc7ff502 100644
--- a/src/nxt_var.h
+++ b/src/nxt_var.h
@@ -12,17 +12,32 @@ typedef struct nxt_var_query_s nxt_var_query_t;
typedef nxt_int_t (*nxt_var_handler_t)(nxt_task_t *task,
- nxt_var_query_t *query,
nxt_str_t *str,
- void *ctx);
+ void *ctx, uint16_t field);
+
+typedef int64_t (*nxt_var_field_hash_t)(nxt_mp_t *mp, nxt_str_t *str);
typedef struct {
- nxt_str_t name;
- nxt_var_handler_t handler;
- uint32_t index;
+ nxt_str_t name;
+ nxt_var_handler_t handler;
+ nxt_var_field_hash_t field_hash;
+ uint32_t index;
} nxt_var_decl_t;
+typedef struct {
+ nxt_str_t name;
+ uint16_t hash;
+ uint32_t index;
+} nxt_var_field_t;
+
+
+typedef enum {
+ NXT_VAR_STRZ = 1 << 0,
+ NXT_VAR_LOGGING = 1 << 1,
+} nxt_var_flags_t;
+
+
nxt_inline nxt_bool_t
nxt_is_var(nxt_str_t *str)
{
@@ -30,13 +45,17 @@ nxt_is_var(nxt_str_t *str)
}
-void nxt_var_raw(nxt_var_t *var, nxt_str_t *str);
-nxt_bool_t nxt_var_is_const(nxt_var_t *var);
-
nxt_int_t nxt_var_register(nxt_var_decl_t *decl, size_t n);
nxt_int_t nxt_var_index_init(void);
-nxt_var_t *nxt_var_compile(nxt_str_t *str, nxt_mp_t *mp, nxt_bool_t strz);
-nxt_int_t nxt_var_test(nxt_str_t *str, u_char *error);
+
+nxt_var_field_t *nxt_var_field_get(nxt_array_t *fields, uint16_t index);
+
+nxt_var_t *nxt_var_compile(nxt_str_t *str, nxt_mp_t *mp, nxt_array_t *fields,
+ nxt_var_flags_t flags);
+nxt_int_t nxt_var_test(nxt_str_t *str, nxt_array_t *fields, u_char *error);
+
+nxt_bool_t nxt_var_is_const(nxt_var_t *var);
+void nxt_var_raw(nxt_var_t *var, nxt_str_t *str);
nxt_int_t nxt_var_query_init(nxt_var_query_t **query_p, void *ctx,
nxt_mp_t *mp);