diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-09-27 04:01:18 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-09-27 04:01:18 +0000 |
commit | a04f15d1ca440006a53bd0d9f98c12e5abebd969 (patch) | |
tree | 30d37d74b5c99d5d0e7489a421ec44ad0150113f /src/mime.c | |
parent | e1d318f26cf53ce9b2c3044d8d138956150488c7 (diff) | |
download | luasocket-a04f15d1ca440006a53bd0d9f98c12e5abebd969.tar.gz luasocket-a04f15d1ca440006a53bd0d9f98c12e5abebd969.tar.bz2 luasocket-a04f15d1ca440006a53bd0d9f98c12e5abebd969.zip |
Using new module scheme. Still needs fine tuning.
Diffstat (limited to 'src/mime.c')
-rw-r--r-- | src/mime.c | 9 |
1 files changed, 3 insertions, 6 deletions
@@ -8,6 +8,7 @@ | |||
8 | 8 | ||
9 | #include <lua.h> | 9 | #include <lua.h> |
10 | #include <lauxlib.h> | 10 | #include <lauxlib.h> |
11 | #include <compat-5.1.h> | ||
11 | 12 | ||
12 | #include "mime.h" | 13 | #include "mime.h" |
13 | 14 | ||
@@ -77,13 +78,9 @@ static UC b64unbase[256]; | |||
77 | /*-------------------------------------------------------------------------*\ | 78 | /*-------------------------------------------------------------------------*\ |
78 | * Initializes module | 79 | * Initializes module |
79 | \*-------------------------------------------------------------------------*/ | 80 | \*-------------------------------------------------------------------------*/ |
80 | MIME_API int luaopen_mime(lua_State *L) | 81 | MIME_API int luaopen_lmime(lua_State *L) |
81 | { | 82 | { |
82 | /* whoever is loading the library replaced the global environment | 83 | luaL_module(L, "mime", func, 0); |
83 | * with the namespace table */ | ||
84 | lua_pushvalue(L, LUA_GLOBALSINDEX); | ||
85 | /* export functions */ | ||
86 | luaL_openlib(L, NULL, func, 0); | ||
87 | /* initialize lookup tables */ | 84 | /* initialize lookup tables */ |
88 | qpsetup(qpclass, qpunbase); | 85 | qpsetup(qpclass, qpunbase); |
89 | b64setup(b64unbase); | 86 | b64setup(b64unbase); |