From f66f8ad7119207b99f00ea2ea389550ee65db5b3 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 29 Nov 2024 18:09:12 -0500 Subject: Add serialization and deserialization --- stdlib/structs.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'stdlib/structs.h') diff --git a/stdlib/structs.h b/stdlib/structs.h index b41dde77..6553cc86 100644 --- a/stdlib/structs.h +++ b/stdlib/structs.h @@ -12,6 +12,8 @@ PUREFUNC int32_t Struct$compare(const void *x, const void *y, const TypeInfo_t * PUREFUNC bool Struct$equal(const void *x, const void *y, const TypeInfo_t *type); PUREFUNC Text_t Struct$as_text(const void *obj, bool colorize, const TypeInfo_t *type); PUREFUNC bool Struct$is_none(const void *obj, const TypeInfo_t *type); +void Struct$serialize(const void *obj, FILE *out, Table_t *pointers, const TypeInfo_t *type); +void Struct$deserialize(FILE *in, void *outval, Array_t *pointers, const TypeInfo_t *type); #define Struct$metamethods ((metamethods_t){ \ .hash=Struct$hash, \ @@ -19,6 +21,8 @@ PUREFUNC bool Struct$is_none(const void *obj, const TypeInfo_t *type); .equal=Struct$equal, \ .as_text=Struct$as_text, \ .is_none=Struct$is_none, \ + .serialize=Struct$serialize, \ + .deserialize=Struct$deserialize, \ }) // vim: ts=4 sw=0 et cino=L2,l1,(0,W4,m1,\:0 -- cgit v1.2.3