20 #ifndef COMPS_OBJECT_H
21 #define COMPS_OBJECT_H
47 #define COMPS_OBJECT_CMP(obj1,obj2)\
48 comps_object_cmp((COMPS_Object*)obj1, (COMPS_Object*)obj2)
50 #define COMPS_OBJECT_DESTROY(obj1)\
51 comps_object_destroy((COMPS_Object*)obj1)
53 #define COMPS_OBJECT_COPY(obj)\
54 comps_object_copy(((COMPS_Object*)obj))
56 #define COMPS_OBJECT_INCREF(obj)\
57 comps_object_incref(((COMPS_Object*)obj))
59 #define COMPS_CAST_CONSTR void (*)(COMPS_Object*, COMPS_Object**)
60 #define COMPS_CAST_DESTR void (*)(COMPS_Object*)
65 #define COMPS_Object_HEAD COMPS_RefC *refc;\
66 COMPS_ObjectInfo *obj_info
70 typedef struct COMPS_Packed COMPS_Packed;
89 signed char (*
obj_cmp)(COMPS_Object*, COMPS_Object*);
91 char* (*to_str)(COMPS_Object*);
139 void comps_object_destroy_v(
void *comps_obj);
160 char comps_object_cmp_v(
void *obj1,
void *obj2);
void comps_object_destroy(COMPS_Object *comps_obj)
void(* copy)(COMPS_Object *, COMPS_Object *)
Definition: comps_obj.h:85
#define COMPS_Object_HEAD
Definition: comps_obj.h:65
COMPS_ObjectInfo * obj_info
Definition: comps_obj.h:103
char * val
Definition: comps_obj.h:121
Definition: comps_obj.h:101
void comps_str_set(COMPS_Str *str, char *s)
char * comps_object_tostr(COMPS_Object *obj1)
COMPS_Object * comps_object_incref(COMPS_Object *obj)
size_t obj_size
Definition: comps_obj.h:80
COMPS_Object * comps_object_create(COMPS_ObjectInfo *obj_info, COMPS_Object **args)
Definition: comps_obj.h:119
int val
Definition: comps_obj.h:112
COMPS_Str * comps_str(const char *s)
Definition: comps_obj.h:110
COMPS_RefC * refc
Definition: comps_obj.h:102
COMPS memory management(reference counter) file.
COMPS_Num * comps_num(int n)
Definition: comps_obj.h:79
void(* destructor)(COMPS_Object *)
Definition: comps_obj.h:83
signed char comps_object_cmp(COMPS_Object *obj1, COMPS_Object *obj2)
COMPS_Str * comps_str_x(char *s)
COMPS_Object * comps_object_copy(COMPS_Object *comps_obj)
void(* constructor)(COMPS_Object *, COMPS_Object **)
Definition: comps_obj.h:81
Definition: comps_mm.h:36
signed char(* obj_cmp)(COMPS_Object *, COMPS_Object *)
Definition: comps_obj.h:89