mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-12-27 04:00:42 +00:00
3bcdc5acb8
On the engine side (functions starting with L_), there are now the basic parts like state creation and running code from strings and files. The game and editor can add to that by e.g. loading whatever they please into the state. Their functions start with El_ and Em_, respectively. The Lua scripts still reside in source/lunatic, even for the common ones. This is because they will be embedded into the binaries as bytecode or compressed source eventually, so their location on disk will be irrelevant. git-svn-id: https://svn.eduke32.com/eduke32@3148 1a8010ca-5511-0410-912e-c29ae57300e0
29 lines
717 B
C
29 lines
717 B
C
/* The Lunatic Interpreter, part of EDuke32. Common, engine-side stuff. */
|
|
|
|
#ifndef ENGINE_LUNATIC_H_
|
|
#define ENGINE_LUNATIC_H_
|
|
|
|
#include <lua.h>
|
|
|
|
|
|
typedef struct
|
|
{
|
|
char *name;
|
|
lua_State *L;
|
|
} L_State;
|
|
|
|
|
|
// -- functions --
|
|
|
|
// helpers taking the lua_State directly:
|
|
void L_SetupDebugTraceback(lua_State *L);
|
|
void L_CheckAndRegisterFunction(lua_State *L, void *regkeyaddr);
|
|
|
|
int L_CreateState(L_State *estate, const char *name, void (*StateSetupFunc)(lua_State *));
|
|
void L_DestroyState(L_State *estate);
|
|
int L_RunOnce(L_State *estate, const char *fn);
|
|
int L_RunString(L_State *estate, char *buf, int dofreebuf);
|
|
|
|
static inline int L_IsInitialized(const L_State *estate) { return (estate->L != NULL); }
|
|
|
|
#endif
|