X-Git-Url: http://git.madism.org/?p=apps%2Fmadmutt.git;a=blobdiff_plain;f=lib-lua%2Fruntime.c;h=55bdeef31d039ea8e8c013bb75762dbbdb6f2370;hp=923222bde7e2a97ad1dff82097d48cc7d9c860f0;hb=aac3f035c98d7800fde3eef7a43ded322e4862db;hpb=1681dff7a1b69b0dad31d515c466439548b71f94 diff --git a/lib-lua/runtime.c b/lib-lua/runtime.c index 923222b..55bdeef 100644 --- a/lib-lua/runtime.c +++ b/lib-lua/runtime.c @@ -22,6 +22,10 @@ #include "../alias.h" #include "../mutt.h" +#include "../charset.h" +#include "../buffy.h" +#include "../crypt.h" +#include static lua_State *L; @@ -39,6 +43,11 @@ void luaM_initialize(void) {"MCore", luaopen_MCore}, {"MTransport", luaopen_MTransport}, {"MAlias", luaopen_MAlias}, + {"MCharset", luaopen_MCharset}, + {"Mime", luaopen_Mime}, + {"Buffy", luaopen_Buffy}, + {"mod_ssl", luaopen_mod_ssl}, + {"mod_crypt", luaopen_mod_crypt}, }; int i; @@ -56,6 +65,10 @@ void luaM_shutdown(void) lua_close(L); } +lua_State *luaM_getruntime(void) +{ + return L; +} int luaM_dofile(const char *filename) { @@ -122,6 +135,14 @@ const char *luaM_checkrx(lua_State *Ls, int narg) return s; } +rx_t *luaM_rxnew(const char *val) +{ + if (m_strisempty(val)) + val = "."; + + return rx_compile(val, mutt_which_case(val)); +} + char *luaM_pathnew(const char *val) { char path[PATH_MAX]; @@ -129,11 +150,10 @@ char *luaM_pathnew(const char *val) return m_strdup(path); } -rx_t *luaM_rxnew(const char *val) -{ - if (m_strisempty(val)) - val = "."; - return rx_compile(val, mutt_which_case(val)); +void luaM_pushaddr(lua_State *Ls, address_t *addr) +{ + char s[HUGE_STRING] = ""; + rfc822_addrcat(s, sizeof(s), addr, 0); + lua_pushstring(Ls, s); } -