1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00
v/vlib/picohttpparser/picohttpparser.v

36 lines
1.3 KiB
V
Raw Normal View History

// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
2020-01-23 05:26:30 +03:00
// Use of this source code is governed by an MIT license
// that can be found in the LICENSE file.
module picohttpparser
#flag -I @VROOT/thirdparty/picohttpparser
#flag -L @VROOT/thirdparty/picohttpparser
#flag @VROOT/thirdparty/picohttpparser/picohttpparser.o
#include "picohttpparser.h"
struct C.phr_header {
pub:
name &char
name_len int
value &char
2020-01-23 05:26:30 +03:00
value_len int
}
type PPchar = &&char
2020-01-23 05:26:30 +03:00
struct C.phr_header_t {}
fn C.phr_parse_request(buf &char, len size_t, method PPchar, method_len &size_t, path PPchar, path_len &size_t, minor_version &int, headers &C.phr_header, num_headers &size_t, last_len size_t) int
fn C.phr_parse_response(buf &char, len size_t, minor_version &int, status &int, msg PPchar, msg_len &size_t, headers &C.phr_header, num_headers &size_t, last_len size_t) int
fn C.phr_parse_headers(buf &char, len size_t, headers &C.phr_header, num_headers &size_t, last_len size_t) int
fn C.phr_parse_request_path(buf_start &char, len size_t, method PPchar, method_len &size_t, path PPchar, path_len &size_t) int
fn C.phr_parse_request_path_pipeline(buf_start &char, len size_t, method PPchar, method_len &size_t, path PPchar, path_len &size_t) int
fn C.get_date() &byte
2020-01-23 05:26:30 +03:00
// char * u64toa(uint64_t value, char *buffer)
fn C.u64toa(buffer &char, value u64) &char