2004-06-22 18:12:53 +02:00
|
|
|
/*=========================================================================*\
|
2015-08-21 20:39:34 +02:00
|
|
|
* Unix domain socket
|
2004-06-22 18:12:53 +02:00
|
|
|
* LuaSocket toolkit
|
|
|
|
\*=========================================================================*/
|
2005-09-29 08:11:42 +02:00
|
|
|
#include "lua.h"
|
|
|
|
#include "lauxlib.h"
|
2004-06-22 18:12:53 +02:00
|
|
|
|
2016-12-25 16:15:12 +01:00
|
|
|
#include "unixstream.h"
|
|
|
|
#include "unixdgram.h"
|
2004-06-22 18:12:53 +02:00
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------*\
|
2016-06-24 15:23:00 +02:00
|
|
|
* Modules and functions
|
2004-06-22 18:12:53 +02:00
|
|
|
\*-------------------------------------------------------------------------*/
|
2016-06-24 15:23:00 +02:00
|
|
|
static const luaL_Reg mod[] = {
|
2016-12-25 16:15:12 +01:00
|
|
|
{"stream", unixstream_open},
|
|
|
|
{"dgram", unixdgram_open},
|
2016-06-24 15:23:00 +02:00
|
|
|
{NULL, NULL}
|
|
|
|
};
|
2004-06-22 18:12:53 +02:00
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------*\
|
2016-06-24 15:23:00 +02:00
|
|
|
* Initializes module
|
2004-06-22 18:12:53 +02:00
|
|
|
\*-------------------------------------------------------------------------*/
|
2016-06-24 15:23:00 +02:00
|
|
|
int luaopen_socket_unix(lua_State *L)
|
2004-06-22 18:12:53 +02:00
|
|
|
{
|
2016-06-24 15:23:00 +02:00
|
|
|
int i;
|
|
|
|
lua_newtable(L);
|
|
|
|
for (i = 0; mod[i].name; i++) mod[i].func(L);
|
|
|
|
return 1;
|
2004-06-22 18:12:53 +02:00
|
|
|
}
|
|
|
|
|