fx: update header directories
This commit is contained in:
+23
-9
@@ -3,11 +3,11 @@
|
||||
#include "type.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <fx/core/class.h>
|
||||
#include <fx/core/macros.h>
|
||||
#include <fx/core/object.h>
|
||||
#include <fx/core/stream.h>
|
||||
#include <fx/core/thread.h>
|
||||
#include <fx/class.h>
|
||||
#include <fx/macros.h>
|
||||
#include <fx/object.h>
|
||||
#include <fx/stream.h>
|
||||
#include <fx/thread.h>
|
||||
|
||||
FX_TYPE_CLASS_DEFINITION_BEGIN(fx_object)
|
||||
FX_TYPE_CLASS_INTERFACE_BEGIN(fx_object, FX_TYPE_OBJECT)
|
||||
@@ -21,7 +21,8 @@ FX_TYPE_DEFINITION_BEGIN(fx_object)
|
||||
FX_TYPE_DEFINITION_END(fx_object)
|
||||
|
||||
fx_result fx_object_instantiate(
|
||||
struct fx_type_registration *type, struct _fx_object **out_object)
|
||||
struct fx_type_registration *type,
|
||||
struct _fx_object **out_object)
|
||||
{
|
||||
struct _fx_object *out = malloc(type->r_instance_size);
|
||||
if (!out) {
|
||||
@@ -77,8 +78,18 @@ struct _fx_object *fx_object_create(fx_type type)
|
||||
|
||||
void fx_object_to_string(const struct _fx_object *p, fx_stream *out)
|
||||
{
|
||||
FX_CLASS_DISPATCH_VIRTUAL_V(fx_object, FX_TYPE_OBJECT, to_string, p, out);
|
||||
fx_stream_write_fmt(out, NULL, "<%s@%p>", p->obj_type->r_info->t_name, p);
|
||||
FX_CLASS_DISPATCH_VIRTUAL_V(
|
||||
fx_object,
|
||||
FX_TYPE_OBJECT,
|
||||
to_string,
|
||||
p,
|
||||
out);
|
||||
fx_stream_write_fmt(
|
||||
out,
|
||||
NULL,
|
||||
"<%s@%p>",
|
||||
p->obj_type->r_info->t_name,
|
||||
p);
|
||||
}
|
||||
|
||||
bool fx_object_is_type(const struct _fx_object *p, fx_type type)
|
||||
@@ -143,7 +154,10 @@ void *fx_object_get_interface(const struct _fx_object *object, fx_type type)
|
||||
}
|
||||
|
||||
enum fx_status fx_object_get_data(
|
||||
const struct _fx_object *object, fx_type type, void **priv, void **prot,
|
||||
const struct _fx_object *object,
|
||||
fx_type type,
|
||||
void **priv,
|
||||
void **prot,
|
||||
void **iface)
|
||||
{
|
||||
if (!object) {
|
||||
|
||||
Reference in New Issue
Block a user