Using new module scheme. Still needs fine tuning.

This commit is contained in:
Diego Nehab
2004-09-27 04:01:18 +00:00
parent e1d318f26c
commit a04f15d1ca
14 changed files with 52 additions and 32 deletions

View File

@ -8,6 +8,7 @@
#include <lua.h>
#include <lauxlib.h>
#include <compat-5.1.h>
#include "mime.h"
@ -77,13 +78,9 @@ static UC b64unbase[256];
/*-------------------------------------------------------------------------*\
* Initializes module
\*-------------------------------------------------------------------------*/
MIME_API int luaopen_mime(lua_State *L)
MIME_API int luaopen_lmime(lua_State *L)
{
/* whoever is loading the library replaced the global environment
* with the namespace table */
lua_pushvalue(L, LUA_GLOBALSINDEX);
/* export functions */
luaL_openlib(L, NULL, func, 0);
luaL_module(L, "mime", func, 0);
/* initialize lookup tables */
qpsetup(qpclass, qpunbase);
b64setup(b64unbase);