options.icc revision 67064
158551Skris/* Inline Functions for options.{h,cc}. 258551Skris 367064Sobrien Copyright (C) 1989-1998, 2000 Free Software Foundation, Inc. 458551Skris written by Douglas C. Schmidt (schmidt@ics.uci.edu) 558551Skris 658551SkrisThis file is part of GNU GPERF. 758551Skris 858551SkrisGNU GPERF is free software; you can redistribute it and/or modify 958551Skrisit under the terms of the GNU General Public License as published by 1058551Skristhe Free Software Foundation; either version 1, or (at your option) 1158551Skrisany later version. 1258551Skris 1358551SkrisGNU GPERF is distributed in the hope that it will be useful, 1458551Skrisbut WITHOUT ANY WARRANTY; without even the implied warranty of 1558551SkrisMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1658551SkrisGNU General Public License for more details. 1758551Skris 1858551SkrisYou should have received a copy of the GNU General Public License 1958551Skrisalong with GNU GPERF; see the file COPYING. If not, write to the Free 2058551SkrisSoftware Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ 2158551Skris 2258551Skris// This needs: 2358551Skris//#include "trace.h" 2458551Skris 2558551Skris/* TRUE if option enable, else FALSE. */ 2658551SkrisINLINE int 2758551SkrisOptions::operator[] (Option_Type option) 2858551Skris{ 2958551Skris T (Trace t ("Options::operator[]");) 3058551Skris return option_word & option; 3158551Skris} 3258551Skris 3358551Skris/* Enables option OPT. */ 3458551SkrisINLINE void 3558551SkrisOptions::operator = (enum Option_Type opt) 3658551Skris{ 3758551Skris T (Trace t ("Options::operator=");) 3858551Skris option_word |= opt; 3958551Skris} 4058551Skris 4158551Skris/* Disables option OPT. */ 4258551SkrisINLINE void 4358551SkrisOptions::operator != (enum Option_Type opt) 4458551Skris{ 4558551Skris T (Trace t ("Options::operator!=");) 4658551Skris option_word &= ~opt; 4758551Skris} 4858551Skris 4958551Skris/* Initializes the key Iterator. */ 5058551SkrisINLINE void 5158551SkrisOptions::reset (void) 5258551Skris{ 5358551Skris T (Trace t ("Options::reset");) 5458551Skris key_pos = 0; 5558551Skris} 5658551Skris 5758551Skris/* Returns current key_position and advance index. */ 5858551SkrisINLINE int 5958551SkrisOptions::get (void) 6058551Skris{ 6158551Skris T (Trace t ("Options::get");) 6258551Skris return key_positions[key_pos++]; 6358551Skris} 6458551Skris 6558551Skris/* Sets the size of the table size. */ 6658551SkrisINLINE void 6758551SkrisOptions::set_asso_max (int r) 6858551Skris{ 6958551Skris T (Trace t ("Options::set_asso_max");) 7058551Skris size = r; 7158551Skris} 7258551Skris 7358551Skris/* Returns the size of the table size. */ 7458551SkrisINLINE int 7558551SkrisOptions::get_asso_max (void) 7658551Skris{ 7758551Skris T (Trace t ("Options::get_asso_max");) 7858551Skris return size; 7958551Skris} 8058551Skris 8158551Skris/* Returns total distinct key positions. */ 8258551SkrisINLINE int 8358551SkrisOptions::get_max_keysig_size (void) 8458551Skris{ 8558551Skris T (Trace t ("Options::get_max_keysig_size");) 8658551Skris return total_keysig_size; 8758551Skris} 8858551Skris 8958551Skris/* Sets total distinct key positions. */ 9058551SkrisINLINE void 9158551SkrisOptions::set_keysig_size (int size) 9258551Skris{ 9358551Skris T (Trace t ("Options::set_keysig_size");) 9458551Skris total_keysig_size = size; 9558551Skris} 9658551Skris 9758551Skris/* Returns the jump value. */ 9858551SkrisINLINE int 9958551SkrisOptions::get_jump (void) 10058551Skris{ 10158551Skris T (Trace t ("Options::get_jump");) 10258551Skris return jump; 10358551Skris} 10458551Skris 10558551Skris/* Returns the generated function name. */ 10658551SkrisINLINE const char * 10758551SkrisOptions::get_function_name (void) 10858551Skris{ 10958551Skris T (Trace t ("Options::get_function_name");) 11058551Skris return function_name; 11158551Skris} 11258551Skris 11358551Skris/* Returns the keyword key name. */ 11458551SkrisINLINE const char * 11558551SkrisOptions::get_key_name (void) 11658551Skris{ 11758551Skris T (Trace t ("Options::get_key_name");) 11858551Skris return key_name; 11958551Skris} 12058551Skris 12167064Sobrien/* Returns the struct initializer suffix. */ 12267064SobrienINLINE const char * 12367064SobrienOptions::get_initializer_suffix (void) 12467064Sobrien{ 12567064Sobrien T (Trace t ("Options::get_initializer_suffix");) 12667064Sobrien return initializer_suffix; 12767064Sobrien} 12867064Sobrien 12958551Skris/* Returns the hash function name. */ 13058551SkrisINLINE const char * 13158551SkrisOptions::get_hash_name (void) 13258551Skris{ 13358551Skris T (Trace t ("Options::get_hash_name");) 13458551Skris return hash_name; 13558551Skris} 13658551Skris 13758551Skris/* Returns the hash table array name. */ 13858551SkrisINLINE const char * 13958551SkrisOptions::get_wordlist_name (void) 14058551Skris{ 14158551Skris T (Trace t ("Options::get_wordlist_name");) 14258551Skris return wordlist_name; 14358551Skris} 14458551Skris 14558551Skris/* Returns the generated class name. */ 14658551SkrisINLINE const char * 14758551SkrisOptions::get_class_name (void) 14858551Skris{ 14958551Skris T (Trace t ("Options::get_class_name");) 15058551Skris return class_name; 15158551Skris} 15258551Skris 15358551Skris/* Returns the initial associated character value. */ 15458551SkrisINLINE int 15558551SkrisOptions::initial_value (void) 15658551Skris{ 15758551Skris T (Trace t ("Options::initial_value");) 15858551Skris return initial_asso_value; 15958551Skris} 16058551Skris 16158551Skris/* Returns the iterations value. */ 16258551SkrisINLINE int 16358551SkrisOptions::get_iterations (void) 16458551Skris{ 16558551Skris T (Trace t ("Options::get_iterations");) 16658551Skris return iterations; 16758551Skris} 16858551Skris 16958551Skris/* Returns the string used to delimit keywords from other attributes. */ 17058551SkrisINLINE const char * 17158551SkrisOptions::get_delimiter () 17258551Skris{ 17358551Skris T (Trace t ("Options::get_delimiter");) 17458551Skris return delimiters; 17558551Skris} 17658551Skris 17758551Skris/* Gets the total number of switch statements to generate. */ 17858551SkrisINLINE int 17958551SkrisOptions::get_total_switches () 18058551Skris{ 18158551Skris T (Trace t ("Options::get_total_switches");) 18258551Skris return total_switches; 18358551Skris} 184