summaryrefslogtreecommitdiffhomepage
path: root/src/nxt_js.h
diff options
context:
space:
mode:
authorKonstantin Pavlov <thresh@nginx.com>2022-12-15 08:17:39 -0800
committerKonstantin Pavlov <thresh@nginx.com>2022-12-15 08:17:39 -0800
commite22669f2728814aba82da14702d18bfa9685311e (patch)
treec9c9471dab359e8e33fca24c5d4f035ab5b278db /src/nxt_js.h
parenta1d28488f9df8e28ee25ea438c275b96b9afe5b6 (diff)
parent4409a10ff0bd6bb45fb88716bd383cd867958a8a (diff)
downloadunit-e22669f2728814aba82da14702d18bfa9685311e.tar.gz
unit-e22669f2728814aba82da14702d18bfa9685311e.tar.bz2
Merged with the default branch.
Diffstat (limited to 'src/nxt_js.h')
-rw-r--r--src/nxt_js.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/src/nxt_js.h b/src/nxt_js.h
new file mode 100644
index 00000000..dea43fe3
--- /dev/null
+++ b/src/nxt_js.h
@@ -0,0 +1,38 @@
+
+/*
+ * 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);
+void nxt_js_set_proto(nxt_js_conf_t *jcf, njs_external_t *proto, nxt_uint_t n);
+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);
+
+
+extern njs_int_t nxt_js_proto_id;
+
+
+#endif /* NXT_HAVE_NJS */
+
+#endif /* _NXT_JS_H_INCLUDED_ */