diff options
| -rw-r--r-- | src/io.c | 7 | ||||
| -rw-r--r-- | src/io.h | 8 |
2 files changed, 7 insertions, 8 deletions
| @@ -5,13 +5,10 @@ | |||
| 5 | #include "luasocket.h" | 5 | #include "luasocket.h" |
| 6 | #include "io.h" | 6 | #include "io.h" |
| 7 | 7 | ||
| 8 | /*=========================================================================*\ | ||
| 9 | * Exported functions | ||
| 10 | \*=========================================================================*/ | ||
| 11 | /*-------------------------------------------------------------------------*\ | 8 | /*-------------------------------------------------------------------------*\ |
| 12 | * Initializes C structure | 9 | * Initializes C structure |
| 13 | \*-------------------------------------------------------------------------*/ | 10 | \*-------------------------------------------------------------------------*/ |
| 14 | LUASOCKET_PRIVATE void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx) { | 11 | void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx) { |
| 15 | io->send = send; | 12 | io->send = send; |
| 16 | io->recv = recv; | 13 | io->recv = recv; |
| 17 | io->error = error; | 14 | io->error = error; |
| @@ -21,7 +18,7 @@ LUASOCKET_PRIVATE void io_init(p_io io, p_send send, p_recv recv, p_error error, | |||
| 21 | /*-------------------------------------------------------------------------*\ | 18 | /*-------------------------------------------------------------------------*\ |
| 22 | * I/O error strings | 19 | * I/O error strings |
| 23 | \*-------------------------------------------------------------------------*/ | 20 | \*-------------------------------------------------------------------------*/ |
| 24 | LUASOCKET_PRIVATE const char *io_strerror(int err) { | 21 | const char *io_strerror(int err) { |
| 25 | switch (err) { | 22 | switch (err) { |
| 26 | case IO_DONE: return NULL; | 23 | case IO_DONE: return NULL; |
| 27 | case IO_CLOSED: return "closed"; | 24 | case IO_CLOSED: return "closed"; |
| @@ -12,9 +12,7 @@ | |||
| 12 | * The module socket.h implements this interface, and thus the module tcp.h | 12 | * The module socket.h implements this interface, and thus the module tcp.h |
| 13 | * is very simple. | 13 | * is very simple. |
| 14 | \*=========================================================================*/ | 14 | \*=========================================================================*/ |
| 15 | #include <stdio.h> | 15 | #include "luasocket.h" |
| 16 | #include "lua.h" | ||
| 17 | |||
| 18 | #include "timeout.h" | 16 | #include "timeout.h" |
| 19 | 17 | ||
| 20 | /* IO error codes */ | 18 | /* IO error codes */ |
| @@ -58,8 +56,12 @@ typedef struct t_io_ { | |||
| 58 | } t_io; | 56 | } t_io; |
| 59 | typedef t_io *p_io; | 57 | typedef t_io *p_io; |
| 60 | 58 | ||
| 59 | #pragma GCC visibility push(hidden) | ||
| 60 | |||
| 61 | void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx); | 61 | void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx); |
| 62 | const char *io_strerror(int err); | 62 | const char *io_strerror(int err); |
| 63 | 63 | ||
| 64 | #pragma GCC visibility pop | ||
| 65 | |||
| 64 | #endif /* IO_H */ | 66 | #endif /* IO_H */ |
| 65 | 67 | ||
