summaryrefslogtreecommitdiffhomepage
path: root/stream.h
blob: a1649819c1cec9ccb830ec5549d486d37c048759 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#pragma once

#include <lua.h>

struct buffer
{
	char * data;
	int length;
	int offset;
	int allocated;
};

struct stream
{
	int fd;
	struct buffer in;
};

int stream_push_new(lua_State *, const int);
int stream_gc(lua_State *);
int stream_read(lua_State *);
int stream_readk(lua_State *, const int, lua_KContext);