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
@@ -30,8 +30,8 @@ FX_TYPE_CLASS_DECLARATION_END(fx_array)
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_array_iterator)
FX_TYPE_CLASS_DECLARATION_END(fx_array_iterator)
FX_API fx_type fx_array_get_type(void);
FX_API fx_type fx_array_iterator_get_type(void);
FX_API fx_type_id fx_array_get_type(void);
FX_API fx_type_id fx_array_iterator_get_type(void);
FX_TYPE_DEFAULT_CONSTRUCTOR(fx_array, FX_TYPE_ARRAY);
@@ -14,7 +14,7 @@ FX_DECLARE_TYPE(fx_bitmap);
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_bitmap)
FX_TYPE_CLASS_DECLARATION_END(fx_bitmap)
FX_API fx_type fx_bitmap_get_type(void);
FX_API fx_type_id fx_bitmap_get_type(void);
FX_API fx_bitmap *fx_bitmap_create(size_t nr_bits);
@@ -13,7 +13,7 @@ FX_DECLARE_TYPE(fx_buffer);
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_buffer)
FX_TYPE_CLASS_DECLARATION_END(fx_buffer)
FX_API fx_type fx_buffer_get_type(void);
FX_API fx_type_id fx_buffer_get_type(void);
FX_API fx_buffer *fx_buffer_create(size_t item_sz);
FX_API fx_buffer *fx_buffer_create_from_bytes(const void *p, size_t len);
@@ -18,7 +18,7 @@ typedef enum fx_datetime_format {
FX_DATETIME_FORMAT_RFC3339 = 1,
} fx_datetime_format;
FX_API fx_type fx_datetime_get_type(void);
FX_API fx_type_id fx_datetime_get_type(void);
FX_TYPE_DEFAULT_CONSTRUCTOR(fx_datetime, FX_TYPE_DATETIME);
+2 -2
View File
@@ -37,8 +37,8 @@ typedef struct fx_dict_item {
fx_object *value;
} fx_dict_item;
FX_API fx_type fx_dict_get_type(void);
FX_API fx_type fx_dict_iterator_get_type(void);
FX_API fx_type_id fx_dict_get_type(void);
FX_API fx_type_id fx_dict_iterator_get_type(void);
FX_TYPE_DEFAULT_CONSTRUCTOR(fx_dict, FX_TYPE_DICT);
@@ -2,6 +2,7 @@
#define FX_DS_HASHMAP_H_
#include <fx/bst.h>
#include <fx/iterator.h>
#include <fx/macros.h>
#include <fx/misc.h>
#include <fx/queue.h>
@@ -60,8 +61,8 @@ typedef struct fx_hashmap_item {
fx_hashmap_value value;
} fx_hashmap_item;
FX_API fx_type fx_hashmap_get_type(void);
FX_API fx_type fx_hashmap_iterator_get_type(void);
FX_API fx_type_id fx_hashmap_get_type(void);
FX_API fx_type_id fx_hashmap_iterator_get_type(void);
FX_API fx_hashmap *fx_hashmap_create(
fx_hashmap_key_destructor key_dtor,
+2 -2
View File
@@ -23,8 +23,8 @@ FX_TYPE_CLASS_DECLARATION_END(fx_list_iterator)
typedef struct fx_list_entry fx_list_entry;
FX_API fx_type fx_list_get_type(void);
FX_API fx_type fx_list_iterator_get_type(void);
FX_API fx_type_id fx_list_get_type(void);
FX_API fx_type_id fx_list_iterator_get_type(void);
FX_TYPE_DEFAULT_CONSTRUCTOR(fx_list, FX_TYPE_LIST);
+2 -2
View File
@@ -30,8 +30,8 @@ typedef struct fx_tree_node {
struct fx_queue_entry __q01;
} fx_tree_node;
FX_API fx_type fx_tree_get_type(void);
FX_API fx_type fx_tree_iterator_get_type(void);
FX_API fx_type_id fx_tree_get_type(void);
FX_API fx_type_id fx_tree_iterator_get_type(void);
FX_TYPE_DEFAULT_CONSTRUCTOR(fx_tree, FX_TYPE_TREE);