2022-01-04 10:21:08 +01:00
|
|
|
// Copyright (c) 2019-2022 Alexander Medvednikov. All rights reserved.
|
2020-01-23 03:26:30 +01:00
|
|
|
// Use of this source code is governed by an MIT license
|
|
|
|
// that can be found in the LICENSE file.
|
|
|
|
module picohttpparser
|
|
|
|
|
2021-04-19 18:01:47 +02:00
|
|
|
#flag -I @VEXEROOT/thirdparty/picohttpparser
|
|
|
|
#flag -L @VEXEROOT/thirdparty/picohttpparser
|
|
|
|
#flag @VEXEROOT/thirdparty/picohttpparser/picohttpparser.o
|
2020-01-23 03:26:30 +01:00
|
|
|
|
|
|
|
#include "picohttpparser.h"
|
|
|
|
|
|
|
|
struct C.phr_header {
|
|
|
|
pub:
|
2021-04-04 21:43:13 +02:00
|
|
|
name &char
|
2021-03-05 15:41:11 +01:00
|
|
|
name_len int
|
2021-04-04 21:43:13 +02:00
|
|
|
value &char
|
2020-01-23 03:26:30 +01:00
|
|
|
value_len int
|
|
|
|
}
|
2021-03-05 15:41:11 +01:00
|
|
|
|
2021-04-04 21:43:13 +02:00
|
|
|
type PPchar = &&char
|
|
|
|
|
2020-01-23 03:26:30 +01:00
|
|
|
struct C.phr_header_t {}
|
|
|
|
|
2021-09-08 12:09:32 +02:00
|
|
|
fn C.phr_parse_request(buf &char, len usize, method PPchar, method_len &usize, path PPchar, path_len &usize, minor_version &int, headers &C.phr_header, num_headers &usize, last_len usize) int
|
2021-04-04 21:43:13 +02:00
|
|
|
|
2021-09-08 12:09:32 +02:00
|
|
|
fn C.phr_parse_response(buf &char, len usize, minor_version &int, status &int, msg PPchar, msg_len &usize, headers &C.phr_header, num_headers &usize, last_len usize) int
|
2021-03-05 15:41:11 +01:00
|
|
|
|
2021-09-08 12:09:32 +02:00
|
|
|
fn C.phr_parse_headers(buf &char, len usize, headers &C.phr_header, num_headers &usize, last_len usize) int
|
2021-03-05 15:41:11 +01:00
|
|
|
|
2021-09-08 12:09:32 +02:00
|
|
|
fn C.phr_parse_request_path(buf_start &char, len usize, method PPchar, method_len &usize, path PPchar, path_len &usize) int
|
|
|
|
fn C.phr_parse_request_path_pipeline(buf_start &char, len usize, method PPchar, method_len &usize, path PPchar, path_len &usize) int
|
2021-10-01 12:49:38 +02:00
|
|
|
fn C.get_date() &char
|
2020-01-23 03:26:30 +01:00
|
|
|
|
2021-05-08 12:32:29 +02:00
|
|
|
// static inline int u64toa(char* buf, uint64_t value) {
|
|
|
|
fn C.u64toa(buffer &char, value u64) int
|