diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2009-04-16 07:56:44 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2009-04-16 07:56:44 +0000 |
commit | 40c2ba944e1cee0677734608263cbc7ba3a729bf (patch) | |
tree | 6da3acbd4e74eb5854f90416313fb56a4eb29824 /Build/source/texk/web2c/luatexdir/luasocket | |
parent | 79e9c535970a1887e1b6b2196cd90775955ea486 (diff) |
Import luatex 0.39.0
git-svn-id: svn://tug.org/texlive/trunk@12733 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luasocket')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c | 64 |
1 files changed, 10 insertions, 54 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c b/Build/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c index 8e27995a414..ddb26d476ee 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c +++ b/Build/source/texk/web2c/luatexdir/luasocket/src/lua_preload.c @@ -13,61 +13,17 @@ #include "mime_lua.c" -void luatex_socketlua_open (lua_State *L) { - lua_getglobal(L, "package"); - lua_getfield(L, -1, "loaded"); - if (!lua_istable(L,-1)) { - lua_newtable(L); - lua_setfield(L, -2, "loaded"); - lua_getfield(L, -1, "loaded"); - } - if(!luatex_socket_lua_open(L)) { - lua_setfield(L, -2, "socket"); - } else { - fprintf(stderr,"FATAL error while preloading lua modules"); - exit(1); - } - if(!luatex_ltn12_lua_open(L)) { - lua_setfield(L, -2, "ltn12"); - } else { - fprintf(stderr,"FATAL error while preloading lua modules"); - exit(1); - } - if(!luatex_mime_lua_open(L)) { - lua_setfield(L, -2, "mime"); - } else { - fprintf(stderr,"FATAL error while preloading lua modules"); - exit(1); - } - if(!luatex_url_lua_open(L)) { - lua_setfield(L, -2, "socket.url"); - } else { - fprintf(stderr,"FATAL error while preloading lua modules"); - exit(1); - } - if(!luatex_tp_lua_open(L)) { - lua_setfield(L, -2, "socket.tp"); - } else { - fprintf(stderr,"FATAL error while preloading lua modules"); - exit(1); - } - if(!luatex_smtp_lua_open(L)) { - lua_setfield(L, -2, "socket.smtp"); - } else { - fprintf(stderr,"FATAL error while preloading lua modules"); - exit(1); - } - if(!luatex_http_lua_open(L)) { - lua_setfield(L, -2, "socket.http"); - } else { - fprintf(stderr,"FATAL error while preloading lua modules"); - exit(1); - } - if(!luatex_ftp_lua_open(L)) { - lua_setfield(L, -2, "socket.ftp"); - } else { +void +luatex_socketlua_open (lua_State *L) { + if(luatex_socket_lua_open(L) || + luatex_ltn12_lua_open(L) || + luatex_mime_lua_open(L) || + luatex_url_lua_open(L) || + luatex_tp_lua_open(L) || + luatex_smtp_lua_open(L) || + luatex_http_lua_open(L) || + luatex_ftp_lua_open(L)) { fprintf(stderr,"FATAL error while preloading lua modules"); exit(1); } - lua_pop(L,2); } |