X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-lua%2Flib-lua_priv.h;h=84fd121c32b80e1efe284422c31248c8bd20b484;hb=56ac9bea51f338d488828ad1114d58b4a9542209;hp=1dbb7f4e2ea011b13b59ee31799a3dba34575697;hpb=6729a8ab646a00a661858b7ac7ee21f770bff3d3;p=apps%2Fmadmutt.git diff --git a/lib-lua/lib-lua_priv.h b/lib-lua/lib-lua_priv.h index 1dbb7f4..84fd121 100644 --- a/lib-lua/lib-lua_priv.h +++ b/lib-lua/lib-lua_priv.h @@ -26,8 +26,33 @@ #include #include -#define LUA_MADMUTT "madmutt" +typedef enum reg_type { + REG_NIL, + REG_INT, + REG_STR, +} reg_type; +typedef struct reg_entry { + int type; + union { + int i; + void *p; + char *s; + }; +} reg_entry; + +static inline void reg_entry_wipe(reg_entry *e) { + switch (e->type) { + case REG_STR: + p_delete(&e->s); + break; + default: + break; + } + e->type = REG_NIL; +} + +#define LUA_MADMUTT "madmutt" int luaopen_madmutt(lua_State *L); #endif