aboutsummaryrefslogtreecommitdiff
path: root/contrib/gperf-2.7-19981006.pat
blob: c20168ac535492e7d442e4d002a43f5d5abf1936 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
Tue Oct  6 16:18:10 1998  Kaveh R. Ghazi  <ghazi@caip.rutgers.edu>

	* key-list.cc (output_keyword_blank_entries): Output
 	get_fill_default() in the blank entries of keywords as a trailing
	list of initializers.

	* options.cc: Add support for fill_default.

	* options.h: Likewise.
	
	* options.icc: Likewise.

	* version.cc: Update to indicate forked version.


diff -rup orig/gperf-2.7/src/key-list.cc gperf-2.7/src/key-list.cc
--- orig/gperf-2.7/src/key-list.cc	Wed Apr 15 18:02:51 1998
+++ gperf-2.7/src/key-list.cc	Tue Oct  6 15:38:54 1998
@@ -1069,7 +1069,7 @@ output_keyword_blank_entries (int count,
             printf (", ");
         }
       if (option[TYPE])
-        printf ("{\"\"}");
+        printf ("{\"\"%s}", option.get_fill_default());
       else
         printf ("\"\"");
       column++;
diff -rup orig/gperf-2.7/src/options.cc gperf-2.7/src/options.cc
--- orig/gperf-2.7/src/options.cc	Sat May  2 06:35:16 1998
+++ gperf-2.7/src/options.cc	Tue Oct  6 15:20:03 1998
@@ -40,6 +40,9 @@ static const int DEFAULT_JUMP_VALUE = 5;
 /* Default name for generated lookup function. */
 static const char *const DEFAULT_NAME = "in_word_set";
 
+/* Default filler for keyword table. */
+static const char *const DEFAULT_FILL = "";
+
 /* Default name for the key component. */
 static const char *const DEFAULT_KEY = "name";
 
@@ -66,6 +69,7 @@ int Options::argument_count;
 int Options::iterations;
 char **Options::argument_vector;
 const char *Options::function_name;
+const char *Options::fill_default;
 const char *Options::key_name;
 const char *Options::class_name;
 const char *Options::hash_name;
@@ -265,6 +269,7 @@ Options::Options (void)
   jump                = DEFAULT_JUMP_VALUE;
   option_word         = DEFAULTCHARS | C;
   function_name       = DEFAULT_NAME;
+  fill_default        = DEFAULT_FILL;
   key_name            = DEFAULT_KEY;
   hash_name           = DEFAULT_HASH_NAME;
   wordlist_name       = DEFAULT_WORDLIST_NAME;
@@ -306,6 +311,7 @@ Options::~Options (void)
                "\nSEVENBIT is....: %s"
                "\niterations = %d"
                "\nlookup function name = %s"
+               "\nfill default = %s"
                "\nhash function name = %s"
                "\nword list name = %s"
                "\nkey name = %s"
@@ -336,7 +342,7 @@ Options::~Options (void)
                option_word & INCLUDE ? "enabled" : "disabled",
                option_word & SEVENBIT ? "enabled" : "disabled",
                iterations,
-               function_name, hash_name, wordlist_name, key_name,
+               function_name, fill_default, hash_name, wordlist_name, key_name,
                jump, size - 1, initial_asso_value, delimiters, total_switches);
       if (option_word & ALLCHARS)
         fprintf (stderr, "all characters are used in the hash function\n");
@@ -379,6 +385,7 @@ static const struct option long_options[
   { "compare-strlen", no_argument, 0, 'l' },
   { "duplicates", no_argument, 0, 'D' },
   { "fast", required_argument, 0, 'f' },
+  { "fill-default", required_argument, 0, 'F' },
   { "initial-asso", required_argument, 0, 'i' },
   { "jump", required_argument, 0, 'j' },
   { "no-strlen", no_argument, 0, 'n' },
@@ -403,7 +410,7 @@ Options::operator() (int argc, char *arg
 
   while ((option_char =
             getopt_long (argument_count, argument_vector,
-                         "adcCDe:Ef:gGhH:i:Ij:k:K:lL:nN:oprs:S:tTvW:Z:7",
+                         "adcCDe:Ef:F:gGhH:i:Ij:k:K:lL:nN:oprs:S:tTvW:Z:7",
                          long_options, (int *)0))
          != -1)
     {
@@ -575,6 +582,11 @@ Options::operator() (int argc, char *arg
         case 'N':               /* Make generated lookup function name be optarg */
           {
             function_name = /*getopt*/optarg;
+            break;
+          }
+        case 'F':               /* Make fill_default be optarg */
+          {
+            fill_default = /*getopt*/optarg;
             break;
           }
         case 'o':               /* Order input by frequency of key set occurrence. */
diff -rup orig/gperf-2.7/src/options.h gperf-2.7/src/options.h
--- orig/gperf-2.7/src/options.h	Tue Apr 14 06:55:28 1998
+++ gperf-2.7/src/options.h	Tue Oct  6 15:12:46 1998
@@ -97,6 +97,7 @@ public:
   static int          initial_value (void);
   static int          get_total_switches (void);
   static const char  *get_function_name (void);
+  static const char  *get_fill_default (void);
   static const char  *get_key_name (void);
   static const char  *get_class_name (void);
   static const char  *get_hash_name (void);
@@ -115,6 +116,7 @@ private:
   static int          iterations;                         /* Amount to iterate when a collision occurs. */
   static char       **argument_vector;                    /* Stores a pointer to command-line vector. */
   static const char  *function_name;                      /* Names used for generated lookup function. */
+  static const char  *fill_default;                       /* Expression used to assign default values in keyword table. */
   static const char  *key_name;                           /* Name used for keyword key. */
   static const char  *class_name;                         /* Name used for generated C++ class. */
   static const char  *hash_name;                          /* Name used for generated hash function. */
diff -rup orig/gperf-2.7/src/options.icc gperf-2.7/src/options.icc
--- orig/gperf-2.7/src/options.icc	Sat Mar 21 07:51:17 1998
+++ gperf-2.7/src/options.icc	Tue Oct  6 15:27:36 1998
@@ -110,6 +110,14 @@ Options::get_function_name (void)
   return function_name;
 }
 
+/* Returns the fill default. */
+INLINE const char *
+Options::get_fill_default (void)
+{
+  T (Trace t ("Options::get_fill_default");)
+  return fill_default;
+}
+
 /* Returns the keyword key name. */
 INLINE const char *
 Options::get_key_name (void)
diff -rup orig/gperf-2.7/src/version.cc gperf-2.7/src/version.cc
--- orig/gperf-2.7/src/version.cc	Sat May  2 06:29:43 1998
+++ gperf-2.7/src/version.cc	Tue Oct  6 16:04:56 1998
@@ -19,4 +19,4 @@ You should have received a copy of the G
 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.  */
 
-const char *version_string = "2.7";
+const char *version_string = "2.7.1 (19981006 egcs)";