Macros | |
| #define | MIR_OPTIONAL_FN_TYPE(name) mir_OFN_##name##_t |
| #define | MIR_DECLARE_OPTIONAL_FN(ret, name, args) typedef ret (MIR_OPTIONAL_FN_TYPE(name)) args |
| #define | MIR_REGISTER_OPTIONAL_FN(name, error) |
| #define | MIR_DEREGISTER_OPTIONAL_FN(name) mir_optfn_deregister(#name); |
| #define | MIR_RETRIEVE_OPTIONAL_FN(name) (MIR_OPTIONAL_FN_TYPE(name) *)mir_optfn_retrieve(#name) |
Typedefs | |
| typedef void() | mir_opt_fn_t(void) |
Functions | |
| mirkl_error_t * | mir_optfn_register (const char *szName, mir_opt_fn_t *pfn) |
| void | mir_optfn_deregister (const char *szName) |
| mir_opt_fn_t * | mir_optfn_retrieve (const char *szName) |
| #define MIR_DECLARE_OPTIONAL_FN | ( | ret, | |
| name, | |||
| args | |||
| ) | typedef ret (MIR_OPTIONAL_FN_TYPE(name)) args |
Declare an optional function.
| ret | The return type of the function |
| name | The name of the function |
| args | The function arguments (including brackets) |
| #define MIR_OPTIONAL_FN_TYPE | ( | name | ) | mir_OFN_##name##_t |
The type of an optional function.
| name | The name of the function |
| #define MIR_REGISTER_OPTIONAL_FN | ( | name, | |
| error | |||
| ) |
Register an optional function. This can be later retrieved, type-safely, by name. Like all global functions, the name must be unique. Note that, confusingly but correctly, the function itself can be static!
| name | The name of the function |
| #define MIR_RETRIEVE_OPTIONAL_FN | ( | name | ) | (MIR_OPTIONAL_FN_TYPE(name) *)mir_optfn_retrieve(#name) |
Retrieve an optional function. Returns NULL if the function is not present.
| name | The name of the function |
| typedef void() mir_opt_fn_t(void) |
Private function! DO NOT USE!