diff options
Diffstat (limited to 'xs.h')
| -rw-r--r-- | xs.h | 3 |
1 files changed, 3 insertions, 0 deletions
| @@ -157,6 +157,9 @@ unsigned int xs_hash_func(const char *data, int size); | |||
| 157 | #define xs_is_true(v) (xs_type((v)) == XSTYPE_TRUE) | 157 | #define xs_is_true(v) (xs_type((v)) == XSTYPE_TRUE) |
| 158 | #define xs_is_false(v) (xs_type((v)) == XSTYPE_FALSE) | 158 | #define xs_is_false(v) (xs_type((v)) == XSTYPE_FALSE) |
| 159 | #define xs_not(v) xs_stock(xs_is_true((v)) ? XSTYPE_FALSE : XSTYPE_TRUE) | 159 | #define xs_not(v) xs_stock(xs_is_true((v)) ? XSTYPE_FALSE : XSTYPE_TRUE) |
| 160 | #define xs_is_string(v) (xs_type((v)) == XSTYPE_STRING) | ||
| 161 | #define xs_is_list(v) (xs_type((v)) == XSTYPE_LIST) | ||
| 162 | #define xs_is_dict(v) (xs_type((v)) == XSTYPE_DICT) | ||
| 160 | 163 | ||
| 161 | #define xs_list_foreach(l, v) for (int ct_##__LINE__ = 0; xs_list_next(l, &v, &ct_##__LINE__); ) | 164 | #define xs_list_foreach(l, v) for (int ct_##__LINE__ = 0; xs_list_next(l, &v, &ct_##__LINE__); ) |
| 162 | #define xs_dict_foreach(l, k, v) for (int ct_##__LINE__ = 0; xs_dict_next(l, &k, &v, &ct_##__LINE__); ) | 165 | #define xs_dict_foreach(l, k, v) for (int ct_##__LINE__ = 0; xs_dict_next(l, &k, &v, &ct_##__LINE__); ) |