From ffc06e4614772a681114d4059a072f599ee378f8 Mon Sep 17 00:00:00 2001 From: Test_User Date: Wed, 9 Aug 2023 23:40:58 -0400 Subject: STRING_EQ --- types.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'types.h') 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) -- cgit v1.2.3