code wiki / (root) / rss.nx

rss.nx

buildroot/runtime/rss.nx

6537 B181 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

rss.nx -- RSS 2.0 feed builder. Emits valid RSS 2.0 XML (specification: Harvard Berkman Center, 2009). Every feed reader, podcast app, news aggregator, and many static site generators consume RSS. nishi-pages without RSS is half a blog engine. Feed skeleton: <?xml version=\"1.0\" encoding=\"utf-8\"?> <rss version=\"2.0\"> <channel> <title>...</title> <link>...</link> <description>...</description> <language>en</language> <pubDate>Wed, 22 Apr 2026 12:34:56 GMT</pubDate> <item> <title>...</title> <link>...</link> <description>...</description> <pubDate>...</pubDate> <guid>...</guid> </item> ... </channel> </rss> All dates use IMF-fixdate (http_date.nx). Text content is HTML-escaped (html_escape.nx) so the feed can contain '<', '>', '&' safely. This is a stream-builder: caller walks their posts and calls rss_item for each; we don't own the post list. All output appends to a caller-owned buffer with bounds checking. Invariants: R1 Order matters: rss_begin -> rss_item* -> rss_end. R2 Caller supplies HTML-unsafe text; we escape internally. R3 All dates are unix seconds converted to GMT fixdate. R4 Description can contain HTML; we wrap it in CDATA rather

dependencies 3 imports · 0 importers

syscalls.nx html_escape.nx http_date.nx rss.nx

imports: syscalls.nxhtml_escape.nxhttp_date.nx

imported by: nobody (leaf or entry point)

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

main rss_begin rss_put rss_put_escaped html_escape he_is_safe he_put http_date_format_unix civil_from_unix cd_fdiv cd_fmod cd_fdiv ↻ http_date_format hd_put3 hd_weekday_bytes hd_put_2d hd_month_bytes hd_put_4d

structs

none

consts

49const RSS_ERR_SHORT: i64 = -1

functions

53func rss_put(out: *u8, cap: i64, off: i64,
65func rss_put_escaped(out: *u8, cap: i64, off: i64,
called by 2: rss_beginrss_item calls 1: html_escape
74func rss_begin(out: *u8, cap: i64, off: i64,
112func rss_item(out: *u8, cap: i64, off: i64,
150func rss_end(out: *u8, cap: i64, off: i64) -> i64 {
calls 1: rss_put
155func main() -> i64 {
calls 1: rss_begin