rss.nx
buildroot/runtime/rss.nx
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
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
structs
| none |
consts
| 49 | const RSS_ERR_SHORT: i64 = -1 |
functions
| 53 | func rss_put(out: *u8, cap: i64, off: i64, |
| 65 | func rss_put_escaped(out: *u8, cap: i64, off: i64, |
| 74 | func rss_begin(out: *u8, cap: i64, off: i64, |
| 112 | func rss_item(out: *u8, cap: i64, off: i64, |
| 150 | func rss_end(out: *u8, cap: i64, off: i64) -> i64 {
calls 1: rss_put |
| 155 | func main() -> i64 {
calls 1: rss_begin |