summaryrefslogtreecommitdiffhomepage
path: root/request.h
blob: e406711421c11f8ea816b008c204a9cb8c22cb3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#pragma once

#include <lua.h>

struct span
{
	int start;
	int length;
};

struct request
{
	int (* step)(struct request *);
	char * data;
	int length;
	int position;
	lua_State * lua;
	int reference;
	struct span temp;
	int expected_data_length;
};

struct request * new_request(lua_State *);
void free_request(lua_State *, struct request *);

int parse_request(lua_State *, int, struct request **);

int parse_step_method(struct request *);
int parse_step_path(struct request *);
int parse_step_version(struct request *);
int parse_step_header_name(struct request *);
int parse_step_header_value(struct request *);
int parse_step_data(struct request *);