prosperon/source/engine/script.h

42 lines
701 B
C
Raw Normal View History

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();
void out_memusage(const char *f);
void js_stacktrace();
void script_evalf(const char *format, ...);
JSValue script_eval(const char *file, const char *script);
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