0c43cfe8a22b8fb1334a15c30cfa71bc3f6a9ce1
4 #define NIXIO_OOM "out of memory"
6 #define NIXIO_META "nixio.socket"
7 #define NIXIO_FILE_META "nixio.file"
8 #define NIXIO_GLOB_META "nixio.glob"
9 #define NIXIO_DIR_META "nixio.dir"
10 #define _FILE_OFFSET_BITS 64
12 #define NIXIO_PUSH_CONSTANT(x) \
13 lua_pushinteger(L, x); \
14 lua_setfield(L, -2, #x);
16 /* uClibc: broken as always */
17 #define _LARGEFILE_SOURCE
23 #define NIXIO_BUFFERSIZE 8192
25 typedef struct nixio_socket
{
32 typedef struct nixio_address
{
39 int nixio__perror(lua_State
*L
);
40 int nixio__pstatus(lua_State
*L
, int condition
);
44 #define NIXIO_API extern
46 #include <sys/types.h>
47 #include <sys/socket.h>
48 #include <arpa/inet.h>
49 #include <netinet/in.h>
50 #include <netinet/tcp.h>
58 #define NIXIO_PATHSEP ":"
60 #define nixio__perror_s nixio__perror
61 #define nixio__pstatus_s nixio__pstatus
63 int nixio__check_group(lua_State
*L
, int idx
);
64 int nixio__check_user(lua_State
*L
, int idx
);
66 typedef struct stat nixio_stat_t
;
70 #define NIXIO_API extern __declspec(dllexport)
71 #define NIXIO_SEP "\\"
72 #define NIXIO_PATHSEP ";"
73 #include "mingw-compat.h"
75 typedef struct _stati64 nixio_stat_t
;
79 nixio_sock
* nixio__checksock(lua_State
*L
);
80 int nixio__checksockfd(lua_State
*L
);
81 int nixio__checkfd(lua_State
*L
, int ud
);
82 int nixio__tofd(lua_State
*L
, int ud
);
83 int nixio__nulliter(lua_State
*L
);
85 int nixio__addr_parse(nixio_addr
*addr
, struct sockaddr
*saddr
);
86 int nixio__addr_write(nixio_addr
*addr
, struct sockaddr
*saddr
);
88 int nixio__check_mode(lua_State
*L
, int idx
, int def
);
89 int nixio__mode_write(int mode
, char *modestr
);
91 int nixio__push_stat(lua_State
*L
, nixio_stat_t
*buf
);
93 const char nixio__bin2hex
[16];
95 /* Module functions */
96 void nixio_open_file(lua_State
*L
);
97 void nixio_open_socket(lua_State
*L
);
98 void nixio_open_sockopt(lua_State
*L
);
99 void nixio_open_bind(lua_State
*L
);
100 void nixio_open_address(lua_State
*L
);
101 void nixio_open_poll(lua_State
*L
);
102 void nixio_open_io(lua_State
*L
);
103 void nixio_open_splice(lua_State
*L
);
104 void nixio_open_process(lua_State
*L
);
105 void nixio_open_syslog(lua_State
*L
);
106 void nixio_open_bit(lua_State
*L
);
107 void nixio_open_bin(lua_State
*L
);
108 void nixio_open_fs(lua_State
*L
);
109 void nixio_open_user(lua_State
*L
);
110 void nixio_open_tls_crypto(lua_State
*L
);
111 void nixio_open_tls_context(lua_State
*L
);
112 void nixio_open_tls_socket(lua_State
*L
);
114 /* Method functions */
116 #endif /* NIXIO_H_ */