diff options
| author | default <nobody@localhost> | 2025-01-12 14:59:28 +0100 |
|---|---|---|
| committer | default <nobody@localhost> | 2025-01-12 14:59:28 +0100 |
| commit | 5aaa6192ef08de7ab6c63e85708a1c825e9ff5f1 (patch) | |
| tree | 768411ed56c9df88dbcfa113e54c4e596fb06db6 /xs.h | |
| parent | 6d0b0cdaab829c8c0d98b0f3cdc5d3526f1c5662 (diff) | |
Better dangling hashtag checking.
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); #define xs_is_true(v) (xs_type((v)) == XSTYPE_TRUE) #define xs_is_false(v) (xs_type((v)) == XSTYPE_FALSE) #define xs_not(v) xs_stock(xs_is_true((v)) ? XSTYPE_FALSE : XSTYPE_TRUE) +#define xs_is_string(v) (xs_type((v)) == XSTYPE_STRING) +#define xs_is_list(v) (xs_type((v)) == XSTYPE_LIST) +#define xs_is_dict(v) (xs_type((v)) == XSTYPE_DICT) #define xs_list_foreach(l, v) for (int ct_##__LINE__ = 0; xs_list_next(l, &v, &ct_##__LINE__); ) #define xs_dict_foreach(l, k, v) for (int ct_##__LINE__ = 0; xs_dict_next(l, &k, &v, &ct_##__LINE__); ) |