4 * Copyright (C) 1989 Free Software Foundation, Inc.
5 * written by Douglas C. Schmidt (d.schmidt@vanderbilt.edu)
7 * This file is part of GNU GPERF.
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License
11 * as published by the Free Software Foundation; either version 2
12 * of the License, or (at your option) any later version.
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 #include "ace/Get_Opt.h"
28 #include "ace/OS_NS_stdio.h"
29 #include "ace/OS_NS_string.h"
30 #include "ace/OS_NS_stdlib.h"
31 #include "ace/Truncate.h"
33 /// These need to appear before the global class instantiation, since
34 /// they are static members with a default constructor that initializes
35 /// an ACE_Allocator needed in the Options class constructor.
36 ACE_CString
Options::function_name_
;
37 ACE_CString
Options::fill_default_
;
38 ACE_CString
Options::key_name_
;
39 ACE_CString
Options::class_name_
;
40 ACE_CString
Options::hash_name_
;
41 ACE_CString
Options::delimiters_
;
43 /// Global option coordinator for the entire program.
46 /// Current program version.
47 extern const char *version_string
;
49 /// Size to jump on a collision.
50 static const int DEFAULT_JUMP_VALUE
= 5;
52 /// Default name for generated lookup function.
53 static const char *const DEFAULT_NAME
= "in_word_set";
55 /// Default filler for keyword table.
56 static const char *const DEFAULT_FILL
= "";
58 /// Default name for the key component.
59 static const char *const DEFAULT_KEY
= "name";
61 /// Default name for the generated class.
62 static const char *const DEFAULT_CLASS_NAME
= "Perfect_Hash";
64 /// Default name for generated hash function.
65 static const char *const DEFAULT_HASH_NAME
= "hash";
67 /// Default delimiters that separate keywords from their attributes.
68 static const char *const DEFAULT_DELIMITERS
= ",\n";
70 int Options::option_word_
;
71 int Options::total_switches_
;
72 u_int
Options::total_keysig_size_
;
74 int Options::key_pos_
;
76 int Options::initial_asso_value_
;
78 ACE_TCHAR
**Options::argv_
;
79 int Options::iterations_
;
80 char Options::key_positions_
[MAX_KEY_POS
];
82 /// Prints program usage to standard error stream.
87 "Usage: %n [-abBcCdDef[num]gGhH<hashname>i<init>IjJ"
88 "k<keys>K<keyname>lL<language>mMnN<function name>o"
89 "Oprs<size>S<switches>tTvVZ<class name>].\n"
90 "(type %n -h for help)\n"));
93 /// Output command-line Options.
95 Options::print_options ()
97 ACE_OS::printf ("/* Command-line: ");
99 ACE_OS::printf ("%s ", ACE_TEXT_ALWAYS_CHAR (ACE::basename (argv_
[0])));
100 for (int i
= 1; i
< argc_
; i
++)
101 ACE_OS::printf ("%s ", ACE_TEXT_ALWAYS_CHAR (argv_
[i
]));
103 ACE_OS::printf ("*/\n");
106 /// Sorts the key positions *IN REVERSE ORDER!!* This makes further
107 /// routines more efficient. Especially when generating code. Uses a
108 /// simple Insertion Sort since the set is probably ordered. Returns 1
109 /// if there are no duplicates, 0 otherwise.
111 Options::key_sort (char *base
, int len
)
115 for (i
= 0, j
= len
- 1; i
< j
; i
++)
120 for (curr
= i
+ 1, tmp
= base
[curr
];
121 curr
> 0 && tmp
>= base
[curr
- 1];
123 if ((base
[curr
] = base
[curr
- 1]) == tmp
)
124 // Oh no, a duplicate!!!
127 base
[curr
] = static_cast<char> (tmp
);
133 // Sets the default Options.
137 key_positions_
[0] = WORD_START
;
138 key_positions_
[1] = WORD_END
;
139 key_positions_
[2] = EOS
;
140 total_keysig_size_
= 2;
141 delimiters_
= DEFAULT_DELIMITERS
;
142 jump_
= DEFAULT_JUMP_VALUE
;
143 option_word_
= DEFAULTCHARS
| C
;
144 function_name_
= DEFAULT_NAME
;
145 fill_default_
= DEFAULT_FILL
;
146 key_name_
= DEFAULT_KEY
;
147 hash_name_
= DEFAULT_HASH_NAME
;
148 class_name_
= DEFAULT_CLASS_NAME
;
149 total_switches_
= size_
= 1;
150 initial_asso_value_
= iterations_
= 0;
153 /// Dumps option status when debug is set.
156 if (ACE_BIT_ENABLED (option_word_
, DEBUGGING
))
160 ACE_OS::fprintf (stderr
,
162 "\nDEBUGGING is...: %s"
163 "\nORDER is.......: %s"
164 "\nANSI is........: %s"
165 "\nTYPE is........: %s"
166 "\nINLINE is......: %s"
167 "\nRANDOM is......: %s"
168 "\nDEFAULTCHARS is: %s"
169 "\nSWITCH is......: %s"
170 "\nPOINTER is.....: %s"
171 "\nNOLENGTH is....: %s"
172 "\nLENTABLE is....: %s"
173 "\nDUP is.........: %s"
174 "\nFAST is........: %s"
175 "\nCOMP is........: %s"
176 "\nNOTYPE is......: %s"
177 "\nGLOBAL is......: %s"
178 "\nCONSTANT is....: %s"
179 "\nCPLUSPLUS is...: %s"
180 "\nC is...........: %s"
181 "\nENUM is........: %s"
182 "\nSTRCASECMP is..: %s"
183 "\nOPTIMIZE is....: %s"
184 "\nLINEARSEARCH is: %s"
185 "\nBINARYSEARCH is: %s"
187 "\nlookup function name = %s"
188 "\nfill default = %s"
189 "\nhash function name = %s"
192 "\nmax associated value = %d"
193 "\ninitial associated value = %d"
195 "\nnumber of switch statements = %d"
197 ACE_BIT_ENABLED (option_word_
, DEBUGGING
) ? "enabled" : "disabled",
198 ACE_BIT_ENABLED (option_word_
, ORDER
) ? "enabled" : "disabled",
199 ACE_BIT_ENABLED (option_word_
, ANSI
) ? "enabled" : "disabled",
200 ACE_BIT_ENABLED (option_word_
, TYPE
) ? "enabled" : "disabled",
201 ACE_BIT_ENABLED (option_word_
, INLINE
) ? "enabled" : "disabled",
202 ACE_BIT_ENABLED (option_word_
, RANDOM
) ? "enabled" : "disabled",
203 ACE_BIT_ENABLED (option_word_
, DEFAULTCHARS
) ? "enabled" : "disabled",
204 ACE_BIT_ENABLED (option_word_
, SWITCH
) ? "enabled" : "disabled",
205 ACE_BIT_ENABLED (option_word_
, POINTER
) ? "enabled" : "disabled",
206 ACE_BIT_ENABLED (option_word_
, NOLENGTH
) ? "enabled" : "disabled",
207 ACE_BIT_ENABLED (option_word_
, LENTABLE
) ? "enabled" : "disabled",
208 ACE_BIT_ENABLED (option_word_
, DUP
) ? "enabled" : "disabled",
209 ACE_BIT_ENABLED (option_word_
, FAST
) ? "enabled" : "disabled",
210 ACE_BIT_ENABLED (option_word_
, COMP
) ? "enabled" : "disabled",
211 ACE_BIT_ENABLED (option_word_
, NOTYPE
) ? "enabled" : "disabled",
212 ACE_BIT_ENABLED (option_word_
, GLOBAL
) ? "enabled" : "disabled",
213 ACE_BIT_ENABLED (option_word_
, CONSTANT
) ? "enabled" : "disabled",
214 ACE_BIT_ENABLED (option_word_
, CPLUSPLUS
) ? "enabled" : "disabled",
215 ACE_BIT_ENABLED (option_word_
, C
) ? "enabled" : "disabled",
216 ACE_BIT_ENABLED (option_word_
, ENUM
) ? "enabled" : "disabled",
217 ACE_BIT_ENABLED (option_word_
, STRCASECMP
) ? "enabled" : "disabled",
218 ACE_BIT_ENABLED (option_word_
, OPTIMIZE
) ? "enabled" : "disabled",
219 ACE_BIT_ENABLED (option_word_
, LINEARSEARCH
) ? "enabled" : "disabled",
220 ACE_BIT_ENABLED (option_word_
, BINARYSEARCH
) ? "enabled" : "disabled",
222 function_name_
.c_str (),
223 fill_default_
.c_str (),
229 delimiters_
.c_str (),
231 if (ACE_BIT_ENABLED (option_word_
, ALLCHARS
))
232 ACE_OS::fprintf (stderr
,
233 "all characters are used in the hash function\n");
235 ACE_OS::fprintf (stderr
,
236 "maximum keysig size = %d\nkey positions are:\n",
239 for (ptr
= key_positions_
; *ptr
!= EOS
; ptr
++)
240 if (*ptr
== WORD_END
)
241 ACE_OS::fprintf (stderr
, "$\n");
243 ACE_OS::fprintf (stderr
, "%d\n", *ptr
);
245 ACE_OS::fprintf (stderr
, "finished dumping Options\n");
249 /// Parses the command line Options and sets appropriate flags in
252 Options::parse_args (int argc
, ACE_TCHAR
*argv
[])
254 if (ACE_LOG_MSG
->open (argv
[0]) == -1)
257 ACE_Get_Opt
get_opt (argc
, argv
, ACE_TEXT("abBcCdDe:Ef:F:gGhH:i:IJj:k:K:lL:mMnN:oOprs:S:tTvVZ:"));
263 while ((option_char
= get_opt ()) != -1)
267 // Generated coded uses the ANSI prototype format.
270 ACE_SET_BITS (option_word_
, ANSI
);
273 // Generate code for Linear Search.
276 ACE_SET_BITS (option_word_
, LINEARSEARCH
);
279 // Generate code for Binary Search.
282 ACE_SET_BITS (option_word_
, BINARYSEARCH
);
285 // Generate strncmp rather than strcmp.
288 ACE_SET_BITS (option_word_
, COMP
);
291 // Make the generated tables readonly (const).
294 ACE_SET_BITS (option_word_
, CONSTANT
);
297 // Enable debugging option.
300 ACE_SET_BITS (option_word_
, DEBUGGING
);
301 ACE_ERROR ((LM_ERROR
,
302 "Starting program %n, version %s, with debugging on.\n",
306 // Enable duplicate option.
309 ACE_SET_BITS (option_word_
, DUP
);
312 // Allows user to provide keyword/attribute separator
315 delimiters_
= ACE_TEXT_ALWAYS_CHAR(get_opt
.opt_arg ());
320 ACE_SET_BITS (option_word_
, ENUM
);
323 // Generate the hash table ``fast.''
326 ACE_SET_BITS (option_word_
, FAST
);
327 iterations_
= ACE_OS::atoi (get_opt
.opt_arg ());
330 ACE_ERROR ((LM_ERROR
, "iterations value must not be negative, assuming 0\n"));
335 // Use the ``inline'' keyword for generated sub-routines.
338 ACE_SET_BITS (option_word_
, INLINE
);
341 // Make the keyword table a global variable.
344 ACE_SET_BITS (option_word_
, GLOBAL
);
347 // Displays a list of helpful Options to the user.
351 ACE_OS::fprintf (stderr
,
352 "-a\tGenerate ANSI standard C output code, i.e., function prototypes.\n"
353 "-b\tGenerate code for Linear Search.\n"
354 "-B\tGenerate code for Binary Search.\n"
355 "-c\tGenerate comparison code using strncmp rather than strcmp.\n"
356 "-C\tMake the contents of generated lookup tables constant, i.e., readonly.\n"
357 "-d\tEnables the debugging option (produces verbose output to the standard\n"
359 "-D\tHandle keywords that hash to duplicate values. This is useful\n"
360 "\tfor certain highly redundant keyword sets.\n"
361 "-e\tAllow user to provide a string containing delimiters used to separate\n"
362 "\tkeywords from their attributes. Default is \",\\n\"\n"
363 "-E\tDefine constant values using an enum local to the lookup function\n"
364 "\trather than with defines\n"
365 "-f\tGenerate the gen-perf.hash function ``fast.'' This decreases GPERF's\n"
366 "\trunning time at the cost of minimizing generated table-size.\n"
367 "\tThe numeric argument represents the number of times to iterate when\n"
368 "\tresolving a collision. `0' means ``iterate by the number of keywords.''\n"
369 "-F\tProvided expression will be used to assign default values in keyword\n"
370 "\ttable, i.e., the fill value. Default is \"\".\n"
371 "-g\tMake generated routines use ``inline'' to remove function overhead.\n"
372 "-G\tGenerate the static table of keywords as a static global variable,\n"
373 "\trather than hiding it inside of the lookup function (which is the\n"
374 "\tdefault behavior).\n"
375 "-h\tPrints this message.\n"
376 "-H\tAllow user to specify name of generated hash function. Default\n"
378 "-i\tProvide an initial value for the associate values array. Default is 0.\n"
379 "-I\tGenerate comparison code using case insensitive string comparison, e.g.,\n"
380 "\tstrncasecmp or strcasecmp.\n"
381 "\tSetting this value larger helps inflate the size of the final table.\n"
382 "-j\tAffects the ``jump value,'' i.e., how far to advance the associated\n"
383 "\tcharacter value upon collisions. Must be an odd number, default is %d.\n"
384 "-J\tSkips '#include \"ace/OS_NS_string.h\"' part in the output.\n"
385 "-k\tAllows selection of the key positions used in the hash function.\n"
386 "\tThe allowable choices range between 1-%d, inclusive. The positions\n"
387 "\tare separated by commas, ranges may be used, and key positions may\n"
388 "\toccur in any order. Also, the meta-character '*' causes the generated\n"
389 "\thash function to consider ALL key positions, and $ indicates the\n"
390 "\t``final character'' of a key, e.g., $,1,2,4,6-10.\n"
391 "-K\tAllow use to select name of the keyword component in the keyword\n"
393 "-l\tCompare key lengths before trying a string comparison. This helps\n"
394 "\tcut down on the number of string comparisons made during the lookup.\n"
395 "-L\tGenerates code in the language specified by the option's argument.\n"
396 "\tLanguages handled are currently C++ and C. The default is C.\n"
397 "-m\tAvoids the warning about identical hash values. This is valid\n"
398 "\tonly if the -D option is enabled.\n"
399 "-M\tSkips class definition in the output. This is valid only in C++ mode.\n"
400 "-n\tDo not include the length of the keyword when computing the hash\n"
402 "-N\tAllow user to specify name of generated lookup function. Default\n"
403 "\tname is `in_word_set.'\n"
404 "-o\tReorders input keys by frequency of occurrence of the key sets.\n"
405 "\tThis should decrease the search time dramatically.\n"
406 "-O\tOptimize the generated lookup function by assuming that all input\n"
407 "\tkeywords are members of the keyset from the keyfile.\n"
408 "-p\tChanges the return value of the generated function ``in_word_set''\n"
409 "\tfrom its default boolean value (i.e., 0 or 1), to type ``pointer\n"
410 "\tto wordlist array'' This is most useful when the -t option, allowing\n"
411 "\tuser-defined structs, is used.\n"
412 "-r\tUtilizes randomness to initialize the associated values table.\n"
413 "-s\tAffects the size of the generated hash table. The numeric argument\n"
414 "\tfor this option indicates ``how many times larger or smaller'' the\n"
415 "\tassociated value range should be, in relationship to the number of\n"
416 "\tkeys, e.g. a value of 3 means ``allow the maximum associated value\n"
417 "\tto be about 3 times larger than the number of input keys.''\n"
418 "\tConversely, a value of -3 means ``make the maximum associated\n"
419 "\tvalue about 3 times smaller than the number of input keys. A\n"
420 "\tlarger table should decrease the time required for an unsuccessful\n"
421 "\tsearch, at the expense of extra table space. Default value is 1.\n"
422 "-S\tCauses the generated C code to use a switch statement scheme, rather\n"
423 "\tthan an array lookup table. This can lead to a reduction in both\n"
424 "\ttime and space requirements for some keyfiles. The argument to\n"
425 "\tthis option determines how many switch statements are generated.\n"
426 "\tA value of 1 generates 1 switch containing all the elements, a value\n"
427 "\tof 2 generates 2 tables with 1/2 the elements in each table, etc.\n"
428 "\tThis is useful since many C compilers cannot correctly generate code\n"
429 "\tfor large switch statements.\n"
430 "-t\tAllows the user to include a structured type declaration for\n"
431 "\tgenerated code. Any text before %%%% is consider part of the type\n"
432 "\tdeclaration. Key words and additional fields may follow this, one\n"
433 "\tgroup of fields per line.\n"
434 "-T\tPrevents the transfer of the type declaration to the output file.\n"
435 "\tUse this option if the type is already defined elsewhere.\n"
436 "-v\tPrints out the current version number and exits with a value of 0\n"
437 "-V\tExits silently with a value of 0.\n"
438 "-Z\tAllow user to specify name of generated C++ class. Default\n"
439 "\tname is `Perfect_Hash.'\n",
444 // Sets the name for the hash function.
447 hash_name_
= ACE_TEXT_ALWAYS_CHAR(get_opt
.opt_arg ());
450 // Sets the initial value for the associated values array.
453 initial_asso_value_
= ACE_OS::atoi (get_opt
.opt_arg ());
454 if (initial_asso_value_
< 0)
455 ACE_ERROR ((LM_ERROR
,
456 "Initial value %d should be non-zero, ignoring and continuing.\n",
457 initial_asso_value_
));
459 ACE_ERROR ((LM_ERROR
,
460 "warning, -r option superceeds -i, ignoring -i option and continuing\n"));
465 ACE_SET_BITS (option_word_
, STRCASECMP
);
468 // Sets the jump value, must be odd for later algorithms.
471 jump_
= ACE_OS::atoi (get_opt
.opt_arg ());
473 ACE_ERROR_RETURN ((LM_ERROR
,
474 "Jump value %d must be a positive number.\n%r",
478 else if (jump_
&& ACE_EVEN (jump_
))
479 ACE_ERROR ((LM_ERROR
,
480 "Jump value %d should be odd, adding 1 and continuing...\n",
484 // Skip including the header file ace/OS_NS_string.h.
487 ACE_SET_BITS (option_word_
, SKIPSTRINGH
);
490 // Sets key positions used for hash function.
493 const int BAD_VALUE
= -1;
495 Iterator
expand (ACE_TEXT_ALWAYS_CHAR(get_opt
.opt_arg ()),
502 // Use all the characters for hashing!!!!
503 if (*get_opt
.opt_arg () == '*')
504 option_word_
= (option_word_
& ~DEFAULTCHARS
) | ALLCHARS
;
509 for (l_key_pos
= key_positions_
;
510 (value
= expand ()) != EOS
;
512 if (value
== BAD_VALUE
)
513 ACE_ERROR_RETURN ((LM_ERROR
,
514 "Illegal key value or range, use 1,2,3-%d,'$' or '*'.\n%r",
519 *l_key_pos
= static_cast<char> (value
);
523 total_keysig_size_
= ACE_Utils::truncate_cast
<u_int
> (l_key_pos
- key_positions_
);
524 if (total_keysig_size_
== 0)
525 ACE_ERROR_RETURN ((LM_ERROR
,
526 "No keys selected.\n%r",
529 else if (key_sort (key_positions_
, total_keysig_size_
) == 0)
530 ACE_ERROR_RETURN ((LM_ERROR
,
531 "Duplicate keys selected\n%r",
534 if (total_keysig_size_
!= 2
535 || (key_positions_
[0] != 1
536 || key_positions_
[1] != WORD_END
))
537 ACE_CLR_BITS (option_word_
, DEFAULTCHARS
);
541 // Make this the keyname for the keyword component field.
544 key_name_
= ACE_TEXT_ALWAYS_CHAR(get_opt
.opt_arg ());
547 // Create length table to avoid extra string compares.
550 ACE_SET_BITS (option_word_
, LENTABLE
);
553 // Deal with different generated languages.
557 if (!ACE_OS::strcmp (get_opt
.opt_arg (), ACE_TEXT("C++")))
558 ACE_SET_BITS (option_word_
, (CPLUSPLUS
| ANSI
));
559 else if (!ACE_OS::strcmp (get_opt
.opt_arg (), ACE_TEXT("C")))
560 ACE_SET_BITS (option_word_
, C
);
563 ACE_ERROR ((LM_ERROR
,
564 "unsupported language option %s, defaulting to C\n",
565 get_opt
.opt_arg ()));
566 ACE_SET_BITS (option_word_
, C
);
570 // Don't print the warnings.
573 ACE_SET_BITS (option_word_
, MUTE
);
576 // Skip the class definition while in C++ mode.
579 ACE_SET_BITS (option_word_
, SKIPCLASS
);
582 // Don't include the length when computing hash function.
585 ACE_SET_BITS (option_word_
, NOLENGTH
);
588 // Make generated lookup function name be.opt_arg ()
591 function_name_
= ACE_TEXT_ALWAYS_CHAR(get_opt
.opt_arg ());
594 // Make fill_default be.opt_arg ()
597 fill_default_
= ACE_TEXT_ALWAYS_CHAR(get_opt
.opt_arg ());
600 // Order input by frequency of key set occurrence.
603 ACE_SET_BITS (option_word_
, ORDER
);
608 ACE_SET_BITS (option_word_
, OPTIMIZE
);
611 // Generated lookup function now a pointer instead of int.
614 ACE_SET_BITS (option_word_
, POINTER
);
617 // Utilize randomness to initialize the associated values
621 ACE_SET_BITS (option_word_
, RANDOM
);
622 if (initial_asso_value_
!= 0)
623 ACE_ERROR ((LM_ERROR
,
624 "warning, -r option superceeds -i, disabling -i option and continuing\n"));
627 // Range of associated values, determines size of final table.
630 size_
= ACE_OS::atoi (get_opt
.opt_arg ());
631 if (abs (size_
) > 50)
632 ACE_ERROR ((LM_ERROR
,
633 "%d is excessive, did you really mean this?! (type %n -h for help)\n",
637 // Generate switch statement output, rather than lookup table.
640 ACE_SET_BITS (option_word_
, SWITCH
);
641 total_switches_
= ACE_OS::atoi (get_opt
.opt_arg ());
642 if (total_switches_
<= 0)
643 ACE_ERROR_RETURN ((LM_ERROR
,
644 "number of switches %s must be a positive number\n%r",
650 // Enable the TYPE mode, allowing arbitrary user structures.
653 ACE_SET_BITS (option_word_
, TYPE
);
656 // Don't print structure definition.
659 ACE_SET_BITS (option_word_
, NOTYPE
);
662 // Print out the version and quit.
664 ACE_ERROR ((LM_ERROR
,
665 "%n: version %s\n%r\n",
671 // Exit with value of 0 (this is useful to check if gperf exists)
676 // Set the class name.
679 class_name_
= ACE_TEXT_ALWAYS_CHAR(get_opt
.opt_arg ());
683 ACE_ERROR ((LM_ERROR
, ACE_TEXT ("Error: Invalid Option: %s\n"), get_opt
.last_option ()));
690 if (argv
[get_opt
.opt_ind ()] &&
691 ACE_OS::freopen (argv
[get_opt
.opt_ind ()],
694 ACE_ERROR_RETURN ((LM_ERROR
,
695 "Cannot open keyword file %p\n%r",
696 argv
[get_opt
.opt_ind ()],
699 if (get_opt
.opt_ind () + 1 < argc
)
700 ACE_ERROR_RETURN ((LM_ERROR
,
701 "Extra trailing arguments to %n.\n%r",
707 /// True if option enable, else false.
709 Options::operator[] (Option_Type option
)
711 return ACE_BIT_ENABLED (option_word_
, option
);
714 /// Enables option OPT.
716 Options::operator = (enum Option_Type opt
)
718 ACE_SET_BITS (option_word_
, opt
);
721 /// Disables option OPT.
723 Options::operator != (enum Option_Type opt
)
725 // @@ Why is this inequality comparison operator clearing bits?
726 ACE_CLR_BITS (option_word_
, opt
);
731 /// Initializes the key Iterator.
738 /// Returns current key_position and advanced index.
742 return key_positions_
[key_pos_
++];
745 /// Sets the size of the table size.
747 Options::asso_max (int r
)
752 /// Returns the size of the table size.
759 /// Returns total distinct key positions.
761 Options::max_keysig_size ()
763 return total_keysig_size_
;
766 /// Sets total distinct key positions.
768 Options::keysig_size (u_int a_size
)
770 total_keysig_size_
= a_size
;
773 /// Returns the jump value.
780 /// Returns the generated function name.
782 Options::function_name ()
784 return function_name_
.c_str ();
787 /// Returns the fill default
789 Options::fill_default ()
791 return fill_default_
.c_str ();
794 /// Returns the keyword key name.
798 return key_name_
.c_str ();
801 /// Returns the hash function name.
803 Options::hash_name ()
805 return hash_name_
.c_str ();
808 /// Returns the generated class name.
810 Options::class_name ()
812 return class_name_
.c_str ();
815 /// Returns the initial associated character value.
817 Options::initial_value ()
819 return initial_asso_value_
;
822 /// Returns the iterations value.
824 Options::iterations ()
829 /// Returns the string used to delimit keywords from other attributes.
831 Options::delimiter ()
833 return delimiters_
.c_str ();
836 /// Gets the total number of switch statements to generate.
838 Options::total_switches ()
840 return total_switches_
;