fx: support for registering callable functions with types

This commit is contained in:
2026-05-05 21:16:31 +01:00
parent 703155affe
commit f3062222cb
16 changed files with 182 additions and 25 deletions
@@ -14,6 +14,7 @@ typedef enum fx_function_flags {
FX_FUNCTION_F_STATIC = 0x01u,
FX_FUNCTION_F_VIRTUAL = 0x02u,
FX_FUNCTION_F_VARARG = 0x04u,
FX_FUNCTION_F_CONSTRUCTOR = 0x08u,
} fx_function_flags;
typedef void (*fx_function_impl)();
@@ -25,6 +26,8 @@ FX_TYPE_CLASS_DECLARATION_END(fx_function)
FX_API fx_type_id fx_function_get_type();
FX_API const char *fx_function_get_name(const fx_function *func);
FX_API fx_function *fx_function_create(
const char *name,
fx_function_flags flags,
@@ -2,6 +2,7 @@
#define FX_REFLECTION_TYPE_H_
#include <fx/macros.h>
#include <fx/reflection/function.h>
FX_DECLS_BEGIN;
@@ -17,6 +18,9 @@ FX_TYPE_CLASS_DECLARATION_END(fx_type)
FX_API fx_type_id fx_type_get_type();
FX_API const char *fx_type_get_name(const fx_type *ty);
FX_API const fx_function *fx_type_get_function(
const fx_type *ty,
const char *name);
FX_API const fx_type *fx_type_get_by_id(fx_type_id id);
FX_API const fx_type *fx_type_get_by_name(const char *name);