X-Git-Url: http://git.madism.org/?a=blobdiff_plain;f=lib-lua%2Flib-lua_priv.h;h=84fd121c32b80e1efe284422c31248c8bd20b484;hb=56ac9bea51f338d488828ad1114d58b4a9542209;hp=ff683787e0dc81378bddf8510898322486285a16;hpb=88d22daa9c1316d5ccc4b4bb60d40cc96c767757;p=apps%2Fmadmutt.git diff --git a/lib-lua/lib-lua_priv.h b/lib-lua/lib-lua_priv.h index ff68378..84fd121 100644 --- a/lib-lua/lib-lua_priv.h +++ b/lib-lua/lib-lua_priv.h @@ -21,14 +21,38 @@ #define MUTT_LIB_LUA_LIB_LUA_PRIV_H #include "lib-lua.h" -#include "lua-token.h" #include #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