options.icc revision 58551
1/* Inline Functions for options.{h,cc}. 2 3 Copyright (C) 1989-1998 Free Software Foundation, Inc. 4 written by Douglas C. Schmidt (schmidt@ics.uci.edu) 5 6This file is part of GNU GPERF. 7 8GNU GPERF is free software; you can redistribute it and/or modify 9it under the terms of the GNU General Public License as published by 10the Free Software Foundation; either version 1, or (at your option) 11any later version. 12 13GNU GPERF is distributed in the hope that it will be useful, 14but WITHOUT ANY WARRANTY; without even the implied warranty of 15MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16GNU General Public License for more details. 17 18You should have received a copy of the GNU General Public License 19along with GNU GPERF; see the file COPYING. If not, write to the Free 20Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111, USA. */ 21 22// This needs: 23//#include "trace.h" 24 25/* TRUE if option enable, else FALSE. */ 26INLINE int 27Options::operator[] (Option_Type option) 28{ 29 T (Trace t ("Options::operator[]");) 30 return option_word & option; 31} 32 33/* Enables option OPT. */ 34INLINE void 35Options::operator = (enum Option_Type opt) 36{ 37 T (Trace t ("Options::operator=");) 38 option_word |= opt; 39} 40 41/* Disables option OPT. */ 42INLINE void 43Options::operator != (enum Option_Type opt) 44{ 45 T (Trace t ("Options::operator!=");) 46 option_word &= ~opt; 47} 48 49/* Initializes the key Iterator. */ 50INLINE void 51Options::reset (void) 52{ 53 T (Trace t ("Options::reset");) 54 key_pos = 0; 55} 56 57/* Returns current key_position and advance index. */ 58INLINE int 59Options::get (void) 60{ 61 T (Trace t ("Options::get");) 62 return key_positions[key_pos++]; 63} 64 65/* Sets the size of the table size. */ 66INLINE void 67Options::set_asso_max (int r) 68{ 69 T (Trace t ("Options::set_asso_max");) 70 size = r; 71} 72 73/* Returns the size of the table size. */ 74INLINE int 75Options::get_asso_max (void) 76{ 77 T (Trace t ("Options::get_asso_max");) 78 return size; 79} 80 81/* Returns total distinct key positions. */ 82INLINE int 83Options::get_max_keysig_size (void) 84{ 85 T (Trace t ("Options::get_max_keysig_size");) 86 return total_keysig_size; 87} 88 89/* Sets total distinct key positions. */ 90INLINE void 91Options::set_keysig_size (int size) 92{ 93 T (Trace t ("Options::set_keysig_size");) 94 total_keysig_size = size; 95} 96 97/* Returns the jump value. */ 98INLINE int 99Options::get_jump (void) 100{ 101 T (Trace t ("Options::get_jump");) 102 return jump; 103} 104 105/* Returns the generated function name. */ 106INLINE const char * 107Options::get_function_name (void) 108{ 109 T (Trace t ("Options::get_function_name");) 110 return function_name; 111} 112 113/* Returns the keyword key name. */ 114INLINE const char * 115Options::get_key_name (void) 116{ 117 T (Trace t ("Options::get_key_name");) 118 return key_name; 119} 120 121/* Returns the hash function name. */ 122INLINE const char * 123Options::get_hash_name (void) 124{ 125 T (Trace t ("Options::get_hash_name");) 126 return hash_name; 127} 128 129/* Returns the hash table array name. */ 130INLINE const char * 131Options::get_wordlist_name (void) 132{ 133 T (Trace t ("Options::get_wordlist_name");) 134 return wordlist_name; 135} 136 137/* Returns the generated class name. */ 138INLINE const char * 139Options::get_class_name (void) 140{ 141 T (Trace t ("Options::get_class_name");) 142 return class_name; 143} 144 145/* Returns the initial associated character value. */ 146INLINE int 147Options::initial_value (void) 148{ 149 T (Trace t ("Options::initial_value");) 150 return initial_asso_value; 151} 152 153/* Returns the iterations value. */ 154INLINE int 155Options::get_iterations (void) 156{ 157 T (Trace t ("Options::get_iterations");) 158 return iterations; 159} 160 161/* Returns the string used to delimit keywords from other attributes. */ 162INLINE const char * 163Options::get_delimiter () 164{ 165 T (Trace t ("Options::get_delimiter");) 166 return delimiters; 167} 168 169/* Gets the total number of switch statements to generate. */ 170INLINE int 171Options::get_total_switches () 172{ 173 T (Trace t ("Options::get_total_switches");) 174 return total_switches; 175} 176