options.icc revision 285830
1266989Smarkj/* Inline Functions for options.{h,cc}.
2266989Smarkj
3266989Smarkj   Copyright (C) 1989-1998, 2000, 2002-2004 Free Software Foundation, Inc.
4266989Smarkj   Written by Douglas C. Schmidt <schmidt@ics.uci.edu>
5266989Smarkj   and Bruno Haible <bruno@clisp.org>.
6266989Smarkj
7266989Smarkj   This file is part of GNU GPERF.
8266989Smarkj
9266989Smarkj   GNU GPERF is free software; you can redistribute it and/or modify
10266989Smarkj   it under the terms of the GNU General Public License as published by
11266989Smarkj   the Free Software Foundation; either version 2, or (at your option)
12266989Smarkj   any later version.
13266989Smarkj
14266989Smarkj   GNU GPERF is distributed in the hope that it will be useful,
15266989Smarkj   but WITHOUT ANY WARRANTY; without even the implied warranty of
16266989Smarkj   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17266989Smarkj   GNU General Public License for more details.
18266989Smarkj
19266989Smarkj   You should have received a copy of the GNU General Public License
20266989Smarkj   along with this program; see the file COPYING.
21266989Smarkj   If not, write to the Free Software Foundation, Inc.,
22266989Smarkj   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
23266989Smarkj
24266989Smarkj/* ----------------------------- Class Options ----------------------------- */
25266989Smarkj
26266989Smarkj/* Tests a given boolean option.  Returns true if set, false otherwise.  */
27266989SmarkjINLINE bool
28266989SmarkjOptions::operator[] (Option_Type option) const
29266989Smarkj{
30266989Smarkj  return _option_word & option;
31266989Smarkj}
32266989Smarkj
33266989Smarkj/* Sets a given boolean option.  */
34266989SmarkjINLINE void
35266989SmarkjOptions::set (Option_Type option)
36266989Smarkj{
37266989Smarkj  _option_word |= option;
38266989Smarkj}
39266989Smarkj
40266989Smarkj/* Returns the input file name.  */
41266989SmarkjINLINE const char *
42266989SmarkjOptions::get_input_file_name () const
43266989Smarkj{
44266989Smarkj  return _input_file_name;
45266989Smarkj}
46266989Smarkj
47266989Smarkj/* Returns the output file name.  */
48266989SmarkjINLINE const char *
49266989SmarkjOptions::get_output_file_name () const
50266989Smarkj{
51266989Smarkj  return _output_file_name;
52266989Smarkj}
53266989Smarkj
54266989Smarkj/* Returns the jump value.  */
55266989SmarkjINLINE int
56266989SmarkjOptions::get_jump () const
57266989Smarkj{
58266989Smarkj  return _jump;
59266989Smarkj}
60266989Smarkj
61266989Smarkj/* Returns the initial associated character value.  */
62266989SmarkjINLINE int
63266989SmarkjOptions::get_initial_asso_value () const
64266989Smarkj{
65266989Smarkj  return _initial_asso_value;
66266989Smarkj}
67266989Smarkj
68266989Smarkj/* Returns the number of iterations for finding finding good asso_values.  */
69266989SmarkjINLINE int
70266989SmarkjOptions::get_asso_iterations () const
71266989Smarkj{
72266989Smarkj  return _asso_iterations;
73266989Smarkj}
74266989Smarkj
75266989Smarkj/* Returns the total number of switch statements to generate.  */
76266989SmarkjINLINE int
77266989SmarkjOptions::get_total_switches () const
78266989Smarkj{
79266989Smarkj  return _total_switches;
80}
81
82/* Returns the factor by which to multiply the generated table's size.  */
83INLINE float
84Options::get_size_multiple () const
85{
86  return _size_multiple;
87}
88
89/* Returns the generated function name.  */
90INLINE const char *
91Options::get_function_name () const
92{
93  return _function_name;
94}
95
96/* Returns the keyword key name.  */
97INLINE const char *
98Options::get_slot_name () const
99{
100  return _slot_name;
101}
102
103/* Returns the struct initializer suffix.  */
104INLINE const char *
105Options::get_initializer_suffix () const
106{
107  return _initializer_suffix;
108}
109
110/* Returns the generated class name.  */
111INLINE const char *
112Options::get_class_name () const
113{
114  return _class_name;
115}
116
117/* Returns the hash function name.  */
118INLINE const char *
119Options::get_hash_name () const
120{
121  return _hash_name;
122}
123
124/* Returns the hash table array name.  */
125INLINE const char *
126Options::get_wordlist_name () const
127{
128  return _wordlist_name;
129}
130
131/* Returns the length table array name.  */
132INLINE const char *
133Options::get_lengthtable_name () const
134{
135  return _lengthtable_name;
136}
137
138/* Returns the string pool name.  */
139INLINE const char *
140Options::get_stringpool_name () const
141{
142  return _stringpool_name;
143}
144
145/* Returns the string used to delimit keywords from other attributes.  */
146INLINE const char *
147Options::get_delimiters () const
148{
149  return _delimiters;
150}
151
152/* Returns key positions.  */
153INLINE const Positions&
154Options::get_key_positions () const
155{
156  return _key_positions;
157}
158