Lines Matching refs:_name

37 #define DEFINE_FREE(_name, _type, _free) \  argument
38 static inline void __free_##_name(void *p) { _type _T = *(_type *)p; _free; }
40 #define __free(_name) __cleanup(__free_##_name) argument
71 #define DEFINE_CLASS(_name, _type, _exit, _init, _init_args...) \ argument
72 typedef _type class_##_name##_t; \
73 static inline void class_##_name##_destructor(_type *p) \
75 static inline _type class_##_name##_constructor(_init_args) \
78 #define EXTEND_CLASS(_name, ext, _init, _init_args...) \ argument
79 typedef class_##_name##_t class_##_name##ext##_t; \
80 static inline void class_##_name##ext##_destructor(class_##_name##_t *p)\
81 { class_##_name##_destructor(p); } \
82 static inline class_##_name##_t class_##_name##ext##_constructor(_init_args) \
83 { class_##_name##_t t = _init; return t; }
85 #define CLASS(_name, var) \ argument
86 class_##_name##_t var __cleanup(class_##_name##_destructor) = \
87 class_##_name##_constructor
105 #define DEFINE_GUARD(_name, _type, _lock, _unlock) \ argument
106 DEFINE_CLASS(_name, _type, _unlock, ({ _lock; _T; }), _type _T)
108 #define guard(_name) \ argument
109 CLASS(_name, __UNIQUE_ID(guard))
111 #define scoped_guard(_name, args...) \ argument
112 for (CLASS(_name, scope)(args), \
134 #define __DEFINE_UNLOCK_GUARD(_name, _type, _unlock, ...) \ argument
138 } class_##_name##_t; \
140 static inline void class_##_name##_destructor(class_##_name##_t *_T) \
146 #define __DEFINE_LOCK_GUARD_1(_name, _type, _lock) \ argument
147 static inline class_##_name##_t class_##_name##_constructor(_type *l) \
149 class_##_name##_t _t = { .lock = l }, *_T = &_t; \
154 #define __DEFINE_LOCK_GUARD_0(_name, _lock) \ argument
155 static inline class_##_name##_t class_##_name##_constructor(void) \
157 class_##_name##_t _t = { .lock = (void*)1 }, \
163 #define DEFINE_LOCK_GUARD_1(_name, _type, _lock, _unlock, ...) \ argument
164 __DEFINE_UNLOCK_GUARD(_name, _type, _unlock, __VA_ARGS__) \
165 __DEFINE_LOCK_GUARD_1(_name, _type, _lock)
167 #define DEFINE_LOCK_GUARD_0(_name, _lock, _unlock, ...) \ argument
168 __DEFINE_UNLOCK_GUARD(_name, void, _unlock, __VA_ARGS__) \
169 __DEFINE_LOCK_GUARD_0(_name, _lock)