summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_js.h
diff options
context:
space:
mode:
authorZhidao HONG <z.hong@f5.com>2022-11-20 23:16:51 +0800
committerZhidao HONG <z.hong@f5.com>2022-11-20 23:16:51 +0800
commit4d6d146e920667a8afeacd355e4fb6a94387066e (patch)
treed25e70f93a4f91960434c4d631072e9936f80e36 /src/nxt_js.h
parent4735931ace321752c387dae04c8b217ef22897ee (diff)
downloadunit-4d6d146e920667a8afeacd355e4fb6a94387066e.tar.gz
unit-4d6d146e920667a8afeacd355e4fb6a94387066e.tar.bz2
Basic njs support.
Diffstat (limited to 'src/nxt_js.h')
-rw-r--r--src/nxt_js.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/src/nxt_js.h b/src/nxt_js.h
new file mode 100644
index 00000000..321041ae
--- /dev/null
+++ b/src/nxt_js.h
@@ -0,0 +1,34 @@
+
+/*
+ * Copyright (C) NGINX, Inc.
+ */
+
+#ifndef _NXT_JS_H_INCLUDED_
+#define _NXT_JS_H_INCLUDED_
+
+#if (NXT_HAVE_NJS)
+
+#include <njs_main.h>
+
+
+typedef struct nxt_js_s nxt_js_t;
+typedef struct nxt_js_conf_s nxt_js_conf_t;
+
+
+typedef struct {
+ njs_vm_t *vm;
+ njs_value_t array;
+} nxt_js_cache_t;
+
+
+nxt_js_conf_t *nxt_js_conf_new(nxt_mp_t *mp);
+nxt_js_t *nxt_js_add_tpl(nxt_js_conf_t *jcf, nxt_str_t *str, nxt_bool_t strz);
+nxt_int_t nxt_js_compile(nxt_js_conf_t *jcf);
+nxt_int_t nxt_js_test(nxt_js_conf_t *jcf, nxt_str_t *str, u_char *error);
+nxt_int_t nxt_js_call(nxt_task_t *task, nxt_js_cache_t *cache, nxt_js_t *js,
+ nxt_str_t *str, void *ctx);
+
+
+#endif /* NXT_HAVE_NJS */
+
+#endif /* _NXT_JS_H_INCLUDED_ */