blob: 2009c193fcaca1858fa4a273863d9bead7f01b73 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
/*=========================================================================*\
* Unix domain socket
* LuaSocket toolkit
\*=========================================================================*/
#include "lua.h"
#include "lauxlib.h"
#include "unixtcp.h"
#include "unixudp.h"
/*-------------------------------------------------------------------------*\
* Modules and functions
\*-------------------------------------------------------------------------*/
static const luaL_Reg mod[] = {
{"tcp", unixtcp_open},
{"udp", unixudp_open},
{NULL, NULL}
};
/*-------------------------------------------------------------------------*\
* Initializes module
\*-------------------------------------------------------------------------*/
int luaopen_socket_unix(lua_State *L)
{
int i;
lua_newtable(L);
for (i = 0; mod[i].name; i++) mod[i].func(L);
return 1;
}
|