nx_atom_v1.nx
buildroot/runtime/nx_atom_v1.nx
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
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
structs
| none |
consts
| 46 | const ATOM_MAGIC_4096: i64 = 4096 |
| 47 | const ATOM_MAGIC_1777000000: i64 = 1777000000 |
| 49 | const ATOM_ERR_SHORT: i64 = -1 |
functions
| 51 | func atom_put(out: *u8, cap: i64, off: i64, |
| 62 | func atom_put_escaped(out: *u8, cap: i64, off: i64, |
| 70 | func atom_put_iso(out: *u8, cap: i64, off: i64, unix_sec: i64) -> i64 |
| 77 | func atom_begin(out: *u8, cap: i64, off: i64, |
| 118 | func atom_entry(out: *u8, cap: i64, off: i64, |
| 156 | func atom_end(out: *u8, cap: i64, off: i64) -> i64 |
| 161 | func main() -> i64 |