1 /* ANSI-C code produced by gperf version 3.0.4 */
4 #if 0 /* gperf build options: */
13 // %define slot-name vtp_name
14 // %define hash-function-name value_type_hash
15 // %define lookup-function-name find_value_type_name
16 // %define word-array-name value_type_table
17 // %define initializer-suffix ,VTP_COUNT_KWD
18 #endif /* gperf build options: */
20 #include "value-type.h"
23 char const * vtp_name
;
24 value_type_enum_t vtp_id
;
28 /* maximum key range = 20, duplicates = 0 */
35 inline static unsigned int
36 value_type_hash (register const char *str
, register unsigned int len
)
38 static const unsigned char asso_values
[] =
40 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
41 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
42 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
43 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
44 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
45 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
46 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
47 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
48 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
49 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
50 23, 10, 23, 23, 23, 23, 23, 23, 23, 23,
51 23, 5, 23, 23, 5, 0, 0, 23, 15, 23,
52 23, 10, 23, 23, 23, 23, 23, 23, 23, 23,
53 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
54 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
55 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
56 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
57 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
58 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
59 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
60 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
61 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
62 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
63 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
64 23, 23, 23, 23, 23, 23, 23, 23, 23, 23,
65 23, 23, 23, 23, 23, 23
67 return len
+ asso_values
[(unsigned char)str
[2]];
70 static const value_type_map_t value_type_table
[] =
72 {"",VTP_COUNT_KWD
}, {"",VTP_COUNT_KWD
},
75 {"",VTP_COUNT_KWD
}, {"",VTP_COUNT_KWD
},
76 {"nested", VTP_KWD_NESTED
},
77 {"integer", VTP_KWD_INTEGER
},
79 {"bool", VTP_KWD_BOOL
},
81 {"string", VTP_KWD_STRING
},
82 {"boolean", VTP_KWD_BOOLEAN
},
84 {"set-membership", VTP_KWD_SET_MEMBERSHIP
},
85 {"",VTP_COUNT_KWD
}, {"",VTP_COUNT_KWD
},
86 {"keyword", VTP_KWD_KEYWORD
},
88 {"hierarchy", VTP_KWD_HIERARCHY
},
89 {"",VTP_COUNT_KWD
}, {"",VTP_COUNT_KWD
},
90 {"invalid", VTP_KWD_INVALID
}
94 #if defined __GNUC_STDC_INLINE__ || defined __GNUC_GNU_INLINE__
95 __attribute__ ((__gnu_inline__
))
98 static inline const value_type_map_t
*
99 find_value_type_name (register const char *str
, register unsigned int len
)
101 if (len
<= 14 && len
>= 3)
103 register int key
= value_type_hash (str
, len
);
105 if (key
<= 22 && key
>= 0)
107 register const char *s
= value_type_table
[key
].vtp_name
;
109 if (*str
== *s
&& !strncmp (str
+ 1, s
+ 1, len
- 1) && s
[len
] == '\0')
110 return &value_type_table
[key
];
118 find_value_type_id(char const * str
, unsigned int len
)
120 const value_type_map_t
* p
=
121 find_value_type_name(str
, len
);
122 return (p
== 0) ? VTP_KWD_INVALID
: p
->vtp_id
;