59#define COMPS_OBJECT_CREATE(objtype, args)\
60 (objtype*)comps_object_create(&objtype##_ObjInfo, args)
63#define COMPS_OBJECT_CMP(obj1,obj2)\
64 comps_object_cmp((COMPS_Object*)obj1, (COMPS_Object*)obj2)
66#define COMPS_OBJECT_DESTROY(obj1)\
67 comps_object_destroy((COMPS_Object*)obj1)
69#define COMPS_OBJECT_COPY(obj)\
70 comps_object_copy(((COMPS_Object*)obj))
72#define COMPS_OBJECT_INCREF(obj)\
73 comps_object_incref(((COMPS_Object*)obj))
75#define COMPS_OBJECT_REPLACE(oldobj, TYPE, new_obj)\
76 COMPS_OBJECT_DESTROY(oldobj);\
77 oldobj = (TYPE*)COMPS_OBJECT_INCREF(new_obj);
80#define COMPS_CAST_CONSTR void (*)(COMPS_Object*, COMPS_Object**)
81#define COMPS_CAST_DESTR void (*)(COMPS_Object*)
86#define COMPS_Object_HEAD COMPS_RefC *refc;\
87 COMPS_ObjectInfo *obj_info
89#define COMPS_Object_TAIL(obj) extern COMPS_ObjectInfo obj##_ObjInfo
93typedef struct COMPS_Packed COMPS_Packed;
164void comps_object_destroy_v(
void *comps_obj);
185char comps_object_cmp_v(
void *obj1,
void *obj2);
COMPS memory management(reference counter) file.
#define COMPS_Object_HEAD
Definition comps_obj.h:86
COMPS_Num * comps_num(int n)
signed char comps_object_cmp(COMPS_Object *obj1, COMPS_Object *obj2)
void comps_object_destroy(COMPS_Object *comps_obj)
signed char comps_str_fnmatch_o(COMPS_Str *str, COMPS_Str *pattern, int flags)
COMPS_Object * comps_object_create(COMPS_ObjectInfo *obj_info, COMPS_Object **args)
signed char comps_str_fnmatch(COMPS_Str *str, char *pattern, int flags)
COMPS_Str * comps_str_x(char *s)
#define COMPS_Object_TAIL(obj)
insert "extern COMPS_ObjectInfo <obj>_ObjInfo" statement. Use this macro in combination with COMPS_OB...
Definition comps_obj.h:89
char * comps_object_tostr(COMPS_Object *obj1)
COMPS_Object * comps_object_copy(COMPS_Object *comps_obj)
void comps_str_set(COMPS_Str *str, char *s)
COMPS_Object * comps_object_incref(COMPS_Object *obj)
COMPS_Str * comps_str(const char *s)
Definition comps_obj.h:133
int val
Definition comps_obj.h:135
Definition comps_obj.h:102
signed char(* obj_cmp)(COMPS_Object *, COMPS_Object *)
Definition comps_obj.h:112
void(* copy)(COMPS_Object *, COMPS_Object *)
Definition comps_obj.h:108
void(* constructor)(COMPS_Object *, COMPS_Object **)
Definition comps_obj.h:104
size_t obj_size
Definition comps_obj.h:103
void(* destructor)(COMPS_Object *)
Definition comps_obj.h:106
Definition comps_obj.h:124
COMPS_RefC * refc
Definition comps_obj.h:125
COMPS_ObjectInfo * obj_info
Definition comps_obj.h:126
Definition comps_obj.h:143
char * val
Definition comps_obj.h:145