X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lua%2Fbase.cpkg;fp=lib-lua%2Fbase.cpkg;h=f9b7304567007a22636d86a115d62f8f22013c38;hp=0000000000000000000000000000000000000000;hb=2dc50decd320b310ef56c14041b6fa4fefd865ac;hpb=597020b9829312a50c15784916f473da9e75efd0 diff --git a/lib-lua/base.cpkg b/lib-lua/base.cpkg new file mode 100644 index 0000000..f9b7304 --- /dev/null +++ b/lib-lua/base.cpkg @@ -0,0 +1,33 @@ +@type bool { + .ctype = unsigned : 1; + .check = (luaL_checkinteger($L, $$) != 0); + .push = lua_pushboolean($L, $$); +}; + +@type quadopt_t { + .ctype = unsigned : 2; + .check = luaM_checkquadopt($L, $$); + .push = lua_pushinteger($L, $$); +}; + +@type string_t { + .ctype = char *; + .check = luaL_checkstring($L, $$); + .push = lua_pushstring($L, $$); + .ctor = m_strdup($$); + .dtor = p_delete($$); +}; + +@type path_t : string_t { + .ctor = luaM_pathnew($$); +}; + +@type rx_t { + .ctype = rx_t *; + .check = luaM_checkrx($L, $$); + .push = lua_pushstring($L, $$ ? ($$)->pattern : NULL); + .ctor = luaM_rxnew($$); + .dtor = rx_delete($$); +}; + +/* vim:set ft=c: */