diff options
author | Aki <please@ignore.pl> | 2021-08-21 14:35:46 +0200 |
---|---|---|
committer | Aki <please@ignore.pl> | 2021-08-21 14:35:46 +0200 |
commit | f41138949b4fb13331391cf3d7570d38f04a2ce8 (patch) | |
tree | 4af9d8fb30fe7d044957c158e6e8c5c53c9bea46 /buffer.h | |
parent | d4e5c2f12a284b64f6b68a994d63fe7babf7f46d (diff) | |
download | plop-f41138949b4fb13331391cf3d7570d38f04a2ce8.zip plop-f41138949b4fb13331391cf3d7570d38f04a2ce8.tar.gz plop-f41138949b4fb13331391cf3d7570d38f04a2ce8.tar.bz2 |
Moved buffer to own set of files
Diffstat (limited to 'buffer.h')
-rw-r--r-- | buffer.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/buffer.h b/buffer.h new file mode 100644 index 0000000..d4fafa6 --- /dev/null +++ b/buffer.h @@ -0,0 +1,19 @@ +#pragma once + +#include <lua.h> + +struct stream; // TODO: Remove buffer to stream dependency. + +struct buffer +{ + char * data; + int length; + int offset; + int next; + int allocated; +}; + +void grow(lua_State *, struct buffer *); +int prepare_at_least(lua_State *, struct stream *, const int, lua_KContext); +int read_more(lua_State *, struct stream *, const int, lua_KContext); +int until(struct buffer *, const char *, const int); |