diff options
author | Caleb Maclennan <caleb@alerque.com> | 2023-11-10 09:12:04 +0300 |
---|---|---|
committer | Caleb Maclennan <caleb@alerque.com> | 2023-11-10 09:12:04 +0300 |
commit | 5c4fc93d5f4137bf4c22ddf1a048c907a4a26727 (patch) | |
tree | a9a68e1f6a9c3bfe2b64fa1c3a4098865b7d3b5d /src/select.c | |
parent | ccef3bc4e2aa6ee5b997a80aabb58f4ff0b0e98f (diff) | |
parent | 43a97b7f0053313b43906371dbdc226271e6c8ab (diff) | |
download | luasocket-hjelmeland-patch-1.tar.gz luasocket-hjelmeland-patch-1.tar.bz2 luasocket-hjelmeland-patch-1.zip |
Merge branch 'master' into hjelmeland-patch-1hjelmeland-patch-1
Diffstat (limited to 'src/select.c')
-rw-r--r-- | src/select.c | 17 |
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 | \*-------------------------------------------------------------------------*/ |
40 | int select_open(lua_State *L) { | 35 | int 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 | |||