diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-03-28 21:08:50 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-03-28 21:08:50 +0000 |
| commit | f18d1b7cd0ec4708518ab5e18ea33b6eadca0301 (patch) | |
| tree | e831c6b1957af47db1301675b52c0d2a2e315fa7 /src/select.c | |
| parent | 307603b24dde69eac62d2cb52123488137520c9c (diff) | |
| download | luasocket-f18d1b7cd0ec4708518ab5e18ea33b6eadca0301.tar.gz luasocket-f18d1b7cd0ec4708518ab5e18ea33b6eadca0301.tar.bz2 luasocket-f18d1b7cd0ec4708518ab5e18ea33b6eadca0301.zip | |
Closer to release...
Diffstat (limited to 'src/select.c')
| -rw-r--r-- | src/select.c | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c index 4dcfd26..6afdb87 100644 --- a/src/select.c +++ b/src/select.c | |||
| @@ -1,6 +1,13 @@ | |||
| 1 | /*=========================================================================*\ | ||
| 2 | * Select implementation | ||
| 3 | * Global Lua fuctions: | ||
| 4 | * select: waits until socket ready | ||
| 5 | * RCS ID: $Id$ | ||
| 6 | \*=========================================================================*/ | ||
| 1 | #include <lua.h> | 7 | #include <lua.h> |
| 2 | #include <lauxlib.h> | 8 | #include <lauxlib.h> |
| 3 | 9 | ||
| 10 | #include "luasocket.h" | ||
| 4 | #include "lspriv.h" | 11 | #include "lspriv.h" |
| 5 | #include "lsselect.h" | 12 | #include "lsselect.h" |
| 6 | #include "lsfd.h" | 13 | #include "lsfd.h" |
| @@ -33,10 +40,17 @@ void select_open(lua_State *L) | |||
| 33 | { | 40 | { |
| 34 | /* push select auxiliar lua function and register | 41 | /* push select auxiliar lua function and register |
| 35 | * select_lua_select with it as an upvalue */ | 42 | * select_lua_select with it as an upvalue */ |
| 36 | luaL_loadfile(L, "lsselect.lua"); | 43 | #ifdef LUASOCKET_DEBUG |
| 37 | lua_call(L, 0, 1); | 44 | lua_dofile(L, "lsselect.lua"); |
| 45 | #else | ||
| 46 | #include "lsselect.loh" | ||
| 47 | #endif | ||
| 48 | lua_getglobal(L, LUASOCKET_LIBNAME); | ||
| 49 | lua_pushstring(L, "_select"); | ||
| 50 | lua_gettable(L, -2); | ||
| 38 | lua_pushcclosure(L, select_lua_select, 1); | 51 | lua_pushcclosure(L, select_lua_select, 1); |
| 39 | priv_newglobal(L, "select"); | 52 | priv_newglobal(L, "select"); |
| 53 | lua_pop(L, 1); | ||
| 40 | /* create luasocket(select) table */ | 54 | /* create luasocket(select) table */ |
| 41 | lua_pushstring(L, "luasocket(select)"); | 55 | lua_pushstring(L, "luasocket(select)"); |
| 42 | lua_newtable(L); | 56 | lua_newtable(L); |
