uri

URI/URL Parsing and Encoding

Functions

FunctionDescription
uri_copyInternal: copy bytes from src+off to dst, return len.
uri_is_unreservedInternal: is this byte unreserved (RFC 3986)?
uri_hex_charInternal: hex nibble to char.
uri_hex_valInternal: hex char to nibble.
uri_parseParse a URI string into components.
uri_scheme
uri_host
uri_port
uri_path
uri_query
uri_fragment
uri_encodePercent-encode a string. Returns output length.
uri_decodePercent-decode a string. Returns output length.
uri_query_getGet a query parameter value by key. Returns length (0 if not found). query/ql…

Details

uri_copy

fn uri_copy(src: &i8, off: i64, len: i64, dst: &i8) -> i64

Internal: copy bytes from src+off to dst, return len.

uri_is_unreserved

fn uri_is_unreserved(ch: i64) -> i64

Internal: is this byte unreserved (RFC 3986)?

uri_hex_char

fn uri_hex_char(n: i64) -> i64

Internal: hex nibble to char.

uri_hex_val

fn uri_hex_val(ch: i64) -> i64

Internal: hex char to nibble.

uri_parse

fn uri_parse(src: &i8, len: i64) -> &i64

Parse a URI string into components.

uri_scheme

fn uri_scheme(u: &i64, dst: &i8) -> i64

uri_host

fn uri_host(u: &i64, dst: &i8) -> i64

uri_port

fn uri_port(u: &i64) -> i64

uri_path

fn uri_path(u: &i64, dst: &i8) -> i64

uri_query

fn uri_query(u: &i64, dst: &i8) -> i64

uri_fragment

fn uri_fragment(u: &i64, dst: &i8) -> i64

uri_encode

fn uri_encode(src: &i8, len: i64, dst: &i8) -> i64

Percent-encode a string. Returns output length.

uri_decode

fn uri_decode(src: &i8, len: i64, dst: &i8) -> i64

Percent-decode a string. Returns output length.

uri_query_get

fn uri_query_get(query: &i8, qlen: i64, key: &i8, klen: i64, dst: &i8) -> i64

Get a query parameter value by key. Returns length (0 if not found). query/qlen is the raw query string, key/klen is the parameter name.