diff options
author | Taco Hoekwater <taco@elvenkind.com> | 2014-03-15 12:21:15 +0000 |
---|---|---|
committer | Taco Hoekwater <taco@elvenkind.com> | 2014-03-15 12:21:15 +0000 |
commit | a22d9897afbabdd07f13d2bc5c7c5b9c5865ab53 (patch) | |
tree | 70829ffa23329ca4c04efa8da7a18cfe9c44a1f4 /Build/source/texk/web2c/luatexdir/luasocket/src | |
parent | 5909dbd7ee4290cc486c9c12e4ef0b2bfb9067d4 (diff) |
here is luatex 0.79.0
git-svn-id: svn://tug.org/texlive/trunk@33180 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/luasocket/src')
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luasocket/src/tcp.c | 38 | ||||
-rw-r--r-- | Build/source/texk/web2c/luatexdir/luasocket/src/udp.c | 28 |
2 files changed, 33 insertions, 33 deletions
diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.c b/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.c index 6734dc0b497..e7334031478 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.c +++ b/Build/source/texk/web2c/luatexdir/luasocket/src/tcp.c @@ -99,13 +99,13 @@ static luaL_Reg func[] = { int tcp_open(lua_State *L) { /* create classes */ - auxiliar_newclass(L, "tcp{master}", tcp_methods); - auxiliar_newclass(L, "tcp{client}", tcp_methods); - auxiliar_newclass(L, "tcp{server}", tcp_methods); + auxiliar_newclass(L, "tcp.master", tcp_methods); + auxiliar_newclass(L, "tcp.client", tcp_methods); + auxiliar_newclass(L, "tcp.server", tcp_methods); /* create class groups */ - auxiliar_add2group(L, "tcp{master}", "tcp{any}"); - auxiliar_add2group(L, "tcp{client}", "tcp{any}"); - auxiliar_add2group(L, "tcp{server}", "tcp{any}"); + auxiliar_add2group(L, "tcp.master", "tcp{any}"); + auxiliar_add2group(L, "tcp.client", "tcp{any}"); + auxiliar_add2group(L, "tcp.server", "tcp{any}"); /* define library functions */ luaL_openlib(L, NULL, func, 0); return 0; @@ -118,22 +118,22 @@ int tcp_open(lua_State *L) * Just call buffered IO methods \*-------------------------------------------------------------------------*/ static int meth_send(lua_State *L) { - p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp.client", 1); return buffer_meth_send(L, &tcp->buf); } static int meth_receive(lua_State *L) { - p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp.client", 1); return buffer_meth_receive(L, &tcp->buf); } static int meth_getstats(lua_State *L) { - p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp.client", 1); return buffer_meth_getstats(L, &tcp->buf); } static int meth_setstats(lua_State *L) { - p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp.client", 1); return buffer_meth_setstats(L, &tcp->buf); } @@ -183,14 +183,14 @@ static int meth_dirty(lua_State *L) \*-------------------------------------------------------------------------*/ static int meth_accept(lua_State *L) { - p_tcp server = (p_tcp) auxiliar_checkclass(L, "tcp{server}", 1); + p_tcp server = (p_tcp) auxiliar_checkclass(L, "tcp.server", 1); p_timeout tm = timeout_markstart(&server->tm); t_socket sock; const char *err = inet_tryaccept(&server->sock, server->family, &sock, tm); /* if successful, push client socket */ if (err == NULL) { p_tcp clnt = (p_tcp) lua_newuserdata(L, sizeof(t_tcp)); - auxiliar_setclass(L, "tcp{client}", -1); + auxiliar_setclass(L, "tcp.client", -1); /* initialize structure fields */ memset(clnt, 0, sizeof(t_tcp)); socket_setnonblocking(&sock); @@ -213,7 +213,7 @@ static int meth_accept(lua_State *L) \*-------------------------------------------------------------------------*/ static int meth_bind(lua_State *L) { - p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{master}", 1); + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp.master", 1); const char *address = luaL_checkstring(L, 2); const char *port = luaL_checkstring(L, 3); const char *err; @@ -250,7 +250,7 @@ static int meth_connect(lua_State *L) timeout_markstart(&tcp->tm); err = inet_tryconnect(&tcp->sock, address, port, &tcp->tm, &connecthints); /* have to set the class even if it failed due to non-blocking connects */ - auxiliar_setclass(L, "tcp{client}", 1); + auxiliar_setclass(L, "tcp.client", 1); if (err) { lua_pushnil(L); lua_pushstring(L, err); @@ -291,7 +291,7 @@ static int meth_getfamily(lua_State *L) \*-------------------------------------------------------------------------*/ static int meth_listen(lua_State *L) { - p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{master}", 1); + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp.master", 1); int backlog = (int) luaL_optnumber(L, 2, 32); int err = socket_listen(&tcp->sock, backlog); if (err != IO_DONE) { @@ -300,7 +300,7 @@ static int meth_listen(lua_State *L) return 2; } /* turn master object into a server object */ - auxiliar_setclass(L, "tcp{server}", 1); + auxiliar_setclass(L, "tcp.server", 1); lua_pushnumber(L, 1); return 1; } @@ -312,7 +312,7 @@ static int meth_shutdown(lua_State *L) { /* SHUT_RD, SHUT_WR, SHUT_RDWR have the value 0, 1, 2, so we can use method index directly */ static const char* methods[] = { "receive", "send", "both", NULL }; - p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp{client}", 1); + p_tcp tcp = (p_tcp) auxiliar_checkclass(L, "tcp.client", 1); int how = luaL_checkoption(L, 2, "both", methods); socket_shutdown(&tcp->sock, how); lua_pushnumber(L, 1); @@ -358,7 +358,7 @@ static int tcp_create(lua_State *L, int family) { p_tcp tcp = (p_tcp) lua_newuserdata(L, sizeof(t_tcp)); memset(tcp, 0, sizeof(t_tcp)); /* set its type as master object */ - auxiliar_setclass(L, "tcp{master}", -1); + auxiliar_setclass(L, "tcp.master", -1); /* initialize remaining structure fields */ socket_setnonblocking(&sock); if (family == PF_INET6) { @@ -470,6 +470,6 @@ static int global_connect(lua_State *L) { lua_pushstring(L, err); return 2; } - auxiliar_setclass(L, "tcp{client}", -1); + auxiliar_setclass(L, "tcp.client", -1); return 1; } diff --git a/Build/source/texk/web2c/luatexdir/luasocket/src/udp.c b/Build/source/texk/web2c/luatexdir/luasocket/src/udp.c index 8e14fac290f..8e88b1784a2 100644 --- a/Build/source/texk/web2c/luatexdir/luasocket/src/udp.c +++ b/Build/source/texk/web2c/luatexdir/luasocket/src/udp.c @@ -101,13 +101,13 @@ static luaL_Reg func[] = { int udp_open(lua_State *L) { /* create classes */ - auxiliar_newclass(L, "udp{connected}", udp_methods); - auxiliar_newclass(L, "udp{unconnected}", udp_methods); + auxiliar_newclass(L, "udp.connected", udp_methods); + auxiliar_newclass(L, "udp.unconnected", udp_methods); /* create class groups */ - auxiliar_add2group(L, "udp{connected}", "udp{any}"); - auxiliar_add2group(L, "udp{unconnected}", "udp{any}"); - auxiliar_add2group(L, "udp{connected}", "select{able}"); - auxiliar_add2group(L, "udp{unconnected}", "select{able}"); + auxiliar_add2group(L, "udp.connected", "udp{any}"); + auxiliar_add2group(L, "udp.unconnected", "udp{any}"); + auxiliar_add2group(L, "udp.connected", "select{able}"); + auxiliar_add2group(L, "udp.unconnected", "select{able}"); /* define library functions */ luaL_openlib(L, NULL, func, 0); return 0; @@ -127,7 +127,7 @@ const char *udp_strerror(int err) { * Send data through connected udp socket \*-------------------------------------------------------------------------*/ static int meth_send(lua_State *L) { - p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{connected}", 1); + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp.connected", 1); p_timeout tm = &udp->tm; size_t count, sent = 0; int err; @@ -147,7 +147,7 @@ static int meth_send(lua_State *L) { * Send data through unconnected udp socket \*-------------------------------------------------------------------------*/ static int meth_sendto(lua_State *L) { - p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{unconnected}", 1); + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp.unconnected", 1); size_t count, sent = 0; const char *data = luaL_checklstring(L, 2, &count); const char *ip = luaL_checkstring(L, 3); @@ -221,7 +221,7 @@ static int meth_receive(lua_State *L) { * Receives data and sender from a UDP socket \*-------------------------------------------------------------------------*/ static int meth_receivefrom(lua_State *L) { - p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{unconnected}", 1); + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp.unconnected", 1); char buffer[UDP_DATAGRAMSIZE]; size_t got, count = (size_t) luaL_optnumber(L, 2, sizeof(buffer)); int err; @@ -327,7 +327,7 @@ static int meth_dirty(lua_State *L) { * Just call inet methods \*-------------------------------------------------------------------------*/ static int meth_getpeername(lua_State *L) { - p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{connected}", 1); + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp.connected", 1); return inet_meth_getpeername(L, &udp->sock, udp->family); } @@ -382,12 +382,12 @@ static int meth_setpeername(lua_State *L) { lua_pushstring(L, err); return 2; } - auxiliar_setclass(L, "udp{connected}", 1); + auxiliar_setclass(L, "udp.connected", 1); } else { /* we ignore possible errors because Mac OS X always * returns EAFNOSUPPORT */ inet_trydisconnect(&udp->sock, udp->family, tm); - auxiliar_setclass(L, "udp{unconnected}", 1); + auxiliar_setclass(L, "udp.unconnected", 1); } /* change class to connected or unconnected depending on address */ lua_pushnumber(L, 1); @@ -408,7 +408,7 @@ static int meth_close(lua_State *L) { * Turns a master object into a server object \*-------------------------------------------------------------------------*/ static int meth_setsockname(lua_State *L) { - p_udp udp = (p_udp) auxiliar_checkclass(L, "udp{unconnected}", 1); + p_udp udp = (p_udp) auxiliar_checkclass(L, "udp.unconnected", 1); const char *address = luaL_checkstring(L, 2); const char *port = luaL_checkstring(L, 3); const char *err; @@ -440,7 +440,7 @@ static int udp_create(lua_State *L, int family) { if (!err) { /* allocate udp object */ p_udp udp = (p_udp) lua_newuserdata(L, sizeof(t_udp)); - auxiliar_setclass(L, "udp{unconnected}", -1); + auxiliar_setclass(L, "udp.unconnected", -1); /* initialize remaining structure fields */ socket_setnonblocking(&sock); if (family == PF_INET6) { |