2023-11-02 09:54:49 +00:00
|
|
|
// dll ------------------------------------------------------------------------
|
|
|
|
|
|
|
|
/// !!! `filename` must contain extension
|
|
|
|
/// load dynamic library `file` and search for `symbol`
|
|
|
|
/// return: NULL if not found, found symbol otherwise.
|
|
|
|
/// filename: path to dynamic library file. must contain extension.
|
|
|
|
/// symbol: symbol name. must not be NULL.
|
|
|
|
/// see: dlopen^, dlclose^
|
|
|
|
/// > bool (*plugin_init)(void) = dll("plugin.dll", "init");
|
|
|
|
/// > assert(plugin_init());
|
|
|
|
API void* dll(const char *filename, const char *symbol);
|
|
|
|
|
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// script framework
|
|
|
|
|
|
|
|
API void script_init();
|
|
|
|
API void script_run(const char *script);
|
|
|
|
API void script_runfile(const char *pathfile);
|
|
|
|
|
|
|
|
API void script_bind_class(const char *objname, int num_methods, const char **c_names, void **c_functions);
|
|
|
|
API void script_bind_function(const char *c_name, void *c_function);
|
|
|
|
API void script_call(const char *lua_function);
|
|
|
|
|
|
|
|
API bool script_tests();
|
2023-11-05 15:30:11 +00:00
|
|
|
|
2024-01-01 10:47:45 +00:00
|
|
|
// -----------------------------------------------------------------------------
|
|
|
|
// script framework
|
|
|
|
|
2023-11-05 15:30:11 +00:00
|
|
|
enum {
|
|
|
|
SCRIPT_LUA = 1,
|
|
|
|
SCRIPT_DEBUGGER = 2,
|
|
|
|
};
|
|
|
|
|
|
|
|
API void *script_init_env(unsigned flags);
|