nx_rfc_ingest.nx
buildroot/runtime/nx_rfc_ingest.nx
about
nx_rfc_ingest.nx -- ingest IETF RFC plaintext.
RFCs (rfc-editor.org) are PD-equivalent under the IETF Trust Legal
Provisions and are an enormous source of clean, well-specified
algorithms. This parser walks plaintext .txt files and extracts
numbered section headers, which in practice name the algorithms and
procedures defined within the RFC.
Recognized pattern (line-anchored):
^[ ]{0,3}<digits>(\.<digits>)*\.?[ ]+<Title>...
Examples:
"1. Executive Summary"
"3.1. Algorithm Description"
"4.1.1. Step Definition"
The decl `name` is the title text (whitespace trimmed).
genealogy_id: ietf_trust_legal_provisions_2025
lineage_id: plaintext_section_header_parser
dependencies 2 imports · 2 importers
imports: nx_syscalls.nxnx_tier.nx
imported by: nx_rfc_dir_ingest.nxnx_rfc_stream_ingest.nx
structs
| 40 | struct RfcDecl |
| 47 | struct RfcDb |
consts
| 32 | const NX_RFC_KIND_SECTION: nx_int = 1 |
| 33 | const NX_RFC_KIND_DEFINITION: nx_int = 2 |
| 35 | const NX_RFC_MAX_NAME_LEN: nx_int = 256 |
| 36 | const NX_RFC_MAX_DECLS: nx_int = 65536 |
| 45 | const NX_RFC_DECL_BYTES: nx_int = 16 |
functions
| 53 | func nx_rfc_db_alloc() -> *RfcDb |
| 62 | func nx_rfc_decl_at(db: *RfcDb, i: nx_int) -> *RfcDecl |
| 69 | func nx_rfc_is_digit(c: nx_int) -> nx_int called by 1: nx_rfc_section_title_start |
| 77 | func nx_rfc_sanitize_char(c: nx_int) -> nx_int called by 1: nx_rfc_emit_title |
| 86 | func nx_rfc_skip_ws(buf: *u8, pos: nx_int, eol: nx_int) -> nx_int called by 1: nx_rfc_section_title_start |
| 108 | func nx_rfc_section_title_start(buf: *u8, pos: nx_int, eol: nx_int) -> nx_int |
| 141 | func nx_rfc_emit_title(buf: *u8, lo: nx_int, eol: nx_int, out: *u8) -> nx_int |
| 175 | func nx_rfc_ingest_corpus(buf: *u8, len: nx_int) -> *RfcDb called by 1: main calls 5: nx_rfc_db_allocnx_rfc_section_title_startsys_mmapnx_rfc_emit_titlenx_rfc_decl_at |