summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_var.h
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2022-11-20 23:15:01 +0800
committerZhidao HONG <z.hong@f5.com>2022-11-20 23:15:01 +0800
commit4735931ace321752c387dae04c8b217ef22897ee (patch)
treebb1a7a030094721d25683f999e828e7fab71c1f9 /src/nxt_var.h
parent0c9f417affcef25b2ede5aaf0967eb411a247e33 (diff)
downloadunit-4735931ace321752c387dae04c8b217ef22897ee.tar.gz
unit-4735931ace321752c387dae04c8b217ef22897ee.tar.bz2
Var: separating nxt_tstr_t from nxt_var_t.
It's for the introduction of njs support. For each option that supports native variable and JS template literals introduced next, it's unified as template string. No functional changes.
Diffstat (limited to '')
-rw-r--r--src/nxt_var.h25
1 files changed, 8 insertions, 17 deletions
diff --git a/src/nxt_var.h b/src/nxt_var.h
index 34c8857a..2c6f13bd 100644
--- a/src/nxt_var.h
+++ b/src/nxt_var.h
@@ -32,10 +32,11 @@ typedef struct {
} nxt_var_field_t;
-typedef enum {
- NXT_VAR_STRZ = 1 << 0,
- NXT_VAR_LOGGING = 1 << 1,
-} nxt_var_flags_t;
+typedef struct {
+ nxt_mp_t *pool;
+ nxt_lvlhsh_t hash;
+ nxt_str_t *spare;
+} nxt_var_cache_t;
nxt_inline nxt_bool_t
@@ -50,21 +51,11 @@ nxt_int_t nxt_var_index_init(void);
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_var_t *nxt_var_compile(nxt_str_t *str, nxt_mp_t *mp, nxt_array_t *fields);
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);
-void nxt_var_query(nxt_task_t *task, nxt_var_query_t *query,
- nxt_var_t *var, nxt_str_t *str);
-void nxt_var_query_resolve(nxt_task_t *task, nxt_var_query_t *query, void *data,
- nxt_work_handler_t ready, nxt_work_handler_t error);
-void nxt_var_query_handle(nxt_task_t *task, nxt_var_query_t *query,
- nxt_bool_t failed);
+nxt_int_t nxt_var_interpreter(nxt_task_t *task, nxt_var_cache_t *cache,
+ nxt_var_t *var, nxt_str_t *str, void *ctx, nxt_bool_t logging);
#endif /* _NXT_VAR_H_INCLUDED_ */