diff options
author | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-05-25 01:54:13 +0000 |
---|---|---|
committer | Diego Nehab <diego@tecgraf.puc-rio.br> | 2003-05-25 01:54:13 +0000 |
commit | 0f6c8d50a99997ac7829864b1c93362b50f1bbf3 (patch) | |
tree | d0cefe3a05484e65b7b7e79d8cae4a1d2e6d19fb /src/inet.h | |
parent | c1ef3e7103cc652d2004ef1ddc9409b946207f33 (diff) | |
download | luasocket-0f6c8d50a99997ac7829864b1c93362b50f1bbf3.tar.gz luasocket-0f6c8d50a99997ac7829864b1c93362b50f1bbf3.tar.bz2 luasocket-0f6c8d50a99997ac7829864b1c93362b50f1bbf3.zip |
Porting to LUA 5.0 final
Diffstat (limited to 'src/inet.h')
-rw-r--r-- | src/inet.h | 36 |
1 files changed, 12 insertions, 24 deletions
@@ -1,38 +1,26 @@ | |||
1 | /*=========================================================================*\ | 1 | /*=========================================================================*\ |
2 | * Internet domain class: inherits from the Socket class, and implement | 2 | * Internet domain functions |
3 | * a few methods shared by all internet related objects | ||
4 | * | 3 | * |
5 | * RCS ID: $Id$ | 4 | * RCS ID: $Id$ |
6 | \*=========================================================================*/ | 5 | \*=========================================================================*/ |
7 | #ifndef INET_H_ | 6 | #ifndef INET_H |
8 | #define INET_H_ | 7 | #define INET_H |
9 | 8 | ||
10 | #include <lua.h> | 9 | #include <lua.h> |
11 | #include "lssock.h" | 10 | #include "sock.h" |
12 | |||
13 | /* class name */ | ||
14 | #define INET_CLASS "luasocket(inet)" | ||
15 | |||
16 | /*-------------------------------------------------------------------------*\ | ||
17 | * Socket fields | ||
18 | \*-------------------------------------------------------------------------*/ | ||
19 | #define INET_FIELDS SOCK_FIELDS | ||
20 | |||
21 | /*-------------------------------------------------------------------------*\ | ||
22 | * Socket structure | ||
23 | \*-------------------------------------------------------------------------*/ | ||
24 | typedef t_sock t_inet; | ||
25 | typedef t_inet *p_inet; | ||
26 | 11 | ||
27 | /*-------------------------------------------------------------------------*\ | 12 | /*-------------------------------------------------------------------------*\ |
28 | * Exported functions | 13 | * Exported functions |
29 | \*-------------------------------------------------------------------------*/ | 14 | \*-------------------------------------------------------------------------*/ |
30 | void inet_open(lua_State *L); | 15 | void inet_open(lua_State *L); |
31 | void inet_construct(lua_State *L, p_inet inet); | ||
32 | void inet_inherit(lua_State *L, cchar *lsclass); | ||
33 | 16 | ||
34 | cchar *inet_tryconnect(p_sock sock, cchar *address, ushort); | 17 | const char *inet_tryconnect(p_sock ps, const char *address, |
35 | cchar *inet_trybind(p_sock sock, cchar *address, ushort); | 18 | unsigned short port); |
36 | cchar *inet_trysocket(p_inet inet, int type); | 19 | const char *inet_trybind(p_sock ps, const char *address, |
20 | unsigned short port, int backlog); | ||
21 | const char *inet_trycreate(p_sock ps, int type); | ||
22 | |||
23 | int inet_meth_getpeername(lua_State *L, p_sock ps); | ||
24 | int inet_meth_getsockname(lua_State *L, p_sock ps); | ||
37 | 25 | ||
38 | #endif /* INET_H_ */ | 26 | #endif /* INET_H_ */ |