lib+test/wcc: add memio, rename io stream.ww→io.ww

Mirrors Hare's memio: fixed, dynamic, dynamicfrom, buffer, string,
reset, borrowedread. Caller owns the state + stream slots because
w6c lacks &x.field and 32B return-by-value. Tests table-driven via
parallel arrays. io.stream now exported.
This commit is contained in:
2026-05-13 16:07:18 +09:00
parent 7a4f60b041
commit 09a336cb74
5 changed files with 581 additions and 3 deletions

View File

@@ -13,7 +13,7 @@ export type eof = void;
// closed. NAMED-void; same shape, different tag.
export type closed = void;
type stream = struct {
export type stream = struct {
ctx: *void,
read: fn(s: *stream, buf: []u8) (i32 | eof | closed),
write: fn(s: *stream, buf: []u8) (i32 | closed),