diff options
Diffstat (limited to 'include/stc/cstack.h')
| -rw-r--r-- | include/stc/cstack.h | 50 |
1 files changed, 25 insertions, 25 deletions
diff --git a/include/stc/cstack.h b/include/stc/cstack.h index d6b1b3ad..30fc4f71 100644 --- a/include/stc/cstack.h +++ b/include/stc/cstack.h @@ -47,36 +47,36 @@ #include "cvec.h"
#define using_cstack(X, ctype) \
- _c_using_cstack(cstack_##X, ctype)
+ _c_using_cstack(cstack_##X, ctype)
-#define _c_using_cstack(CX, ctype) \
- typedef ctype CX; \
- typedef ctype##_value_t CX##_value_t; \
- typedef ctype##_rawvalue_t CX##_rawvalue_t; \
- typedef ctype##_iter_t CX##_iter_t; \
+#define _c_using_cstack(Self, ctype) \
+ typedef ctype Self; \
+ typedef ctype##_value_t cx_value_t; \
+ typedef ctype##_rawvalue_t cx_rawvalue_t; \
+ typedef ctype##_iter_t cx_iter_t; \
\
- STC_INLINE CX CX##_init(void) {return ctype##_init();} \
- STC_INLINE CX CX##_clone(CX st) {return ctype##_clone(st);} \
- STC_INLINE CX##_value_t CX##_value_clone(CX##_value_t val) \
- {return ctype##_value_clone(val);} \
- STC_INLINE void CX##_clear(CX* self) {ctype##_clear(self);} \
- STC_INLINE void CX##_del(CX* self) {ctype##_del(self);} \
+ STC_INLINE Self cx_memb(_init)(void) { return ctype##_init(); } \
+ STC_INLINE Self cx_memb(_clone)(Self st) { return ctype##_clone(st); } \
+ STC_INLINE cx_value_t cx_memb(_value_clone)(cx_value_t val) \
+ { return ctype##_value_clone(val); } \
+ STC_INLINE void cx_memb(_clear)(Self* self) {ctype##_clear(self); } \
+ STC_INLINE void cx_memb(_del)(Self* self) {ctype##_del(self); } \
\
- STC_INLINE size_t CX##_size(CX st) {return ctype##_size(st);} \
- STC_INLINE bool CX##_empty(CX st) {return ctype##_empty(st);} \
- STC_INLINE CX##_value_t* CX##_top(const CX* self) {return ctype##_back(self);} \
+ STC_INLINE size_t cx_memb(_size)(Self st) { return ctype##_size(st); } \
+ STC_INLINE bool cx_memb(_empty)(Self st) { return ctype##_empty(st); } \
+ STC_INLINE cx_value_t* cx_memb(_top)(const Self* self) { return ctype##_back(self); } \
\
- STC_INLINE void CX##_pop(CX* self) {ctype##_pop_back(self);} \
- STC_INLINE void CX##_push(CX* self, ctype##_value_t value) \
- {ctype##_push_back(self, value);} \
- STC_INLINE void CX##_emplace(CX* self, CX##_rawvalue_t raw) \
- {ctype##_emplace_back(self, raw);} \
- STC_INLINE void CX##_emplace_items(CX *self, const CX##_rawvalue_t arr[], size_t n) \
- {ctype##_emplace_items(self, arr, n);} \
+ STC_INLINE void cx_memb(_pop)(Self* self) {ctype##_pop_back(self); } \
+ STC_INLINE void cx_memb(_push)(Self* self, ctype##_value_t value) \
+ {ctype##_push_back(self, value); } \
+ STC_INLINE void cx_memb(_emplace)(Self* self, cx_rawvalue_t raw) \
+ {ctype##_emplace_back(self, raw); } \
+ STC_INLINE void cx_memb(_emplace_items)(Self *self, const cx_rawvalue_t arr[], size_t n) \
+ {ctype##_emplace_items(self, arr, n); } \
\
- STC_INLINE CX##_iter_t CX##_begin(const CX* self) {return ctype##_begin(self);} \
- STC_INLINE CX##_iter_t CX##_end(const CX* self) {return ctype##_end(self);} \
- STC_INLINE void CX##_next(CX##_iter_t* it) {ctype##_next(it);} \
+ STC_INLINE cx_iter_t cx_memb(_begin)(const Self* self) { return ctype##_begin(self); } \
+ STC_INLINE cx_iter_t cx_memb(_end)(const Self* self) { return ctype##_end(self); } \
+ STC_INLINE void cx_memb(_next)(cx_iter_t* it) {ctype##_next(it); } \
struct stc_trailing_semicolon
#endif
|
