aboutsummaryrefslogtreecommitdiff
path: root/src/buffer.h
diff options
context:
space:
mode:
authorDiego Nehab <diego@tecgraf.puc-rio.br>2002-03-27 18:00:00 +0000
committerDiego Nehab <diego@tecgraf.puc-rio.br>2002-03-27 18:00:00 +0000
commit8f05082f77a5bf612291de593f63e09e7fb3a5cb (patch)
treef1da6940e8d9b9f6cc129213d0c571da65e467c6 /src/buffer.h
parent3bd99ec59996653011f0eb40a0be4a523fe82897 (diff)
downloadluasocket-8f05082f77a5bf612291de593f63e09e7fb3a5cb.tar.gz
luasocket-8f05082f77a5bf612291de593f63e09e7fb3a5cb.tar.bz2
luasocket-8f05082f77a5bf612291de593f63e09e7fb3a5cb.zip
Initial revision
Diffstat (limited to '')
-rw-r--r--src/buffer.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/buffer.h b/src/buffer.h
new file mode 100644
index 0000000..7463a67
--- /dev/null
+++ b/src/buffer.h
@@ -0,0 +1,33 @@
1/*=========================================================================*\
2* Buffered input/output routines
3* RCS ID: $Id$
4\*=========================================================================*/
5#ifndef BUF_H_
6#define BUF_H_
7
8#include <lua.h>
9#include "lsbase.h"
10
11/* buffer size in bytes */
12#define BUF_SIZE 8192
13
14/*-------------------------------------------------------------------------*\
15* Buffer control structure
16\*-------------------------------------------------------------------------*/
17typedef struct t_buf_tag {
18 size_t buf_first, buf_last;
19 uchar buf_data[BUF_SIZE];
20 p_base buf_base;
21} t_buf;
22typedef t_buf *p_buf;
23
24/*-------------------------------------------------------------------------*\
25* Exported functions
26\*-------------------------------------------------------------------------*/
27void buf_open(lua_State *L);
28void buf_init(lua_State *L, p_buf buf, p_base base);
29int buf_send(lua_State *L, p_buf buf);
30int buf_receive(lua_State *L, p_buf buf);
31int buf_isempty(lua_State *L, p_buf buf);
32
33#endif /* BUF_H_ */