Clean up and document API for hashes
[p5sagit/p5-mst-13.2.git] / handy.h
diff --git a/handy.h b/handy.h
index b6350a9..efb4f03 100644 (file)
--- a/handy.h
+++ b/handy.h
    standard library calls (where we pass an I32 and the library is
    expecting an int), but the disadvantage that an I32 is not 32 bits.
    Andy Dougherty      August 1996
+
+   In the future, we may perhaps want to think about something like
+    #if INTSIZE == 4
+       typedef I32 int;
+    #else
+    #  if LONGSIZE == 4
+           typedef I32 long;
+    #  else
+    #    if SHORTSIZE == 4
+           typedef I32 short;
+    #    else
+           typedef I32 int;
+    #    endif
+    #  endif
+    #endif
+   For the moment, these are mentioned here so metaconfig will
+   construct Configure to figure out the various sizes.
 */
 
 typedef char           I8;
@@ -124,6 +141,14 @@ typedef unsigned short     U16;
 #define strnNE(s1,s2,l) (strncmp(s1,s2,l))
 #define strnEQ(s1,s2,l) (!strncmp(s1,s2,l))
 
+#ifdef HAS_MEMCMP
+#  define memNE(s1,s2,l) (memcmp(s1,s2,l))
+#  define memEQ(s1,s2,l) (!memcmp(s1,s2,l))
+#else
+#  define memNE(s1,s2,l) (bcmp(s1,s2,l))
+#  define memEQ(s1,s2,l) (!bcmp(s1,s2,l))
+#endif
+
 /*
  * Character classes.
  *