2005-04-28 07:55:55 +00:00
|
|
|
/*
|
|
|
|
* DO NOT EDIT
|
|
|
|
* $FreeBSD$
|
2008-03-12 14:51:47 +00:00
|
|
|
* auto-generated from FreeBSD: src/usr.bin/make/parse.c,v 1.114 2008/03/12 14:50:58 obrien Exp
|
2005-04-28 07:55:55 +00:00
|
|
|
* DO NOT EDIT
|
|
|
|
*/
|
|
|
|
#include <sys/types.h>
|
|
|
|
|
2005-04-29 15:15:28 +00:00
|
|
|
#include "hash_tables.h"
|
2005-04-28 07:55:55 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
* d=2
|
2005-09-26 20:31:00 +00:00
|
|
|
* n=40
|
|
|
|
* m=19
|
2005-04-28 07:55:55 +00:00
|
|
|
* c=2.09
|
|
|
|
* maxlen=1
|
|
|
|
* minklen=2
|
|
|
|
* maxklen=9
|
|
|
|
* minchar=97
|
|
|
|
* maxchar=119
|
|
|
|
* loop=0
|
2005-09-26 20:31:00 +00:00
|
|
|
* numiter=1
|
2005-04-28 07:55:55 +00:00
|
|
|
* seed=
|
|
|
|
*/
|
|
|
|
|
|
|
|
static const signed char directive_g[] = {
|
2005-09-26 20:31:00 +00:00
|
|
|
8, 0, 0, 5, 6, -1, 17, 15, 10, 6,
|
|
|
|
-1, -1, 10, 0, 0, -1, 18, 2, 3, 0,
|
|
|
|
7, -1, -1, -1, 0, 14, -1, -1, 11, 16,
|
|
|
|
-1, -1, 0, -1, 0, 0, 17, 0, -1, 1,
|
2005-04-28 07:55:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const u_char directive_T0[] = {
|
2005-09-26 20:31:00 +00:00
|
|
|
26, 14, 19, 35, 10, 34, 18, 27, 1, 17,
|
|
|
|
22, 37, 12, 12, 36, 21, 0, 6, 1, 25,
|
|
|
|
9, 4, 19,
|
2005-04-28 07:55:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const u_char directive_T1[] = {
|
2005-09-26 20:31:00 +00:00
|
|
|
25, 22, 19, 0, 2, 18, 33, 18, 30, 4,
|
|
|
|
30, 9, 21, 19, 16, 12, 35, 34, 4, 19,
|
|
|
|
9, 33, 16,
|
2005-04-28 07:55:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
directive_hash(const u_char *key, size_t len)
|
|
|
|
{
|
|
|
|
unsigned f0, f1;
|
|
|
|
const u_char *kp = key;
|
|
|
|
|
|
|
|
if (len < 2 || len > 9)
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
for (f0=f1=0; kp < key + len; ++kp) {
|
|
|
|
if (*kp < 97 || *kp > 119)
|
|
|
|
return -1;
|
|
|
|
f0 += directive_T0[-97 + *kp];
|
|
|
|
f1 += directive_T1[-97 + *kp];
|
|
|
|
}
|
|
|
|
|
2005-09-26 20:31:00 +00:00
|
|
|
f0 %= 40;
|
|
|
|
f1 %= 40;
|
2005-04-28 07:55:55 +00:00
|
|
|
|
2005-09-26 20:31:00 +00:00
|
|
|
return (directive_g[f0] + directive_g[f1]) % 19;
|
2005-04-28 07:55:55 +00:00
|
|
|
}
|
2005-04-28 12:05:43 +00:00
|
|
|
/*
|
|
|
|
* d=2
|
2008-03-12 14:51:47 +00:00
|
|
|
* n=74
|
|
|
|
* m=35
|
2005-04-28 12:05:43 +00:00
|
|
|
* c=2.09
|
|
|
|
* maxlen=1
|
|
|
|
* minklen=4
|
2008-03-12 14:51:47 +00:00
|
|
|
* maxklen=13
|
2005-04-28 12:05:43 +00:00
|
|
|
* minchar=46
|
|
|
|
* maxchar=95
|
|
|
|
* loop=0
|
2005-05-06 18:30:06 +00:00
|
|
|
* numiter=4
|
2005-04-28 12:05:43 +00:00
|
|
|
* seed=
|
|
|
|
*/
|
|
|
|
|
|
|
|
static const signed char keyword_g[] = {
|
2008-03-12 14:51:47 +00:00
|
|
|
12, 18, 7, 25, 30, 5, -1, -1, -1, 7,
|
|
|
|
-1, 0, 33, 0, 4, -1, -1, 13, 29, 0,
|
|
|
|
-1, 28, -1, 28, -1, 0, -1, 27, 4, 34,
|
|
|
|
-1, -1, -1, 30, 13, 10, -1, -1, 0, 10,
|
|
|
|
24, -1, -1, -1, 0, 6, 0, 0, -1, 23,
|
|
|
|
-1, -1, -1, 0, -1, 23, -1, -1, 19, 4,
|
|
|
|
-1, 31, 12, 16, -1, 20, 22, 9, 0, -1,
|
|
|
|
-1, 9, 4, 0,
|
2005-04-28 12:05:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const u_char keyword_T0[] = {
|
2008-03-12 14:51:47 +00:00
|
|
|
34, 28, 50, 61, 14, 57, 48, 60, 20, 67,
|
|
|
|
60, 63, 0, 24, 28, 2, 49, 64, 18, 23,
|
|
|
|
36, 33, 40, 14, 38, 42, 71, 49, 2, 53,
|
|
|
|
53, 37, 7, 29, 24, 21, 12, 50, 59, 10,
|
|
|
|
43, 23, 0, 44, 47, 6, 46, 22, 48, 64,
|
2005-04-28 12:05:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
static const u_char keyword_T1[] = {
|
2008-03-12 14:51:47 +00:00
|
|
|
18, 67, 39, 60, 7, 70, 2, 26, 31, 18,
|
|
|
|
73, 47, 61, 17, 38, 50, 22, 52, 13, 55,
|
|
|
|
56, 32, 63, 4, 64, 55, 49, 21, 47, 67,
|
|
|
|
33, 66, 60, 73, 30, 68, 69, 32, 72, 4,
|
|
|
|
28, 49, 51, 15, 66, 68, 43, 67, 46, 56,
|
2005-04-28 12:05:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
keyword_hash(const u_char *key, size_t len)
|
|
|
|
{
|
|
|
|
unsigned f0, f1;
|
|
|
|
const u_char *kp = key;
|
|
|
|
|
2008-03-12 14:51:47 +00:00
|
|
|
if (len < 4 || len > 13)
|
2005-04-28 12:05:43 +00:00
|
|
|
return -1;
|
|
|
|
|
|
|
|
for (f0=f1=0; *kp; ++kp) {
|
|
|
|
if (*kp < 46 || *kp > 95)
|
|
|
|
return -1;
|
|
|
|
f0 += keyword_T0[-46 + *kp];
|
|
|
|
f1 += keyword_T1[-46 + *kp];
|
|
|
|
}
|
|
|
|
|
2008-03-12 14:51:47 +00:00
|
|
|
f0 %= 74;
|
|
|
|
f1 %= 74;
|
2005-04-28 12:05:43 +00:00
|
|
|
|
2008-03-12 14:51:47 +00:00
|
|
|
return (keyword_g[f0] + keyword_g[f1]) % 35;
|
2005-04-28 12:05:43 +00:00
|
|
|
}
|