summaryrefslogtreecommitdiff
path: root/tests/permut2.exp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/permut2.exp')
-rw-r--r--tests/permut2.exp86
1 files changed, 86 insertions, 0 deletions
diff --git a/tests/permut2.exp b/tests/permut2.exp
new file mode 100644
index 0000000..1ab17d3
--- /dev/null
+++ b/tests/permut2.exp
@@ -0,0 +1,86 @@
+/* C code produced by gperf version 2.7.2 */
+/* Command-line: ../src/gperf -m5 */
+/* Computed positions: -k'1-2' */
+
+#define TOTAL_KEYWORDS 4
+#define MIN_WORD_LENGTH 2
+#define MAX_WORD_LENGTH 2
+#define MIN_HASH_VALUE 2
+#define MAX_HASH_VALUE 5
+/* maximum key range = 4, duplicates = 0 */
+
+#ifdef __GNUC__
+__inline
+#else
+#ifdef __cplusplus
+inline
+#endif
+#endif
+static unsigned int
+hash (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static unsigned char asso_values[] =
+ {
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 0, 1, 0, 3, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6, 6, 6, 6,
+ 6, 6, 6, 6, 6, 6, 6
+ };
+ return len + asso_values[(unsigned char)str[1]+1] + asso_values[(unsigned char)str[0]];
+}
+
+#ifdef __GNUC__
+__inline
+#endif
+const char *
+in_word_set (str, len)
+ register const char *str;
+ register unsigned int len;
+{
+ static const char * wordlist[] =
+ {
+ "", "",
+ "xy",
+ "zx",
+ "yx",
+ "xz"
+ };
+
+ if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
+ {
+ register int key = hash (str, len);
+
+ if (key <= MAX_HASH_VALUE && key >= 0)
+ {
+ register const char *s = wordlist[key];
+
+ if (*str == *s && !strcmp (str + 1, s + 1))
+ return s;
+ }
+ }
+ return 0;
+}