Files
fx/fx.reflection/include/fx/reflection/function.h
T

49 lines
1.1 KiB
C

#ifndef FX_REFLECTION_FUNCTION_H_
#define FX_REFLECTION_FUNCTION_H_
#include <fx/macros.h>
#include <fx/status.h>
#include <fx/value.h>
FX_DECLS_BEGIN;
#define FX_REFLECTION_TYPE_FUNCTION (fx_function_get_type())
typedef enum fx_function_flags {
FX_FUNCTION_F_NONE = 0x00u,
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)();
FX_DECLARE_TYPE(fx_function);
FX_TYPE_CLASS_DECLARATION_BEGIN(fx_function)
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,
fx_function_impl impl,
const fx_type_id *args,
size_t nr_args,
fx_type_id return_type);
FX_API fx_status
fx_function_bind(fx_function *func, fx_value *args, size_t nr_args);
FX_API fx_status fx_function_invoke(
const fx_function *func,
const fx_value *args,
size_t nr_args,
fx_value *return_value);
FX_DECLS_END;
#endif