(103 lines)
1 // Type information and methods for TypeInfos (i.e. runtime representations of types)22 hash_fn_t hash;23 compare_fn_t compare;24 equal_fn_t equal;25 as_text_fn_t as_text;26 is_none_fn_t is_none;27 serialize_fn_t serialize;28 deserialize_fn_t deserialize;29 } metamethods_t;34 } NamedType_t;37 int64_t size, align;38 metamethods_t metamethods;41 OpaqueInfo,42 StructInfo,43 EnumInfo,44 PointerInfo,45 TextInfo,46 ListInfo,47 TableInfo,48 FunctionInfo,49 OptionalInfo,50 TypeInfoInfo51 } tag;54 } OpaqueInfo;58 } PointerInfo;61 } TextInfo;64 } ListInfo;67 } TableInfo;70 } FunctionInfo;73 } TypeInfoInfo;76 } OptionalInfo;79 NamedType_t *tags;81 } EnumInfo;84 NamedType_t *fields;87 } StructInfo;88 };89 };90 };98 &((TypeInfo_t){ \103 .metamethods = {.serialize = cannot_serialize, .deserialize = cannot_deserialize, .as_text = Type$as_text}})