Revise module docs for accuracy and one voice #13

Merged
fputs merged 1 commit from docs/review-prose into master 2026-11-08 12:29:17 -08:00
Owner

Module pages were checked against the headers and the implementations. Each page now has one example and states return codes and ownership the way the code behaves.

Tutorial walkthroughs, including linkedlist and binarytree, are a single init, use, and destroy example. Per-function samples that repeated that example are gone.

Contracts that did not match the source:

  • lf_reallocarray is the local function on every supported platform. It does not call the system reallocarray.
  • lf_dir_next leaves the previous name in place when it returns 1 or -1.
  • LF_BIT_TEST returns the place value, not 0 or 1. Only LF_BIT_INSERT evaluates x, start, and width twice.
  • A failed lf_bitset_init zeroes a non-NULL handle. A NULL handle is not written.
  • lfstr_copy_arena returns -1 when the allocator is NULL. It does not fall back to malloc.
  • Hash-map cursor rules match what remove, replace, and rehash do to pointers already yielded.

README configure lines use cmake -S . -B build.

include/lfbitops.h still says every macro argument is evaluated more than once. The macros do not. This change documents the definitions and does not edit the header.

puzzle, rng, intern, and process were already in this voice and were left as they were.

Module pages were checked against the headers and the implementations. Each page now has one example and states return codes and ownership the way the code behaves. Tutorial walkthroughs, including linkedlist and binarytree, are a single init, use, and destroy example. Per-function samples that repeated that example are gone. Contracts that did not match the source: - `lf_reallocarray` is the local function on every supported platform. It does not call the system `reallocarray`. - `lf_dir_next` leaves the previous name in place when it returns `1` or `-1`. - `LF_BIT_TEST` returns the place value, not 0 or 1. Only `LF_BIT_INSERT` evaluates `x`, `start`, and `width` twice. - A failed `lf_bitset_init` zeroes a non-NULL handle. A NULL handle is not written. - `lfstr_copy_arena` returns `-1` when the allocator is NULL. It does not fall back to `malloc`. - Hash-map cursor rules match what `remove`, `replace`, and rehash do to pointers already yielded. README configure lines use `cmake -S . -B build`. `include/lfbitops.h` still says every macro argument is evaluated more than once. The macros do not. This change documents the definitions and does not edit the header. `puzzle`, `rng`, `intern`, and `process` were already in this voice and were left as they were.
Revise module docs for accuracy and one voice
All checks were successful
test / test (pull_request) Successful in 14s
test / sanitize (pull_request) Successful in 19s
01cdbe916c
Check each page against the headers and the implementations. One example per module, with return codes and ownership stated the way the code behaves.
fputs merged commit 1f42a51e4b into master 2026-11-08 12:29:17 -08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
fputs/libflint!13
No description provided.