summaryrefslogtreecommitdiffhomepage
path: root/buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'buffer.c')
-rw-r--r--buffer.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/buffer.c b/buffer.c
index ad6ca25..f7e4334 100644
--- a/buffer.c
+++ b/buffer.c
@@ -9,7 +9,7 @@
#include "stream.h"
-void grow(lua_State * L, struct buffer * b)
+void buffer_grow(lua_State * L, struct buffer * b)
{
int allocated = b->allocated + 1024;
@@ -31,13 +31,13 @@ void grow(lua_State * L, struct buffer * b)
b->allocated = allocated;
}
-int read_more(lua_State * L, int fd, struct buffer * in, int minimum_length, lua_KContext ctx)
+int buffer_read_more(lua_State * L, int fd, struct buffer * in, int minimum_length, lua_KContext ctx)
{
const int free_space = in->allocated + in->offset - in->length - 1;
while (free_space < minimum_length)
{
- grow(L, in);
+ buffer_grow(L, in);
}
if (0 < in->offset)
@@ -67,19 +67,19 @@ int read_more(lua_State * L, int fd, struct buffer * in, int minimum_length, lua
return length;
}
-int prepare_at_least(lua_State * L, int fd, struct buffer * in, int minimum_length, lua_KContext ctx)
+int buffer_prepare_at_least(lua_State * L, int fd, struct buffer * in, int minimum_length, lua_KContext ctx)
{
const int remaining_bytes = in->length - in->next;
if (remaining_bytes < minimum_length)
{
- return read_more(L, fd, in, minimum_length, ctx);
+ return buffer_read_more(L, fd, in, minimum_length, ctx);
}
return remaining_bytes;
}
-int until(struct buffer * b, const char * pattern, int pattern_length)
+int buffer_until(struct buffer * b, const char * pattern, int pattern_length)
{
while (b->next + pattern_length <= b->length)
{