Describes naming of user defined Ansi C types.
C-Types | Describes naming of user defined Ansi C types. |
List of Types | The following list shows the suffixes of a type name and on the right side what kind of type this suffix stands for. |
Enum Example | |
Struct & Function Pointer Example | |
Interface Example | The structure log_it defines the function table, i.e. |
The following list shows the suffixes of a type name and on the right side what kind of type this suffix stands for.
Name&suffix | Description |
typename_t | struct or primitive type Special structs like struct log_t { void * object; log_it * iimpl } ; which describes an (interfaceable object) object with associated interface use also the suffix _t (formerly _iot). |
typename_f | function pointer type |
typename_e | enum type |
typename_it | interface type |
The structure log_it defines the function table, i.e. the interface.
The structure log_t defines a pointer to an imlementation object, which can be manipulated by this kind of interface and a pointer to an implementation of that interface.
struct log_it { void (*printf) (void * log, const char * format, ... ) __attribute__ ((__format__ (__printf__, 2, 3))) ; \ void (*flushbuffer) (void * log) ; \ void (*clearbuffer) (void * log) ; \ void (*getbuffer) (void * log, /*out*/char ** buffer, /*out*/size_t * size) ; \ } ; struct log_ot { void * object ; log_it * iimpl ; } ;
The function table which describes the log service.
struct log_it
Uses iobj_DECLARE to declare object supporting interface log_it.
iobj_DECLARE( log_t, log )