Loading...
Searching...
No Matches
Macros
as_util.h File Reference
#include <stddef.h>
+ Include dependency graph for as_util.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define as_util_fromval(object, type_id, type)    (object && as_val_type(object) == type_id ? (type *) object : NULL)
 
#define as_util_hook(hook, default, object, ...)    (object && object->hooks && object->hooks->hook ? object->hooks->hook(object, ##__VA_ARGS__) : default)
 
#define as_util_hook_ret_void(hook, object, ...)    if (object && object->hooks && object->hooks->hook) object->hooks->hook(object, ##__VA_ARGS__)
 

Macro Definition Documentation

◆ as_util_fromval

#define as_util_fromval ( object,
type_id,
type )    (object && as_val_type(object) == type_id ? (type *) object : NULL)

Converts from an as_val.

Definition at line 43 of file as_util.h.

◆ as_util_hook

#define as_util_hook ( hook,
default,
object,
... )    (object && object->hooks && object->hooks->hook ? object->hooks->hook(object, ##__VA_ARGS__) : default)

Calls a hook on a object. If hook not found, then return the default value.

Definition at line 34 of file as_util.h.

◆ as_util_hook_ret_void

#define as_util_hook_ret_void ( hook,
object,
... )    if (object && object->hooks && object->hooks->hook) object->hooks->hook(object, ##__VA_ARGS__)

Definition at line 37 of file as_util.h.