RPA Toolkit
work on the RJS code segments
[rpatk.git] / rjs / rjs.h
1 #ifndef _RJS_H_
2 #define _RJS_H_
3
4
5 #ifdef __cplusplus
6 extern "C" {
7 #endif
8
9 #include "rtypes.h"
10 #include "rvmcpu.h"
11 #include "rjsparser.h"
12 #include "rjscompiler.h"
13
14 typedef struct rjs_engine_s {
15         rjs_parser_t *pa;
16         rjs_compiler_t *co;
17         rarray_t *cgs;
18         rvmcpu_t *cpu;
19         rlong debugcompile:1;
20         rlong debugexec:1;
21 } rjs_engine_t;
22
23
24 #define RJS_VERSION_MAJOR 0
25 #define RJS_VERSION_MINOR 51
26 #define RJS_VERSION_MICRO 1
27 #define RJS_VERSION_STRING "0.51.1"
28
29 const rchar *rjs_version();
30
31 rjs_engine_t *rjs_engine_create();
32 void rjs_engine_destroy(rjs_engine_t *jse);
33 rint rjs_engine_open(rjs_engine_t *jse);
34 rint rjs_engine_compile(rjs_engine_t *jse, const rchar *script, rsize_t size);
35 rint rjs_engine_compile_s(rjs_engine_t *jse, const rchar *script);
36 rint rjs_engine_close(rjs_engine_t *jse);
37 rint rjs_engine_run(rjs_engine_t *jse);
38 rint rjs_engine_dumpast(rjs_engine_t *jse, const rchar *script, rsize_t size);
39 rvmreg_t *rjs_engine_exec(rjs_engine_t *jse, const rchar *script, rsize_t size);
40 rvmreg_t *rjs_engine_exec_s(rjs_engine_t *jse, const rchar *script);
41
42
43 #ifdef __cplusplus
44 }
45 #endif
46
47 #endif