aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/select.c17
1 files changed, 7 insertions, 10 deletions
diff --git a/src/select.c b/src/select.c
index d14c40a..bb47c45 100644
--- a/src/select.c
+++ b/src/select.c
@@ -2,16 +2,14 @@
2* Select implementation 2* Select implementation
3* LuaSocket toolkit 3* LuaSocket toolkit
4\*=========================================================================*/ 4\*=========================================================================*/
5#include <string.h> 5#include "luasocket.h"
6
7#include "lua.h"
8#include "lauxlib.h"
9#include "compat.h"
10 6
11#include "socket.h" 7#include "socket.h"
12#include "timeout.h" 8#include "timeout.h"
13#include "select.h" 9#include "select.h"
14 10
11#include <string.h>
12
15/*=========================================================================*\ 13/*=========================================================================*\
16* Internal function prototypes. 14* Internal function prototypes.
17\*=========================================================================*/ 15\*=========================================================================*/
@@ -31,15 +29,15 @@ static luaL_Reg func[] = {
31 {NULL, NULL} 29 {NULL, NULL}
32}; 30};
33 31
34/*=========================================================================*\
35* Exported functions
36\*=========================================================================*/
37/*-------------------------------------------------------------------------*\ 32/*-------------------------------------------------------------------------*\
38* Initializes module 33* Initializes module
39\*-------------------------------------------------------------------------*/ 34\*-------------------------------------------------------------------------*/
40int select_open(lua_State *L) { 35int select_open(lua_State *L) {
41 lua_pushstring(L, "_SETSIZE"); 36 lua_pushstring(L, "_SETSIZE");
42 lua_pushnumber(L, FD_SETSIZE); 37 lua_pushinteger(L, FD_SETSIZE);
38 lua_rawset(L, -3);
39 lua_pushstring(L, "_SOCKETINVALID");
40 lua_pushinteger(L, SOCKET_INVALID);
43 lua_rawset(L, -3); 41 lua_rawset(L, -3);
44 luaL_setfuncs(L, func, 0); 42 luaL_setfuncs(L, func, 0);
45 return 0; 43 return 0;
@@ -214,4 +212,3 @@ static void make_assoc(lua_State *L, int tab) {
214 i = i+1; 212 i = i+1;
215 } 213 }
216} 214}
217