Don't export STREQ and friends in <guestfs.h>
[libguestfs.git] / test-tool / test-tool.c
index 8a80f66..93aaca2 100644 (file)
 #define N_(str) str
 #endif
 
 #define N_(str) str
 #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)
+
 #define DEFAULT_TIMEOUT 120
 
 static const char *helper = DEFAULT_HELPER;
 #define DEFAULT_TIMEOUT 120
 
 static const char *helper = DEFAULT_HELPER;
@@ -100,11 +110,11 @@ main (int argc, char *argv[])
 
     switch (c) {
     case 0:                    /* options which are long only */
 
     switch (c) {
     case 0:                    /* options which are long only */
-      if (strcmp (long_options[option_index].name, "helper") == 0)
+      if (STREQ (long_options[option_index].name, "helper"))
         helper = optarg;
         helper = optarg;
-      else if (strcmp (long_options[option_index].name, "qemu") == 0)
+      else if (STREQ (long_options[option_index].name, "qemu"))
         set_qemu (optarg, 0);
         set_qemu (optarg, 0);
-      else if (strcmp (long_options[option_index].name, "qemudir") == 0)
+      else if (STREQ (long_options[option_index].name, "qemudir"))
         set_qemu (optarg, 1);
       else {
         fprintf (stderr,
         set_qemu (optarg, 1);
       else {
         fprintf (stderr,