summaryrefslogtreecommitdiff
path: root/types.h
diff options
context:
space:
mode:
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)