1
0
mirror of https://git.savannah.gnu.org/git/gperf.git synced 2025-12-02 21:19:24 +00:00

Initial revision

This commit is contained in:
Bruno Haible
2000-08-19 06:20:11 +00:00
commit 501ee3e640
107 changed files with 30411 additions and 0 deletions

175
src/options.icc Normal file
View File

@@ -0,0 +1,175 @@
/* Inline Functions for options.{h,cc}.
Copyright (C) 1989-1998 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 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;
}