A growable byte and text buffer with printf, and printf into a new string
$ sexc add @ajax/mesh-strbuf- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 05:23v/# 1 version
- drwxr-xr-x-Oct 27 05:23files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 05:23 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-check ^0.1.0
- dependents
- @ajax/mesh-assemble, @ajax/mesh-assemble-bmp, @ajax/mesh-blobd, @ajax/mesh-blobs-durable, @ajax/mesh-blobs-frame, @ajax/mesh-blobs-store, @ajax/mesh-debug-str, @ajax/mesh-jobd, @ajax/mesh-jobd-store, @ajax/mesh-jobd-text, @ajax/mesh-jobs-frame, @ajax/mesh-jobs-log, @ajax/mesh-jobs-node, @ajax/mesh-jobs-op, @ajax/mesh-jobs-out, @ajax/mesh-jobs-ranges, @ajax/mesh-jobs-req, @ajax/mesh-jobs-sched, @ajax/mesh-jobs-select, @ajax/mesh-jobs-spec, @ajax/mesh-jobs-table, @ajax/mesh-jobs-wire
- keywords
- mesh alphaos string buffer printf
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-strbuf
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-strbuf 2 3A growable buffer of bytes, always NUL-terminated so it is text too, with `printf`; `printf` into a new 4string (`mfmt`); `mstrdup`; and allocation that aborts instead of returning NULL. The jobs and blobs 5packages build their wire frames, logs and control answers with it, as the Rust builds `Vec<u8>` and 6`String`. 7 8## Ported from 9 10[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): the C port's 11replacement for Rust's `String`, `Vec<u8>` and `format!`. 12 13## Tests 14 15`tests/strbuf.c`: appends, growth past a thousand `printf`s, embedded NULs, `msb_take`, `mfmt`. 16 17## Licence 18 19MIT. See the repository's LICENSE.