aboutsummaryrefslogtreecommitdiff
path: root/src/unix.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/unix.c')
-rw-r--r--src/unix.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/unix.c b/src/unix.c
index 0430086..935d4c3 100644
--- a/src/unix.c
+++ b/src/unix.c
@@ -2,7 +2,7 @@
2* Unix domain socket 2* Unix domain socket
3* LuaSocket toolkit 3* LuaSocket toolkit
4* 4*
5* RCS ID: $Id$ 5* RCS ID: $Id: unix.c,v 1.14 2009/05/27 09:31:35 diego Exp $
6\*=========================================================================*/ 6\*=========================================================================*/
7#include <string.h> 7#include <string.h>
8 8
@@ -39,7 +39,7 @@ static const char *unix_tryconnect(p_unix un, const char *path);
39static const char *unix_trybind(p_unix un, const char *path); 39static const char *unix_trybind(p_unix un, const char *path);
40 40
41/* unix object methods */ 41/* unix object methods */
42static luaL_reg un[] = { 42static luaL_Reg unix_methods[] = {
43 {"__gc", meth_close}, 43 {"__gc", meth_close},
44 {"__tostring", auxiliar_tostring}, 44 {"__tostring", auxiliar_tostring},
45 {"accept", meth_accept}, 45 {"accept", meth_accept},
@@ -63,15 +63,15 @@ static luaL_reg un[] = {
63}; 63};
64 64
65/* socket option handlers */ 65/* socket option handlers */
66static t_opt opt[] = { 66static t_opt optset[] = {
67 {"keepalive", opt_keepalive}, 67 {"keepalive", opt_set_keepalive},
68 {"reuseaddr", opt_reuseaddr}, 68 {"reuseaddr", opt_set_reuseaddr},
69 {"linger", opt_linger}, 69 {"linger", opt_set_linger},
70 {NULL, NULL} 70 {NULL, NULL}
71}; 71};
72 72
73/* our socket creation function */ 73/* our socket creation function */
74static luaL_reg func[] = { 74static luaL_Reg func[] = {
75 {"unix", global_create}, 75 {"unix", global_create},
76 {NULL, NULL} 76 {NULL, NULL}
77}; 77};
@@ -82,9 +82,9 @@ static luaL_reg func[] = {
82\*-------------------------------------------------------------------------*/ 82\*-------------------------------------------------------------------------*/
83int luaopen_socket_unix(lua_State *L) { 83int luaopen_socket_unix(lua_State *L) {
84 /* create classes */ 84 /* create classes */
85 auxiliar_newclass(L, "unix{master}", un); 85 auxiliar_newclass(L, "unix{master}", unix_methods);
86 auxiliar_newclass(L, "unix{client}", un); 86 auxiliar_newclass(L, "unix{client}", unix_methods);
87 auxiliar_newclass(L, "unix{server}", un); 87 auxiliar_newclass(L, "unix{server}", unix_methods);
88 /* create class groups */ 88 /* create class groups */
89 auxiliar_add2group(L, "unix{master}", "unix{any}"); 89 auxiliar_add2group(L, "unix{master}", "unix{any}");
90 auxiliar_add2group(L, "unix{client}", "unix{any}"); 90 auxiliar_add2group(L, "unix{client}", "unix{any}");
@@ -128,7 +128,7 @@ static int meth_setstats(lua_State *L) {
128\*-------------------------------------------------------------------------*/ 128\*-------------------------------------------------------------------------*/
129static int meth_setoption(lua_State *L) { 129static int meth_setoption(lua_State *L) {
130 p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1); 130 p_unix un = (p_unix) auxiliar_checkgroup(L, "unix{any}", 1);
131 return opt_meth_setoption(L, opt, &un->sock); 131 return opt_meth_setoption(L, optset, &un->sock);
132} 132}
133 133
134/*-------------------------------------------------------------------------*\ 134/*-------------------------------------------------------------------------*\