aboutsummaryrefslogtreecommitdiff
path: root/src/io.h
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-16 06:48:48 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2004-07-16 06:48:48 +0000
commite4e2223cff658a7016724a625ebbd3dacb92a8f9 (patch)
treeaac49c61149d30bf11219ab8d9989915bf7bee37 /src/io.h
parent9a79d500eb3e015f5bf579aab714916d49c1f289 (diff)
downloadluasocket-e4e2223cff658a7016724a625ebbd3dacb92a8f9.tar.gz
luasocket-e4e2223cff658a7016724a625ebbd3dacb92a8f9.tar.bz2
luasocket-e4e2223cff658a7016724a625ebbd3dacb92a8f9.zip
Fixed a bunch of stuff. Added mike's patches.
Diffstat (limited to 'src/io.h')
-rw-r--r--src/io.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/io.h b/src/io.h
index 22cf467..51801f6 100644
--- a/src/io.h
+++ b/src/io.h
@@ -24,18 +24,19 @@ enum {
24 IO_DONE = 0, /* operation completed successfully */ 24 IO_DONE = 0, /* operation completed successfully */
25 IO_TIMEOUT = -1, /* operation timed out */ 25 IO_TIMEOUT = -1, /* operation timed out */
26 IO_CLOSED = -2, /* the connection has been closed */ 26 IO_CLOSED = -2, /* the connection has been closed */
27 IO_CLIPPED = -3 /* maxium bytes count reached */ 27 IO_CLIPPED = -3, /* maxium bytes count reached */
28 IO_UNKNOWN = -4
28}; 29};
29 30
30/* interface to error message function */ 31/* interface to error message function */
31typedef const char *(*p_error) ( 32typedef const char *(*p_error) (
32 void *ctx, /* context needed by send */ 33 void *ctx, /* context needed by send */
33 int err /* error code */ 34 int err /* error code */
34); 35);
35 36
36/* interface to send function */ 37/* interface to send function */
37typedef int (*p_send) ( 38typedef int (*p_send) (
38 void *ctx, /* context needed by send */ 39 void *ctx, /* context needed by send */
39 const char *data, /* pointer to buffer with data to send */ 40 const char *data, /* pointer to buffer with data to send */
40 size_t count, /* number of bytes to send from buffer */ 41 size_t count, /* number of bytes to send from buffer */
41 size_t *sent, /* number of bytes sent uppon return */ 42 size_t *sent, /* number of bytes sent uppon return */
@@ -44,7 +45,7 @@ typedef int (*p_send) (
44 45
45/* interface to recv function */ 46/* interface to recv function */
46typedef int (*p_recv) ( 47typedef int (*p_recv) (
47 void *ctx, /* context needed by recv */ 48 void *ctx, /* context needed by recv */
48 char *data, /* pointer to buffer where data will be writen */ 49 char *data, /* pointer to buffer where data will be writen */
49 size_t count, /* number of bytes to receive into buffer */ 50 size_t count, /* number of bytes to receive into buffer */
50 size_t *got, /* number of bytes received uppon return */ 51 size_t *got, /* number of bytes received uppon return */
@@ -61,6 +62,6 @@ typedef struct t_io_ {
61typedef t_io *p_io; 62typedef t_io *p_io;
62 63
63void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx); 64void io_init(p_io io, p_send send, p_recv recv, p_error error, void *ctx);
64const char *io_strerror(int err); 65const char *io_strerror(int err);
65 66
66#endif /* IO_H */ 67#endif /* IO_H */ \ No newline at end of file