fx: re-arrange type system to allow for reflection

This commit is contained in:
2026-05-05 19:03:22 +01:00
parent 8c12868651
commit 90a3905f48
83 changed files with 768 additions and 842 deletions
+7 -7
View File
@@ -35,7 +35,7 @@ struct map {
struct type {
struct map_item e_map_item;
fx_type e_type;
fx_type_id e_type;
};
struct fx_assembly_p {
@@ -131,7 +131,7 @@ static void assembly_set_version(
static void assembly_add_type(
struct fx_assembly_p *asm,
const char *full_name,
fx_type type_id)
fx_type_id type_id)
{
struct type *type = malloc(sizeof *type);
memset(type, 0x0, sizeof *type);
@@ -218,7 +218,7 @@ void fx_assembly_set_version(
void fx_assembly_add_type(
fx_assembly *asm,
const char *full_name,
fx_type type_id)
fx_type_id type_id)
{
FX_CLASS_DISPATCH_STATIC_V(
FX_REFLECTION_TYPE_ASSEMBLY,
@@ -249,11 +249,11 @@ static void assembly_fini(fx_object *obj, void *priv)
/*** CLASS DEFINITION *********************************************************/
// ---- fx_string DEFINITION
FX_TYPE_CLASS_DEFINITION_BEGIN(fx_assembly)
FX_TYPE_CLASS_INTERFACE_BEGIN(fx_object, FX_TYPE_OBJECT)
FX_TYPE_CLASS_BEGIN(fx_assembly)
FX_TYPE_VTABLE_INTERFACE_BEGIN(fx_object, FX_TYPE_OBJECT)
FX_INTERFACE_ENTRY(to_string) = NULL;
FX_TYPE_CLASS_INTERFACE_END(fx_object, FX_TYPE_OBJECT)
FX_TYPE_CLASS_DEFINITION_END(fx_assembly)
FX_TYPE_VTABLE_INTERFACE_END(fx_object, FX_TYPE_OBJECT)
FX_TYPE_CLASS_END(fx_assembly)
FX_TYPE_DEFINITION_BEGIN(fx_assembly)
FX_TYPE_ID(0xf6690c30, 0x6642, 0x42f0, 0xb79f, 0xe2baf3684b1b);