1 // Metamethods for structs
10 PUREFUNC uint64_t Struct$hash(const void *obj, const TypeInfo_t *type);
11 PUREFUNC uint64_t PackedData$hash(const void *obj, const TypeInfo_t *type);
12 PUREFUNC int32_t Struct$compare(const void *x, const void *y, const TypeInfo_t *type);
13 PUREFUNC bool Struct$equal(const void *x, const void *y, const TypeInfo_t *type);
14 PUREFUNC bool PackedData$equal(const void *x, const void *y, const TypeInfo_t *type);
15 PUREFUNC Text_t Struct$as_text(const void *obj, bool colorize, const TypeInfo_t *type);
16 void Struct$serialize(const void *obj, FILE *out, Table_t *pointers, const TypeInfo_t *type);
17 void Struct$deserialize(FILE *in, void *outval, List_t *pointers, const TypeInfo_t *type);
19 #define Struct$metamethods \
21 .hash = Struct$hash, \
22 .compare = Struct$compare, \
23 .equal = Struct$equal, \
24 .as_text = Struct$as_text, \
25 .serialize = Struct$serialize, \
26 .deserialize = Struct$deserialize, \
29 #define PackedData$metamethods \
31 .hash = PackedData$hash, \
32 .compare = Struct$compare, \
33 .equal = PackedData$equal, \
34 .as_text = Struct$as_text, \
35 .serialize = Struct$serialize, \
36 .deserialize = Struct$deserialize, \