define STREQ, STRNEQ, STREQLEN, STRCASEQ, etc.
[libguestfs.git] / daemon / daemon.h
index 8912840..3f4c480 100644 (file)
@@ -234,4 +234,14 @@ extern void reply (xdrproc_t xdrp, char *ret);
 # define ATTRIBUTE_UNUSED __attribute__ ((__unused__))
 #endif
 
+#define STREQ(a,b) (strcmp((a),(b)) == 0)
+#define STRCASEEQ(a,b) (strcasecmp((a),(b)) == 0)
+#define STRNEQ(a,b) (strcmp((a),(b)) != 0)
+#define STRCASENEQ(a,b) (strcasecmp((a),(b)) != 0)
+#define STREQLEN(a,b,n) (strncmp((a),(b),(n)) == 0)
+#define STRCASEEQLEN(a,b,n) (strncasecmp((a),(b),(n)) == 0)
+#define STRNEQLEN(a,b,n) (strncmp((a),(b),(n)) != 0)
+#define STRCASENEQLEN(a,b,n) (strncasecmp((a),(b),(n)) != 0)
+#define STRPREFIX(a,b) (strncmp((a),(b),strlen((b))) == 0)
+
 #endif /* GUESTFSD_DAEMON_H */