| 1 |
|
| 2 |
#include <stdlib.h> |
| 3 |
#include "lua.h" |
| 4 |
#include "lauxlib.h" |
| 5 |
|
| 6 |
int luatex_mbox_lua_open(lua_State*); |
| 7 |
int luatex_headers_lua_open(lua_State*); |
| 8 |
int luatex_socket_lua_open(lua_State*); |
| 9 |
int luatex_ltn12_lua_open(lua_State*); |
| 10 |
int luatex_mime_lua_open(lua_State*); |
| 11 |
int luatex_url_lua_open(lua_State*); |
| 12 |
int luatex_tp_lua_open(lua_State*); |
| 13 |
int luatex_smtp_lua_open(lua_State*); |
| 14 |
int luatex_http_lua_open(lua_State*); |
| 15 |
int luatex_ftp_lua_open(lua_State*); |
| 16 |
|
| 17 |
|
| 18 |
extern void luatex_socketlua_open (lua_State *) ; |
| 19 |
extern void luatex_socketlua_safe_open (lua_State *) ; |
| 20 |
#include "ftp_lua.c" |
| 21 |
#include "headers_lua.c" |
| 22 |
#include "http_lua.c" |
| 23 |
#include "ltn12_lua.c" |
| 24 |
#include "mbox_lua.c" |
| 25 |
#include "mime_lua.c" |
| 26 |
#include "smtp_lua.c" |
| 27 |
#include "socket_lua.c" |
| 28 |
#include "tp_lua.c" |
| 29 |
#include "url_lua.c" |
| 30 |
|
| 31 |
|
| 32 |
#define TEST(A) do { if (A) { \ |
| 33 |
fprintf(stderr,"FATAL error while preloading lua module " #A); \ |
| 34 |
exit(1); \ |
| 35 |
} \ |
| 36 |
} while (0) |
| 37 |
|
| 38 |
void |
| 39 |
luatex_socketlua_open (lua_State *L) { |
| 40 |
TEST(luatex_mbox_lua_open(L)); |
| 41 |
TEST(luatex_headers_lua_open(L)); |
| 42 |
TEST(luatex_socket_lua_open(L)); |
| 43 |
TEST(luatex_ltn12_lua_open(L)); |
| 44 |
TEST(luatex_mime_lua_open(L)); |
| 45 |
TEST(luatex_url_lua_open(L)); |
| 46 |
TEST(luatex_tp_lua_open(L)); |
| 47 |
TEST(luatex_smtp_lua_open(L)); |
| 48 |
TEST(luatex_http_lua_open(L)); |
| 49 |
TEST(luatex_ftp_lua_open(L)); |
| 50 |
} |
| 51 |
|
| 52 |
/* luatex_socketlua_safe_open: load safe modules */ |
| 53 |
/* of luasocket ( mime ). */ |
| 54 |
void |
| 55 |
luatex_socketlua_safe_open (lua_State *L) { |
| 56 |
TEST(luatex_ltn12_lua_open(L)); |
| 57 |
TEST(luatex_mime_lua_open(L)); |
| 58 |
} |