2021-11-30 21:29:18 -06:00
|
|
|
#ifndef SCRIPT_H
|
|
|
|
#define SCRIPT_H
|
|
|
|
|
2024-06-05 16:07:44 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
extern "C" {
|
|
|
|
#endif
|
|
|
|
|
2023-04-18 14:49:17 -05:00
|
|
|
#include "quickjs/quickjs.h"
|
|
|
|
#include <time.h>
|
2022-08-07 01:43:45 -05:00
|
|
|
|
2023-04-18 17:58:44 -05:00
|
|
|
extern JSContext *js;
|
2024-07-24 08:26:29 -05:00
|
|
|
extern JSRuntime *rt;
|
2023-01-11 16:57:34 -06:00
|
|
|
|
2023-12-11 08:36:45 -06:00
|
|
|
struct phys_cbs {
|
2024-01-03 17:19:13 -06:00
|
|
|
JSValue begin;
|
|
|
|
JSValue bhit;
|
|
|
|
JSValue separate;
|
|
|
|
JSValue shit;
|
2023-12-11 08:36:45 -06:00
|
|
|
};
|
|
|
|
|
2023-04-22 14:07:37 -05:00
|
|
|
void script_startup();
|
2023-10-04 08:18:09 -05:00
|
|
|
void script_stop();
|
2023-02-23 17:03:58 -06:00
|
|
|
|
2023-10-03 17:16:38 -05:00
|
|
|
void out_memusage(const char *f);
|
2024-03-15 10:51:04 -05:00
|
|
|
void js_stacktrace();
|
2023-10-03 17:16:38 -05:00
|
|
|
|
2024-03-15 10:51:04 -05:00
|
|
|
void script_evalf(const char *format, ...);
|
2024-03-21 11:33:36 -05:00
|
|
|
JSValue script_eval(const char *file, const char *script);
|
2023-02-02 17:52:15 -06:00
|
|
|
|
2024-03-15 10:51:04 -05:00
|
|
|
void script_call_sym(JSValue sym, int argc, JSValue *argv);
|
2021-11-30 21:29:18 -06:00
|
|
|
|
2024-02-23 16:05:30 -06:00
|
|
|
void script_gc();
|
2024-08-05 15:26:18 -05:00
|
|
|
void script_mem_limit(size_t limit);
|
|
|
|
void script_gc_threshold(size_t threshold);
|
|
|
|
void script_max_stacksize(size_t size);
|
2023-06-06 15:49:55 -05:00
|
|
|
|
2024-06-05 16:07:44 -05:00
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2022-02-06 10:14:57 -06:00
|
|
|
#endif
|