COMPS_Object header file.
More...
Go to the source code of this file.
COMPS_Object header file.
#define COMPS_OBJECT_CREATE |
( |
|
objtype, |
|
|
|
args |
|
) |
| (objtype*)comps_object_create(&objtype##_ObjInfo, args) |
macro for create object by choosen type without explicit needs of typecast. Macro returns concrete type of object not COMPS_Object type. If you want use this macro, you have to declare COMPS_ObjectInfo object exactly as <YourObject>_ObjInfo
- See Also
- COMPS_Object_TAIL
#define COMPS_Object_HEAD |
Value:
COMPS_ObjectInfo *obj_info
Definition: comps_mm.h:36
ensure that COMPS_Object derivate has need struct members for properly behaviour
insert "extern COMPS_ObjectInfo <obj>_ObjInfo" statement. Use this macro in combination with COMPS_OBJECT_CREATE
- See Also
- COMPS_OBJECT_CREATE
Directly construct COMPS_Num derivate from passed argument
- Parameters
-
Compare two COMPS_Object derivates and return non-zero value if equals
- Warning
- Function doen't check equality of derivate types (COMPS_ObjectInfo)!!
- Parameters
-
obj1 | first derivate |
obj2 | second derivate |
- Returns
- non-zero value if equals, zero otherwise
Return whole new copy of COMPS_Object derivate.
Function create new allocation of derivate and call obj_copy callback with old instance and new instance of derivate. Copying inner structure members are in programmers care
- Parameters
-
comps_obj | derivate object want to be copied |
- Returns
- new copy of derivate object
- See Also
- COMPS_ObjectInfo
Create COMPS_Object derivate and pass args arguments to its constructor
- Parameters
-
obj_info | pointer to COMPS_ObjectInfo structure |
args | array of arguments passed to derivate constructor. Array doesn't have to end with NULL sentinel. Processing args attribute passed to contructor is completely in programmer's care |
- Returns
- COMPS_Object derivate typecasted as general COMPS_Object
Destroy passed COMPS_Object derivate if its reference counter is zero if not, only decrement reference counter
Return string representation of COMPS_Object derivate
- Warning
- Returned string is new allocation which needs to be freed manualy
- Parameters
-
- Returns
- new alllocation of string representation of concrete object
Directly construct COMPS_Str derivate from passed argument
passed argument is copied as new allocation
- Parameters
-
s | string value of derivate |
signed char comps_str_fnmatch |
( |
COMPS_Str * |
str, |
|
|
char * |
pattern, |
|
|
int |
flags |
|
) |
| |
Return non-zero if str match the pattern by fnmatch
- Parameters
-
str | source string. COMPS_Str object |
pattern | match pattern |
Return non-zero if str match the pattern by fnmatch
- Parameters
-
void comps_str_set |
( |
COMPS_Str * |
str, |
|
|
char * |
s |
|
) |
| |
Set memory copy of passed argument as COMPS_Str value
- Parameters
-
Directly construct COMPS_Str derivate from passed argument
- Warning
- passed argument is not copied. COMPS_Str derivate use same memory place as s argument and during destruction of derivate this memory place is freed
- Parameters
-
s | string value of derivate |