diff options
-rw-r--r-- | src/stroke/stroke_keywords.c | 79 | ||||
-rw-r--r-- | src/stroke/stroke_keywords.txt | 2 |
2 files changed, 34 insertions, 47 deletions
diff --git a/src/stroke/stroke_keywords.c b/src/stroke/stroke_keywords.c index 77c0af939..55693e8fb 100644 --- a/src/stroke/stroke_keywords.c +++ b/src/stroke/stroke_keywords.c @@ -1,6 +1,6 @@ /* C code produced by gperf version 3.0.1 */ /* Command-line: /usr/bin/gperf -C -G -t */ -/* Computed positions: -k'2,4' */ +/* Computed positions: -k'2' */ #if !((' ' == 32) && ('!' == 33) && ('"' == 34) && ('#' == 35) \ && ('%' == 37) && ('&' == 38) && ('\'' == 39) && ('(' == 40) \ @@ -60,8 +60,8 @@ struct stroke_token { #define MIN_WORD_LENGTH 2 #define MAX_WORD_LENGTH 11 #define MIN_HASH_VALUE 2 -#define MAX_HASH_VALUE 36 -/* maximum key range = 35, duplicates = 0 */ +#define MAX_HASH_VALUE 21 +/* maximum key range = 20, duplicates = 0 */ #ifdef __GNUC__ __inline @@ -77,46 +77,34 @@ hash (str, len) { static const unsigned char asso_values[] = { - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 0, 15, 37, 37, 37, 5, 37, 37, 10, 37, - 0, 0, 0, 37, 37, 37, 0, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37, 37, 37, 37, 37, - 37, 37, 37, 37, 37, 37 + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 0, 15, 22, 22, 22, 5, 22, 22, 22, 22, + 22, 0, 0, 22, 22, 22, 0, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, + 22, 22, 22, 22, 22, 22 }; - register int hval = len; - - switch (hval) - { - default: - hval += asso_values[(unsigned char)str[3]]; - /*FALLTHROUGH*/ - case 3: - case 2: - hval += asso_values[(unsigned char)str[1]]; - break; - } - return hval; + return len + asso_values[(unsigned char)str[1]]; } static const struct stroke_token wordlist[] = @@ -128,7 +116,7 @@ static const struct stroke_token wordlist[] = {"route", STROKE_ROUTE}, {"status", STROKE_STATUS}, {"logtype", STROKE_LOGTYPE}, - {""}, + {"loglevel", STROKE_LOGLEVEL}, {"statusall", STROKE_STATUSALL}, {""}, {""}, {"listall", STROKE_LIST_ALL}, @@ -136,10 +124,9 @@ static const struct stroke_token wordlist[] = {"listcerts", STROKE_LIST_CERTS}, {""}, {"listcacerts", STROKE_LIST_CACERTS}, - {"logleve", STROKE_LOGLEVEL}, + {""}, {"del", STROKE_DEL}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, - {""}, {""}, {""}, {""}, {""}, {""}, {""}, {""}, + {""}, {""}, {"delete", STROKE_DELETE} }; diff --git a/src/stroke/stroke_keywords.txt b/src/stroke/stroke_keywords.txt index 4cc461f66..5bd984479 100644 --- a/src/stroke/stroke_keywords.txt +++ b/src/stroke/stroke_keywords.txt @@ -33,7 +33,7 @@ route, STROKE_ROUTE up, STROKE_UP down, STROKE_DOWN logtype, STROKE_LOGTYPE -logleve, STROKE_LOGLEVEL +loglevel, STROKE_LOGLEVEL status, STROKE_STATUS statusall, STROKE_STATUSALL listcerts, STROKE_LIST_CERTS |