aboutsummaryrefslogtreecommitdiffstats
path: root/src/options.icc
blob: 82fe5375c23fe751f23b63384adc6fdb7efc582d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
/* Inline Functions for options.{h,cc}.

   Copyright (C) 1989-1998, 2000 Free Software Foundation, Inc.
   written by Douglas C. Schmidt (schmidt@ics.uci.edu)

This file is part of GNU GPERF.

GNU GPERF is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 1, or (at your option)
any later version.

GNU GPERF is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with GNU GPERF; see the file COPYING.  If not, write to the Free
Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA.  */

// This needs:
//#include "trace.h"

/* TRUE if option enable, else FALSE. */
INLINE int
Options::operator[] (Option_Type option)
{
  T (Trace t ("Options::operator[]");)
  return option_word & option;
}

/* Enables option OPT. */
INLINE void
Options::operator = (enum Option_Type opt)
{
  T (Trace t ("Options::operator=");)
  option_word |= opt;
}

/* Disables option OPT. */
INLINE void
Options::operator != (enum Option_Type opt)
{
  T (Trace t ("Options::operator!=");)
  option_word &= ~opt;
}

/* Initializes the key Iterator. */
INLINE void
Options::reset (void)
{
  T (Trace t ("Options::reset");)
  key_pos = 0;
}

/* Returns current key_position and advance index. */
INLINE int
Options::get (void)
{
  T (Trace t ("Options::get");)
  return key_positions[key_pos++];
}

/* Sets the size of the table size. */
INLINE void
Options::set_asso_max (int r)
{
  T (Trace t ("Options::set_asso_max");)
  size = r;
}

/* Returns the size of the table size. */
INLINE int
Options::get_asso_max (void)
{
  T (Trace t ("Options::get_asso_max");)
  return size;
}

/* Returns total distinct key positions. */
INLINE int
Options::get_max_keysig_size (void)
{
  T (Trace t ("Options::get_max_keysig_size");)
  return total_keysig_size;
}

/* Sets total distinct key positions. */
INLINE void
Options::set_keysig_size (int size)
{
  T (Trace t ("Options::set_keysig_size");)
  total_keysig_size = size;
}

/* Returns the jump value. */
INLINE int
Options::get_jump (void)
{
  T (Trace t ("Options::get_jump");)
  return jump;
}

/* Returns the generated function name. */
INLINE const char *
Options::get_function_name (void)
{
  T (Trace t ("Options::get_function_name");)
  return function_name;
}

/* Returns the keyword key name. */
INLINE const char *
Options::get_key_name (void)
{
  T (Trace t ("Options::get_key_name");)
  return key_name;
}

/* Returns the struct initializer suffix. */
INLINE const char *
Options::get_initializer_suffix (void)
{
  T (Trace t ("Options::get_initializer_suffix");)
  return initializer_suffix;
}

/* Returns the hash function name. */
INLINE const char *
Options::get_hash_name (void)
{
  T (Trace t ("Options::get_hash_name");)
  return hash_name;
}

/* Returns the hash table array name. */
INLINE const char *
Options::get_wordlist_name (void)
{
  T (Trace t ("Options::get_wordlist_name");)
  return wordlist_name;
}

/* Returns the generated class name. */
INLINE const char *
Options::get_class_name (void)
{
  T (Trace t ("Options::get_class_name");)
  return class_name;
}

/* Returns the initial associated character value. */
INLINE int
Options::initial_value (void)
{
  T (Trace t ("Options::initial_value");)
  return initial_asso_value;
}

/* Returns the iterations value. */
INLINE int
Options::get_iterations (void)
{
  T (Trace t ("Options::get_iterations");)
  return iterations;
}

/* Returns the string used to delimit keywords from other attributes. */
INLINE const char *
Options::get_delimiter ()
{
  T (Trace t ("Options::get_delimiter");)
  return delimiters;
}

/* Gets the total number of switch statements to generate. */
INLINE int
Options::get_total_switches ()
{
  T (Trace t ("Options::get_total_switches");)
  return total_switches;
}