Initial import from FreeBSD RELENG_4:
[dragonfly.git] / contrib / gperf / src / options.icc
1 /* Inline Functions for options.{h,cc}.
2
3    Copyright (C) 1989-1998, 2000 Free Software Foundation, Inc.
4    written by Douglas C. Schmidt (schmidt@ics.uci.edu)
5
6 This file is part of GNU GPERF.
7
8 GNU GPERF is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 1, or (at your option)
11 any later version.
12
13 GNU GPERF is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 GNU General Public License for more details.
17
18 You should have received a copy of the GNU General Public License
19 along with GNU GPERF; see the file COPYING.  If not, write to the Free
20 Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA.  */
21
22 // This needs:
23 //#include "trace.h"
24
25 /* TRUE if option enable, else FALSE. */
26 INLINE int
27 Options::operator[] (Option_Type option)
28 {
29   T (Trace t ("Options::operator[]");)
30   return option_word & option;
31 }
32
33 /* Enables option OPT. */
34 INLINE void
35 Options::operator = (enum Option_Type opt)
36 {
37   T (Trace t ("Options::operator=");)
38   option_word |= opt;
39 }
40
41 /* Disables option OPT. */
42 INLINE void
43 Options::operator != (enum Option_Type opt)
44 {
45   T (Trace t ("Options::operator!=");)
46   option_word &= ~opt;
47 }
48
49 /* Initializes the key Iterator. */
50 INLINE void
51 Options::reset (void)
52 {
53   T (Trace t ("Options::reset");)
54   key_pos = 0;
55 }
56
57 /* Returns current key_position and advance index. */
58 INLINE int
59 Options::get (void)
60 {
61   T (Trace t ("Options::get");)
62   return key_positions[key_pos++];
63 }
64
65 /* Sets the size of the table size. */
66 INLINE void
67 Options::set_asso_max (int r)
68 {
69   T (Trace t ("Options::set_asso_max");)
70   size = r;
71 }
72
73 /* Returns the size of the table size. */
74 INLINE int
75 Options::get_asso_max (void)
76 {
77   T (Trace t ("Options::get_asso_max");)
78   return size;
79 }
80
81 /* Returns total distinct key positions. */
82 INLINE int
83 Options::get_max_keysig_size (void)
84 {
85   T (Trace t ("Options::get_max_keysig_size");)
86   return total_keysig_size;
87 }
88
89 /* Sets total distinct key positions. */
90 INLINE void
91 Options::set_keysig_size (int size)
92 {
93   T (Trace t ("Options::set_keysig_size");)
94   total_keysig_size = size;
95 }
96
97 /* Returns the jump value. */
98 INLINE int
99 Options::get_jump (void)
100 {
101   T (Trace t ("Options::get_jump");)
102   return jump;
103 }
104
105 /* Returns the generated function name. */
106 INLINE const char *
107 Options::get_function_name (void)
108 {
109   T (Trace t ("Options::get_function_name");)
110   return function_name;
111 }
112
113 /* Returns the keyword key name. */
114 INLINE const char *
115 Options::get_key_name (void)
116 {
117   T (Trace t ("Options::get_key_name");)
118   return key_name;
119 }
120
121 /* Returns the struct initializer suffix. */
122 INLINE const char *
123 Options::get_initializer_suffix (void)
124 {
125   T (Trace t ("Options::get_initializer_suffix");)
126   return initializer_suffix;
127 }
128
129 /* Returns the hash function name. */
130 INLINE const char *
131 Options::get_hash_name (void)
132 {
133   T (Trace t ("Options::get_hash_name");)
134   return hash_name;
135 }
136
137 /* Returns the hash table array name. */
138 INLINE const char *
139 Options::get_wordlist_name (void)
140 {
141   T (Trace t ("Options::get_wordlist_name");)
142   return wordlist_name;
143 }
144
145 /* Returns the generated class name. */
146 INLINE const char *
147 Options::get_class_name (void)
148 {
149   T (Trace t ("Options::get_class_name");)
150   return class_name;
151 }
152
153 /* Returns the initial associated character value. */
154 INLINE int
155 Options::initial_value (void)
156 {
157   T (Trace t ("Options::initial_value");)
158   return initial_asso_value;
159 }
160
161 /* Returns the iterations value. */
162 INLINE int
163 Options::get_iterations (void)
164 {
165   T (Trace t ("Options::get_iterations");)
166   return iterations;
167 }
168
169 /* Returns the string used to delimit keywords from other attributes. */
170 INLINE const char *
171 Options::get_delimiter ()
172 {
173   T (Trace t ("Options::get_delimiter");)
174   return delimiters;
175 }
176
177 /* Gets the total number of switch statements to generate. */
178 INLINE int
179 Options::get_total_switches ()
180 {
181   T (Trace t ("Options::get_total_switches");)
182   return total_switches;
183 }