code wiki / (root) / nx_url.nx

nx_url.nx

buildroot/runtime/nx_url.nx

8334 B237 linesdepth 3pulls 4 transitivereach 500 importersview sourcekind tooltopic url
docsdependenciesstructsconstsfunctions

about

nx_url.nx -- minimal URL parser (RFC 3986 subset). Parses "scheme://host[:port]/path?query#fragment" into its component spans within the original buffer. No allocation; each component is an offset+length pair pointing into the original input string. Used by: - HTTP client (host/port for connect, path for GET line) - Sovereign Gemini browser (the next-app-after-chat use case) - Service discovery URL canonicalization Out of scope: - Percent-decoding - IPv6 address brackets ([fe80::1]) - userinfo (user:pass@host) - International domain names (Punycode)

dependencies 2 imports · 13 importers

syscalls.nx nx_runtime.nx nx_url.nx _dlr_probe.nx nx_https_client.nx nx_https_get.nx nx_https_get_spoof.nx nx_https_ka_probe.nx nx_https_url_for_fetch.nx nx_https_url_for_fetch_test.nx nx_porkbun_ping_probe.nx nx_research_ka.nx nx_tls12_handshake_gate.nx

diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.

imports: syscalls.nxnx_runtime.nx

imported by: _dlr_probe.nxnx_https_client.nxnx_https_get.nxnx_https_get_spoof.nxnx_https_ka_probe.nxnx_https_url_for_fetch.nxnx_https_url_for_fetch_test.nxnx_porkbun_ping_probe.nxnx_research_ka.nxnx_tls12_handshake_gate.nxnx_tls12_probe_test.nxnx_url_parse_test.nxnx_video_get.nx

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main nx_url_new nx_url_parse strlen

structs

35struct NxUrl

consts

32const NX_MAGIC_65535: i64 = 65535
33const NX_MAGIC_8080: i64 = 8080
44const NX_URL_BYTES: i64 = 88
47const NX_URL_ERR_NO_SCHEME: i64 = -1
48const NX_URL_ERR_NO_HOST: i64 = -2
49const NX_URL_ERR_BAD_PORT: i64 = -3

functions

54func nx_url_new() -> *NxUrl
68func nx_url_parse(s: *u8, out: *NxUrl) -> i64
called by 2: nx_https_url_for_fetchmain calls 1: strlen
200func main() -> i64