#ifndef HTTPPARSER_H
#define HTTPPARSER_H
#include <ucx/string.h>
#include "httprequest.h"
#ifdef __cplusplus
extern "C" {
#endif
typedef struct _http_parser {
HTTPRequest *request;
int state;
sstr_t start_line;
int wl;
int tk;
int offset;
int strend;
sstr_t name;
sstr_t 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