summaryrefslogtreecommitdiff
path: root/xs.h
diff options
context:
space:
mode:
authorGravatar default2025-01-12 14:59:28 +0100
committerGravatar default2025-01-12 14:59:28 +0100
commit5aaa6192ef08de7ab6c63e85708a1c825e9ff5f1 (patch)
tree768411ed56c9df88dbcfa113e54c4e596fb06db6 /xs.h
parentShow event start / end times. (diff)
downloadsnac2-5aaa6192ef08de7ab6c63e85708a1c825e9ff5f1.tar.gz
snac2-5aaa6192ef08de7ab6c63e85708a1c825e9ff5f1.tar.xz
snac2-5aaa6192ef08de7ab6c63e85708a1c825e9ff5f1.zip
Better dangling hashtag checking.
Diffstat (limited to 'xs.h')
-rw-r--r--xs.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/xs.h b/xs.h
index 2a90467..45952c9 100644
--- a/xs.h
+++ b/xs.h
@@ -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__); )