]> thyrsus.com Git - comparator.git/commitdiff
Initial revision
authorEric S. Raymond <esr@thyrsus.com>
Sun, 31 Aug 2003 09:22:49 +0000 (09:22 +0000)
committerEric S. Raymond <esr@thyrsus.com>
Sun, 31 Aug 2003 09:22:49 +0000 (09:22 +0000)
shred.h [new file with mode: 0644]

diff --git a/shred.h b/shred.h
new file mode 100644 (file)
index 0000000..b845389
--- /dev/null
+++ b/shred.h
@@ -0,0 +1,24 @@
+/* shred.h -- types for shred similarity tools */
+
+/*
+ * 65,536 lines should be enough, but maybe someday this will be 32 bits.
+ * The point of making it a short is that the data sets can get quite large.
+ */
+typedef u_int16_t      linenum_t;
+#define TONET          htons
+#define FROMNET                ntohs
+
+/*
+ * The code depends on the assumption that this structure has 
+ * no leading, trailing, or internal padding. This should be the 
+ * case on all modern 8-bit-byte, byte-addressible machines,
+ * whether 32 or 64 bit.
+ */
+#define HASHSIZE       16
+struct hash_t
+{
+    linenum_t  start, end;
+    char       hash[HASHSIZE];
+};
+
+/* shred.h ends here */