code wiki / (root) / nx_atom_v1.nx

nx_atom_v1.nx

buildroot/runtime/nx_atom_v1.nx

6748 B189 linesdepth 4pulls 5 transitivereach 0 importersview sourcekind tooltopic atom
docsdependenciesstructsconstsfunctions

about

atom.nx -- Atom 1.0 feed builder (RFC 4287). Modern alternative to RSS 2.0. Atom's strictness (required id, updated, author; XML namespaces; RFC 3339 dates) makes it cleaner for programmatic parsing. Google, NetNewsWire, and many news APIs prefer Atom. Nishi-pages should emit both -- RSS for universal compatibility, Atom for correctness. Feed skeleton: <?xml version=\"1.0\" encoding=\"utf-8\"?> <feed xmlns=\"http://www.w3.org/2005/Atom\"> <title>...</title> <link href=\"...\"/> <id>...</id> <updated>2026-04-22T12:34:56Z</updated> <author><name>...</name></author> <entry> <title>...</title> <link href=\"...\"/> <id>...</id> <updated>...</updated> <summary>...</summary> <content type=\"html\"><![CDATA[...]]></content> </entry> </feed> Dates: ISO 8601 (iso8601.nx) -- RFC 3339 is the Atom-specified subset. HTML content: CDATA wrap, same convention as rss.nx. Invariants: A1 id must be a stable tag: URI or URL. Caller supplies; we emit as-is (escaped). A2 updated is required at both feed + entry level; we require it rather than defaulting. A3 Stream builder: atom_begin -> atom_entry* -> atom_end.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_html_escape.nx nx_iso8601.nx nx_atom_v1.nx

imports: nx_syscalls.nxnx_html_escape.nxnx_iso8601.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap atom_begin atom_put atom_put_escaped html_escape he_is_safe he_put atom_put_iso iso_format_unix sys_mmap ↻ civil_from_unix cd_fdiv cd_fmod cd_fdiv ↻ iso_format iso_put_4d iso_put_2d atom_end atom_put ↻

structs

none

consts

46const ATOM_MAGIC_4096: i64 = 4096
47const ATOM_MAGIC_1777000000: i64 = 1777000000
49const ATOM_ERR_SHORT: i64 = -1

functions

51func atom_put(out: *u8, cap: i64, off: i64,
62func atom_put_escaped(out: *u8, cap: i64, off: i64,
called by 2: atom_beginatom_entry calls 1: html_escape
70func atom_put_iso(out: *u8, cap: i64, off: i64, unix_sec: i64) -> i64
77func atom_begin(out: *u8, cap: i64, off: i64,
118func atom_entry(out: *u8, cap: i64, off: i64,
156func atom_end(out: *u8, cap: i64, off: i64) -> i64
161func main() -> i64