Deploy the new <ctype.h> and `foocmp' macros from mLib.
[catacomb] / key / pixie-common.c
index 2975c20..d3348bc 100644 (file)
@@ -44,6 +44,7 @@
 
 #include <mLib/alloc.h>
 #include <mLib/dstr.h>
+#include <mLib/macros.h>
 #include <mLib/str.h>
 
 #include "pixie.h"
@@ -283,11 +284,11 @@ again:
   p = buf;
   if ((q = str_getword(&p)) == 0)
     return (-1);
-  if (strcmp(q, "INFO") == 0)
+  if (STRCMP(q, ==, "INFO"))
     goto again;
-  else if (strcmp(q, "MISSING") == 0)
+  else if (STRCMP(q, ==, "MISSING"))
     return (+1);
-  else if (strcmp(q, "OK") != 0)
+  else if (STRCMP(q, !=, "OK"))
     return (-1);
 
   /* --- Return the final answer --- */
@@ -336,7 +337,7 @@ void pixie_set(int fd, const char *tag, const char *phrase)
 again:
   pixie_fdline(fd, buf, sizeof(buf));
   p = buf;
-  if ((q = str_getword(&p)) != 0 && strcmp(q, "INFO") == 0)
+  if ((q = str_getword(&p)) != 0 && STRCMP(q, ==, "INFO"))
     goto again;
 }
 
@@ -367,7 +368,7 @@ void pixie_cancel(int fd, const char *tag)
 again:
   pixie_fdline(fd, buf, sizeof(buf));
   p = buf;
-  if ((q = str_getword(&p)) != 0 && strcmp(q, "INFO") == 0)
+  if ((q = str_getword(&p)) != 0 && STRCMP(q, ==, "INFO"))
     goto again;
 }