aboutsummaryrefslogtreecommitdiff
path: root/src/luasocket.c
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-25 05:27:44 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-05-25 05:27:44 +0000
commit888496aa821cd09d925046250ea98b1512293fd5 (patch)
tree217e2b532762a64b58c4fffcb2cba08ba2243462 /src/luasocket.c
parent4fc164b8eaa0453050a0a859321c327bb2c4f776 (diff)
downloadluasocket-888496aa821cd09d925046250ea98b1512293fd5.tar.gz
luasocket-888496aa821cd09d925046250ea98b1512293fd5.tar.bz2
luasocket-888496aa821cd09d925046250ea98b1512293fd5.zip
FTP low-level working.
SMTP connection oriented working. ltn12 improved.
Diffstat (limited to 'src/luasocket.c')
-rw-r--r--src/luasocket.c29
1 files changed, 3 insertions, 26 deletions
diff --git a/src/luasocket.c b/src/luasocket.c
index eadb758..fe4c96c 100644
--- a/src/luasocket.c
+++ b/src/luasocket.c
@@ -25,6 +25,7 @@
25\*=========================================================================*/ 25\*=========================================================================*/
26#include "luasocket.h" 26#include "luasocket.h"
27 27
28#include "base.h"
28#include "auxiliar.h" 29#include "auxiliar.h"
29#include "timeout.h" 30#include "timeout.h"
30#include "buffer.h" 31#include "buffer.h"
@@ -39,34 +40,8 @@
39/*=========================================================================*\ 40/*=========================================================================*\
40* Declarations 41* Declarations
41\*=========================================================================*/ 42\*=========================================================================*/
42static int base_open(lua_State *L);
43static int mod_open(lua_State *L, const luaL_reg *mod); 43static int mod_open(lua_State *L, const luaL_reg *mod);
44 44
45/*-------------------------------------------------------------------------*\
46* Setup basic stuff.
47\*-------------------------------------------------------------------------*/
48static int base_open(lua_State *L)
49{
50 /* create namespace table */
51 lua_pushstring(L, LUASOCKET_LIBNAME);
52 lua_newtable(L);
53#ifdef LUASOCKET_DEBUG
54 lua_pushstring(L, "debug");
55 lua_pushnumber(L, 1);
56 lua_rawset(L, -3);
57#endif
58 /* make version string available so scripts */
59 lua_pushstring(L, "version");
60 lua_pushstring(L, LUASOCKET_VERSION);
61 lua_rawset(L, -3);
62 /* store namespace as global */
63 lua_settable(L, LUA_GLOBALSINDEX);
64 /* make sure modules know what is our namespace */
65 lua_pushstring(L, "LUASOCKET_LIBNAME");
66 lua_pushstring(L, LUASOCKET_LIBNAME);
67 lua_settable(L, LUA_GLOBALSINDEX);
68 return 0;
69}
70 45
71static int mod_open(lua_State *L, const luaL_reg *mod) 46static int mod_open(lua_State *L, const luaL_reg *mod)
72{ 47{
@@ -79,6 +54,7 @@ static int mod_open(lua_State *L, const luaL_reg *mod)
79#include "tp.lch" 54#include "tp.lch"
80#include "smtp.lch" 55#include "smtp.lch"
81#include "http.lch" 56#include "http.lch"
57#include "ftp.lch"
82#else 58#else
83 lua_dofile(L, "ltn12.lua"); 59 lua_dofile(L, "ltn12.lua");
84 lua_dofile(L, "auxiliar.lua"); 60 lua_dofile(L, "auxiliar.lua");
@@ -87,6 +63,7 @@ static int mod_open(lua_State *L, const luaL_reg *mod)
87 lua_dofile(L, "tp.lua"); 63 lua_dofile(L, "tp.lua");
88 lua_dofile(L, "smtp.lua"); 64 lua_dofile(L, "smtp.lua");
89 lua_dofile(L, "http.lua"); 65 lua_dofile(L, "http.lua");
66 lua_dofile(L, "ftp.lua");
90#endif 67#endif
91 return 0; 68 return 0;
92} 69}