diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 13:28:30 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 14:24:59 -0300 |
| commit | 0f81de017ca7b52e951bb70f6f5f3e8c88b425e6 (patch) | |
| tree | fde88db0ed0dd68fbeb7bf7aaa49d3cd1f08b1c1 /src/kinds/pardes_addon.h | |
| parent | b7fdfb18ffd199d49a254c1c799bc3415ad45ec2 (diff) | |
| download | pardes-0f81de017ca7b52e951bb70f6f5f3e8c88b425e6.tar.gz pardes-0f81de017ca7b52e951bb70f6f5f3e8c88b425e6.zip | |
kinds #25, addons in Zig: src/kinds/addon.zig, over the translated header and nothing of the core, makes a kind's pa_ops from a struct of the functions it has (its head from name, version, extensions and words; a public function of no kind's name a compile error), the pane's arena and a job's pa_out as std Allocators, typed keys, a Window to put text in, a Paint for the prefix and placements, tick's flags and a Deadline, dump and load as an extern struct's bytes in one line each, and body and ctl over a Writer; snake.zig and image.zig (stb_image in stb.c, static, beside any zstbi) replace snake.c and image.c with the same goldens, harness and perf cell, and addon-test runs their own zig tests
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/kinds/pardes_addon.h')
| -rw-r--r-- | src/kinds/pardes_addon.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/kinds/pardes_addon.h b/src/kinds/pardes_addon.h index 072f2447..0870aa6f 100644 --- a/src/kinds/pardes_addon.h +++ b/src/kinds/pardes_addon.h @@ -20,8 +20,9 @@ * pa_paint and pa_ops: a core reads an addon's new ones by its head's * minor, an addon pardes's by api->size. * - * addons/fake/fake.c implements every function; it is the template, and - * addons/snake/snake.c a game in it. + * addons/fake/fake.c implements every function; it is the template. In + * Zig, src/kinds/addon.zig makes the pa_ops from a struct, and + * addons/snake/snake.zig is a game in it. */ #ifndef PARDES_ADDON_H #define PARDES_ADDON_H @@ -305,9 +306,10 @@ typedef struct pa_ops { uint32_t (*job_run)(const uint8_t *in, uint32_t n, pa_out *out); /* Back on pardes's thread; `out` is gone after the call. */ void (*job_done)(void *st, uint32_t token, const uint8_t *out, uint32_t n); - /* The pane's record for a dump: at most `n` bytes, n at least 1 MiB; 0 is - * no record (load is not called and the pane reopens from its path, its - * `where` and its words' last values), and so is having no dump. */ + /* The pane's record for a dump: its length, written in `n` bytes (n at + * least 1 MiB), or a length past n, unwritten, to be called again with that + * many; 0 is no record (load is not called and the pane reopens from its + * path, its `where` and its words' last values), and so is having no dump. */ uint32_t (*dump)(void *st, uint8_t *buf, uint32_t n); /* On the state open(path, bytes, len) returned, with the writer's * head.version: PA_OK, or nonzero to refuse (the pane waits as a |
