summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
authorTest_User <hax@andrewyu.org>2023-08-09 23:40:58 -0400
committerTest_User <hax@andrewyu.org>2023-08-09 23:40:58 -0400
commitffc06e4614772a681114d4059a072f599ee378f8 (patch)
treeb19699cf499e66c056104e7192fe00f01d583931 /types.h
parentbe4a88382717cb297d7aefadedb32d5f9c41ffb1 (diff)
downloadcoupserv-ffc06e4614772a681114d4059a072f599ee378f8.tar.gz
coupserv-ffc06e4614772a681114d4059a072f599ee378f8.zip
STRING_EQ
Diffstat (limited to 'types.h')
-rw-r--r--types.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/types.h b/types.h
index 2251bcc..b403ec9 100644
--- a/types.h
+++ b/types.h
@@ -38,4 +38,7 @@ struct string {
#define STRING(x) (struct string){x, sizeof(x)-1}
#define NULSTR(x) (struct string){x, strlen(x)}
+
+#define STRING_EQ(x, y) (x.len == y.len && memcmp(x.data, y.data, x.len) == 0)
+
#define WRITES(x, y) write(x, y.data, y.len)