Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
url_cparser.pxd32 linesDownload Raw Back to parser
1from libc.stdint cimport uint16_t
2
3
4cdef extern from "http_parser.h":
5    # URL Parser
6
7    enum http_parser_url_fields:
8        UF_SCHEMA   = 0,
9        UF_HOST     = 1,
10        UF_PORT     = 2,
11        UF_PATH     = 3,
12        UF_QUERY    = 4,
13        UF_FRAGMENT = 5,
14        UF_USERINFO = 6,
15        UF_MAX      = 7
16
17    struct http_parser_url_field_data:
18        uint16_t off
19        uint16_t len
20
21    struct http_parser_url:
22        uint16_t field_set
23        uint16_t port
24        http_parser_url_field_data[<int>UF_MAX] field_data
25
26    void http_parser_url_init(http_parser_url *u)
27
28    int http_parser_parse_url(const char *buf,
29                              size_t buflen,
30                              int is_connect,
31                              http_parser_url *u)
32 
codekingpro/portable-devtools · Team Ai