2021-11-30 21:29:18 -06:00
|
|
|
#ifndef SCRIPT_H
|
|
|
|
#define SCRIPT_H
|
|
|
|
|
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;
|
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, ...);
|
|
|
|
JSValue eval_script_env(const char *file, JSValue env, 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();
|
2023-06-06 15:49:55 -05:00
|
|
|
|
2024-02-23 16:05:30 -06:00
|
|
|
JSValue script_run_bytecode(uint8_t *code, size_t len);
|
|
|
|
uint8_t *script_compile(const char *file, size_t *len);
|
2023-05-24 20:45:50 -05:00
|
|
|
|
2022-02-06 10:14:57 -06:00
|
|
|
#endif
|