#ifndef HTTPPARSER_H
#define HTTPPARSER_H
#include <cx/string.h>
#include "httprequest.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _http_parser {
HTTPRequest *request;
int state;
cxmutstr start_line;
int wl;
int tk;
int offset;
int strend;
cxmutstr name;
cxmutstr value;
} HttpParser;
HttpParser* http_parser_new(HTTPRequest *request);
void http_parser_free(HttpParser *parser);
int http_parser_process(HttpParser *parser);
int http_parser_validate(HttpParser *parser);
int get_start_line(HttpParser *parser);
int http_parser_parse_header(HttpParser *parser);
int parse_request_line(HttpParser *parser);
#ifdef __cplusplus
}
#endif
#endif