Split the README reference material into docs/
The README was 794 lines: the summary, the design rationale, the whole macro reference, the threading contract, the build internals and the exit-status specification in one file. It is now 178 lines -- summary, installation, quickstart, and an index -- and the reference material lives in docs/, one file per topic: architecture, usage, status-codes, uncaught-errors, exit-status, thread-safety, building. The prose moved as written. Inbound references followed it: UPGRADING.md, TODO.md, include/akerror.tmpl.h and tests/err_threads_handoff.c now name the docs/ file that owns the text they cite, and AGENTS.md says where new documentation goes so the README does not grow back. Five factual errors fixed in the moved text: - Both NULL-pointer examples inverted their test. FAIL_ZERO_* fails when the expression is zero, so `(somePointer == NULL)` failed on a *valid* pointer. They now read `(somePointer != NULL)`. - AKERROR_NOIGNORE, four times including the #define, is AKERR_NOIGNORE. - FINISH_NORExbTURN is FINISH_NORETURN. - "functiions" is "functions". - The architecture link pointed at include/akerror.h, which is generated and not in the tree; it points at include/akerror.tmpl.h. The quickstart is new text. It compiles under -Wall -Wextra -Werror and was run through all three of its paths: handled usage error exits 0, unhandled IO error prints a trace and exits with the status, success exits 0. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -33,8 +33,8 @@ top-level `HANDLE` block, an init routine that cannot continue — so one mappin
|
||||
covers every exit. It is declared `AKERR_NORETURN`. If you were reading a
|
||||
consumer status out of `$?`, you were never getting it: read the stack trace,
|
||||
which carries the status at full width along with its registered name, or
|
||||
install a handler that maps your own statuses into a byte. See "Exit status" in
|
||||
[README.md](README.md).
|
||||
install a handler that maps your own statuses into a byte. See
|
||||
[docs/exit-status.md](docs/exit-status.md).
|
||||
|
||||
No ABI break. The soname stays `libakerror.so.2` and nothing you already call
|
||||
changed shape. `akerr_exit()` is a new exported symbol, so a consumer that
|
||||
@@ -108,7 +108,8 @@ Still yours to coordinate:
|
||||
* **Two threads in one context at once.** Ownership moves; it does not fork.
|
||||
Hand a context over and stop touching it — the content is written with no
|
||||
lock, so the handoff is what publishes it. See "Handing an error to another
|
||||
thread" in README.md for the pattern, and for why the queue has to be bounded.
|
||||
thread" in docs/thread-safety.md for the pattern, and for why the queue has
|
||||
to be bounded.
|
||||
* **`akerr_log_method` and `akerr_handler_unhandled_error`** are read on every
|
||||
error and written by nobody but you. Set them during startup, before spawning.
|
||||
* **Renaming a status while another thread looks it up.**
|
||||
|
||||
Reference in New Issue
Block a user