summaryrefslogtreecommitdiffstats
path: root/contrib/gperf/src/options.icc
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/gperf/src/options.icc')
-rw-r--r--contrib/gperf/src/options.icc190
1 files changed, 82 insertions, 108 deletions
diff --git a/contrib/gperf/src/options.icc b/contrib/gperf/src/options.icc
index 82fe537..4188ddc 100644
--- a/contrib/gperf/src/options.icc
+++ b/contrib/gperf/src/options.icc
@@ -1,183 +1,157 @@
/* Inline Functions for options.{h,cc}.
- Copyright (C) 1989-1998, 2000 Free Software Foundation, Inc.
- written by Douglas C. Schmidt (schmidt@ics.uci.edu)
+ Copyright (C) 1989-1998, 2000, 2002-2004 Free Software Foundation, Inc.
+ Written by Douglas C. Schmidt <schmidt@ics.uci.edu>
+ and Bruno Haible <bruno@clisp.org>.
-This file is part of GNU GPERF.
+ 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 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 2, 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.
+ 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. */
+ You should have received a copy of the GNU General Public License
+ along with this program; see the file COPYING.
+ If not, write to the Free Software Foundation, Inc.,
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
-// This needs:
-//#include "trace.h"
+/* ----------------------------- Class Options ----------------------------- */
-/* TRUE if option enable, else FALSE. */
-INLINE int
-Options::operator[] (Option_Type option)
+/* Tests a given boolean option. Returns true if set, false otherwise. */
+INLINE bool
+Options::operator[] (Option_Type option) const
{
- T (Trace t ("Options::operator[]");)
- return option_word & option;
+ return _option_word & option;
}
-/* Enables option OPT. */
+/* Sets a given boolean option. */
INLINE void
-Options::operator = (enum Option_Type opt)
+Options::set (Option_Type option)
{
- T (Trace t ("Options::operator=");)
- option_word |= opt;
+ _option_word |= option;
}
-/* Disables option OPT. */
-INLINE void
-Options::operator != (enum Option_Type opt)
+/* Returns the input file name. */
+INLINE const char *
+Options::get_input_file_name () const
{
- T (Trace t ("Options::operator!=");)
- option_word &= ~opt;
+ return _input_file_name;
}
-/* Initializes the key Iterator. */
-INLINE void
-Options::reset (void)
+/* Returns the output file name. */
+INLINE const char *
+Options::get_output_file_name () const
{
- T (Trace t ("Options::reset");)
- key_pos = 0;
+ return _output_file_name;
}
-/* Returns current key_position and advance index. */
+/* Returns the jump value. */
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)
+Options::get_jump () const
{
- T (Trace t ("Options::set_asso_max");)
- size = r;
+ return _jump;
}
-/* Returns the size of the table size. */
+/* Returns the initial associated character value. */
INLINE int
-Options::get_asso_max (void)
+Options::get_initial_asso_value () const
{
- T (Trace t ("Options::get_asso_max");)
- return size;
+ return _initial_asso_value;
}
-/* Returns total distinct key positions. */
+/* Returns the number of iterations for finding finding good asso_values. */
INLINE int
-Options::get_max_keysig_size (void)
+Options::get_asso_iterations () const
{
- T (Trace t ("Options::get_max_keysig_size");)
- return total_keysig_size;
+ return _asso_iterations;
}
-/* Sets total distinct key positions. */
-INLINE void
-Options::set_keysig_size (int size)
+/* Returns the total number of switch statements to generate. */
+INLINE int
+Options::get_total_switches () const
{
- T (Trace t ("Options::set_keysig_size");)
- total_keysig_size = size;
+ return _total_switches;
}
-/* Returns the jump value. */
-INLINE int
-Options::get_jump (void)
+/* Returns the factor by which to multiply the generated table's size. */
+INLINE float
+Options::get_size_multiple () const
{
- T (Trace t ("Options::get_jump");)
- return jump;
+ return _size_multiple;
}
-/* Returns the generated function name. */
+/* Returns the generated function name. */
INLINE const char *
-Options::get_function_name (void)
+Options::get_function_name () const
{
- T (Trace t ("Options::get_function_name");)
- return function_name;
+ return _function_name;
}
-/* Returns the keyword key name. */
+/* Returns the keyword key name. */
INLINE const char *
-Options::get_key_name (void)
+Options::get_slot_name () const
{
- T (Trace t ("Options::get_key_name");)
- return key_name;
+ return _slot_name;
}
-/* Returns the struct initializer suffix. */
+/* Returns the struct initializer suffix. */
INLINE const char *
-Options::get_initializer_suffix (void)
+Options::get_initializer_suffix () const
{
- T (Trace t ("Options::get_initializer_suffix");)
- return initializer_suffix;
+ return _initializer_suffix;
}
-/* Returns the hash function name. */
+/* Returns the generated class name. */
INLINE const char *
-Options::get_hash_name (void)
+Options::get_class_name () const
{
- T (Trace t ("Options::get_hash_name");)
- return hash_name;
+ return _class_name;
}
-/* Returns the hash table array name. */
+/* Returns the hash function name. */
INLINE const char *
-Options::get_wordlist_name (void)
+Options::get_hash_name () const
{
- T (Trace t ("Options::get_wordlist_name");)
- return wordlist_name;
+ return _hash_name;
}
-/* Returns the generated class name. */
+/* Returns the hash table array name. */
INLINE const char *
-Options::get_class_name (void)
+Options::get_wordlist_name () const
{
- T (Trace t ("Options::get_class_name");)
- return class_name;
+ return _wordlist_name;
}
-/* Returns the initial associated character value. */
-INLINE int
-Options::initial_value (void)
+/* Returns the length table array name. */
+INLINE const char *
+Options::get_lengthtable_name () const
{
- T (Trace t ("Options::initial_value");)
- return initial_asso_value;
+ return _lengthtable_name;
}
-/* Returns the iterations value. */
-INLINE int
-Options::get_iterations (void)
+/* Returns the string pool name. */
+INLINE const char *
+Options::get_stringpool_name () const
{
- T (Trace t ("Options::get_iterations");)
- return iterations;
+ return _stringpool_name;
}
-/* Returns the string used to delimit keywords from other attributes. */
+/* Returns the string used to delimit keywords from other attributes. */
INLINE const char *
-Options::get_delimiter ()
+Options::get_delimiters () const
{
- T (Trace t ("Options::get_delimiter");)
- return delimiters;
+ return _delimiters;
}
-/* Gets the total number of switch statements to generate. */
-INLINE int
-Options::get_total_switches ()
+/* Returns key positions. */
+INLINE const Positions&
+Options::get_key_positions () const
{
- T (Trace t ("Options::get_total_switches");)
- return total_switches;
+ return _key_positions;
}
OpenPOWER on IntegriCloud