diff options
| author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-01-21 18:40:52 +0000 |
|---|---|---|
| committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2004-01-21 18:40:52 +0000 |
| commit | 195069cf5f929f445b0ce20e531cd482d2559083 (patch) | |
| tree | 6444d37c4ce32395428ba26ee0d16c0c372bd9da /src/options.h | |
| parent | e63f500d24ff0238425c9e13f220daf09a277ef5 (diff) | |
| download | luasocket-195069cf5f929f445b0ce20e531cd482d2559083.tar.gz luasocket-195069cf5f929f445b0ce20e531cd482d2559083.tar.bz2 luasocket-195069cf5f929f445b0ce20e531cd482d2559083.zip | |
Fixed functions that return messages in ?socket.c.
Moved complexity of connect and accept there.
Created a new options.c module to take care of options.
Auxiliar.c is now cleaner.
Diffstat (limited to 'src/options.h')
| -rw-r--r-- | src/options.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/options.h b/src/options.h new file mode 100644 index 0000000..ec75fc0 --- /dev/null +++ b/src/options.h | |||
| @@ -0,0 +1,30 @@ | |||
| 1 | #ifndef OPTIONS_H | ||
| 2 | #define OPTIONS_H | ||
| 3 | |||
| 4 | #include <lua.h> | ||
| 5 | #include "socket.h" | ||
| 6 | |||
| 7 | /* option registry */ | ||
| 8 | typedef struct t_opt { | ||
| 9 | const char *name; | ||
| 10 | int (*func)(lua_State *L, p_sock ps); | ||
| 11 | } t_opt; | ||
| 12 | typedef t_opt *p_opt; | ||
| 13 | |||
| 14 | /* supported options */ | ||
| 15 | int opt_dontroute(lua_State *L, p_sock ps); | ||
| 16 | int opt_broadcast(lua_State *L, p_sock ps); | ||
| 17 | int opt_reuseaddr(lua_State *L, p_sock ps); | ||
| 18 | int opt_tcp_nodelay(lua_State *L, p_sock ps); | ||
| 19 | int opt_keepalive(lua_State *L, p_sock ps); | ||
| 20 | int opt_linger(lua_State *L, p_sock ps); | ||
| 21 | int opt_reuseaddr(lua_State *L, p_sock ps); | ||
| 22 | int opt_ip_multicast_ttl(lua_State *L, p_sock ps); | ||
| 23 | int opt_ip_multicast_loop(lua_State *L, p_sock ps); | ||
| 24 | int opt_ip_add_membership(lua_State *L, p_sock ps); | ||
| 25 | int opt_ip_drop_membersip(lua_State *L, p_sock ps); | ||
| 26 | |||
| 27 | /* invokes the appropriate option handler */ | ||
| 28 | int opt_meth_setoption(lua_State *L, p_opt opt, p_sock ps); | ||
| 29 | |||
| 30 | #endif | ||
