aboutsummaryrefslogtreecommitdiff
path: root/src/mime.c
diff options
context:
space:
mode:
authorDiego Nehab <diego.nehab@gmail.com>2015-08-21 15:39:34 -0300
committerDiego Nehab <diego.nehab@gmail.com>2015-08-21 15:39:34 -0300
commite75444ccd1f30a3b5fbc7cec4a85e831bd0560ed (patch)
tree71475c18fee070c770fc0fe25d0859b7d54c8fbb /src/mime.c
parent321c0c9b1f7b6b83cd83b58e7e259f53eca69373 (diff)
downloadluasocket-e75444ccd1f30a3b5fbc7cec4a85e831bd0560ed.tar.gz
luasocket-e75444ccd1f30a3b5fbc7cec4a85e831bd0560ed.tar.bz2
luasocket-e75444ccd1f30a3b5fbc7cec4a85e831bd0560ed.zip
New compat.h module implements luaL_setfuncs.
Makes initialization code simpler everywhere.
Diffstat (limited to 'src/mime.c')
-rw-r--r--src/mime.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/src/mime.c b/src/mime.c
index d121e9e..ed44104 100644
--- a/src/mime.c
+++ b/src/mime.c
@@ -6,10 +6,7 @@
6 6
7#include "lua.h" 7#include "lua.h"
8#include "lauxlib.h" 8#include "lauxlib.h"
9 9#include "compat.h"
10#if !defined(LUA_VERSION_NUM) || (LUA_VERSION_NUM < 501)
11#include "compat-5.1.h"
12#endif
13 10
14#include "mime.h" 11#include "mime.h"
15 12
@@ -81,12 +78,8 @@ static UC b64unbase[256];
81\*-------------------------------------------------------------------------*/ 78\*-------------------------------------------------------------------------*/
82MIME_API int luaopen_mime_core(lua_State *L) 79MIME_API int luaopen_mime_core(lua_State *L)
83{ 80{
84#if LUA_VERSION_NUM > 501 && !defined(LUA_COMPAT_MODULE)
85 lua_newtable(L); 81 lua_newtable(L);
86 luaL_setfuncs(L, func, 0); 82 luaL_setfuncs(L, func, 0);
87#else
88 luaL_openlib(L, "mime", func, 0);
89#endif
90 /* make version string available to scripts */ 83 /* make version string available to scripts */
91 lua_pushstring(L, "_VERSION"); 84 lua_pushstring(L, "_VERSION");
92 lua_pushstring(L, MIME_VERSION); 85 lua_pushstring(L, MIME_VERSION);