1 #ifndef GPERF_KEYWORD_C
2 #define GPERF_KEYWORD_C
4 /*------------------------------------------------------------------------------------------------*/
5 #include "namespace/keyword.h"
6 #include "namespace/positions.h"
7 /*------------------------------------------------------------------------------------------------*/
9 static u8
*empty_string
= "";
10 /*}}} globals -- END */
11 /*------------------------------------------------------------------------------------------------*/
13 static void sort_char_set(u32
*base
, s32 len
);
15 /*------------------------------------------------------------------------------------------------*/
16 /*{{{ Keyword class */
17 /*{{{ constants and types */
19 /*----------------------------------------------------------------------------------------*/
20 /* data members defined immediately by the input file */
21 /* the keyword as a string, possibly containing NUL bytes */
24 /* additional stuff seen on the same line of the input file */
26 /* line number of this keyword in the input file */
28 /*----------------------------------------------------------------------------------------*/
29 /* Ext: data members depending on the keyposition list */
31 * the selected characters that participate for the hash function,
32 * selected according to the keyposition list, as a canonically
38 * Chained list of keywords having the same _selchars and
39 * - if !option[NOLENGTH] - also the same _allchars_length.
40 * Note that these duplicates are not members of the main keyword list
42 struct Keyword
*duplicate_link
;
43 /* data members used by the algorithm */
44 s32 hash_value
; /* hash value for the keyword */
45 /* data members used by the output routines */
48 /*}}} constants and types -- END */
49 /*{{{ private static methods */
50 static u32
*kw_init_selchars_low(struct Keyword
*t
, struct Positions
*positions
, u32
*alpha_unify
,
52 /*}}} private static methods */
53 /*{{{ public static methods */
54 static struct Keyword
*kw_new(u8
*allchars
, s32 allchars_length
, u8
*rest
, u32 lineno
);
55 /* methods depending on the keyposition list */
56 static void kw_init_selchars_tuple(struct Keyword
*t
, struct Positions
*positions
,
58 static void kw_init_selchars_multiset(struct Keyword
*t
, struct Positions
*positions
,
59 u32
*alpha_unify
, u32
*alpha_inc
);
60 static void kw_delete_selchars(struct Keyword
*t
);
61 /*}}} public static methods -- END */
62 /*}}} Keyword class -- END */
64 #include "namespace/keyword.h"
65 #include "namespace/positions.h"
67 /*------------------------------------------------------------------------------------------------*/