1 | /* -*- Mode: Text -*- */ |
---|
2 | |
---|
3 | struct dent { |
---|
4 | struct dent *next; |
---|
5 | char *word; |
---|
6 | |
---|
7 | unsigned int used : 1; |
---|
8 | |
---|
9 | /* bit fields for all of the flags */ |
---|
10 | unsigned int v_flag : 1; |
---|
11 | /* |
---|
12 | "V" flag: |
---|
13 | ...E --> ...IVE as in CREATE --> CREATIVE |
---|
14 | if # .ne. E, ...# --> ...#IVE as in PREVENT --> PREVENTIVE |
---|
15 | */ |
---|
16 | unsigned int n_flag : 1; |
---|
17 | /* |
---|
18 | "N" flag: |
---|
19 | ...E --> ...ION as in CREATE --> CREATION |
---|
20 | ...Y --> ...ICATION as in MULTIPLY --> MULTIPLICATION |
---|
21 | if # .ne. E or Y, ...# --> ...#EN as in FALL --> FALLEN |
---|
22 | */ |
---|
23 | unsigned int x_flag : 1; |
---|
24 | /* |
---|
25 | "X" flag: |
---|
26 | ...E --> ...IONS as in CREATE --> CREATIONS |
---|
27 | ...Y --> ...ICATIONS as in MULTIPLY --> MULTIPLICATIONS |
---|
28 | if # .ne. E or Y, ...# --> ...#ENS as in WEAK --> WEAKENS |
---|
29 | */ |
---|
30 | unsigned int h_flag : 1; |
---|
31 | /* |
---|
32 | "H" flag: |
---|
33 | ...Y --> ...IETH as in TWENTY --> TWENTIETH |
---|
34 | if # .ne. Y, ...# --> ...#TH as in HUNDRED --> HUNDREDTH |
---|
35 | */ |
---|
36 | unsigned int y_flag : 1; |
---|
37 | /* |
---|
38 | "Y" FLAG: |
---|
39 | ... --> ...LY as in QUICK --> QUICKLY |
---|
40 | */ |
---|
41 | unsigned int g_flag : 1; |
---|
42 | /* |
---|
43 | "G" FLAG: |
---|
44 | ...E --> ...ING as in FILE --> FILING |
---|
45 | if # .ne. E, ...# --> ...#ING as in CROSS --> CROSSING |
---|
46 | */ |
---|
47 | unsigned int j_flag : 1; |
---|
48 | /* |
---|
49 | "J" FLAG" |
---|
50 | ...E --> ...INGS as in FILE --> FILINGS |
---|
51 | if # .ne. E, ...# --> ...#INGS as in CROSS --> CROSSINGS |
---|
52 | */ |
---|
53 | unsigned int d_flag : 1; |
---|
54 | /* |
---|
55 | "D" FLAG: |
---|
56 | ...E --> ...ED as in CREATE --> CREATED |
---|
57 | if @ .ne. A, E, I, O, or U, |
---|
58 | ...@Y --> ...@IED as in IMPLY --> IMPLIED |
---|
59 | if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U) |
---|
60 | ...@# --> ...@#ED as in CROSS --> CROSSED |
---|
61 | or CONVEY --> CONVEYED |
---|
62 | */ |
---|
63 | unsigned int t_flag : 1; |
---|
64 | /* |
---|
65 | "T" FLAG: |
---|
66 | ...E --> ...EST as in LATE --> LATEST |
---|
67 | if @ .ne. A, E, I, O, or U, |
---|
68 | ...@Y --> ...@IEST as in DIRTY --> DIRTIEST |
---|
69 | if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U) |
---|
70 | ...@# --> ...@#EST as in SMALL --> SMALLEST |
---|
71 | or GRAY --> GRAYEST |
---|
72 | */ |
---|
73 | unsigned int r_flag : 1; |
---|
74 | /* |
---|
75 | "R" FLAG: |
---|
76 | ...E --> ...ER as in SKATE --> SKATER |
---|
77 | if @ .ne. A, E, I, O, or U, |
---|
78 | ...@Y --> ...@IER as in MULTIPLY --> MULTIPLIER |
---|
79 | if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U) |
---|
80 | ...@# --> ...@#ER as in BUILD --> BUILDER |
---|
81 | or CONVEY --> CONVEYER |
---|
82 | */ |
---|
83 | unsigned int z_flag : 1; |
---|
84 | /* |
---|
85 | "Z FLAG: |
---|
86 | ...E --> ...ERS as in SKATE --> SKATERS |
---|
87 | if @ .ne. A, E, I, O, or U, |
---|
88 | ...@Y --> ...@IERS as in MULTIPLY --> MULTIPLIERS |
---|
89 | if # .ne. E or Y, or (# = Y and @ = A, E, I, O, or U) |
---|
90 | ...@# --> ...@#ERS as in BUILD --> BUILDERS |
---|
91 | or SLAY --> SLAYERS |
---|
92 | */ |
---|
93 | unsigned int s_flag : 1; |
---|
94 | /* |
---|
95 | "S" FLAG: |
---|
96 | if @ .ne. A, E, I, O, or U, |
---|
97 | ...@Y --> ...@IES as in IMPLY --> IMPLIES |
---|
98 | if # .eq. S, X, Z, or H, |
---|
99 | ...# --> ...#ES as in FIX --> FIXES |
---|
100 | if # .ne. S,X,Z,H, or Y, or (# = Y and @ = A, E, I, O, or U) |
---|
101 | ...# --> ...#S as in BAT --> BATS |
---|
102 | or CONVEY --> CONVEYS |
---|
103 | */ |
---|
104 | unsigned int p_flag : 1; |
---|
105 | /* |
---|
106 | "P" FLAG: |
---|
107 | if @ .ne. A, E, I, O, or U, |
---|
108 | ...@Y --> ...@INESS as in CLOUDY --> CLOUDINESS |
---|
109 | if # .ne. Y, or @ = A, E, I, O, or U, |
---|
110 | ...@# --> ...@#NESS as in LATE --> LATENESS |
---|
111 | or GRAY --> GRAYNESS |
---|
112 | */ |
---|
113 | unsigned int m_flag : 1; |
---|
114 | /* |
---|
115 | "M" FLAG: |
---|
116 | ... --> ...'S as in DOG --> DOG'S |
---|
117 | */ |
---|
118 | |
---|
119 | unsigned int keep : 1; |
---|
120 | |
---|
121 | }; |
---|
122 | |
---|
123 | #define WORDLEN 30 |
---|
124 | |
---|
125 | struct hashheader { |
---|
126 | int magic; |
---|
127 | int stringsize; |
---|
128 | int tblsize; |
---|
129 | }; |
---|
130 | |
---|
131 | #define MAGIC 1 |
---|
132 | |
---|
133 | |
---|
134 | /* |
---|
135 | * termcap variables |
---|
136 | */ |
---|
137 | char *tgetstr(); |
---|
138 | char PC; /* padding character */ |
---|
139 | char *BC; /* backspace if not ^H */ |
---|
140 | char *UP; /* Upline (cursor up) */ |
---|
141 | char *cd; /* clear to end of display */ |
---|
142 | char *ce; /* clear to end of line */ |
---|
143 | char *cl; /* clear display */ |
---|
144 | char *cm; /* cursor movement */ |
---|
145 | char *dc; /* delete character */ |
---|
146 | char *dl; /* delete line */ |
---|
147 | char *dm; /* delete mode */ |
---|
148 | char *ed; /* exit delete mode */ |
---|
149 | char *ei; /* exit insert mode */ |
---|
150 | char *ho; /* home */ |
---|
151 | char *ic; /* insert character */ |
---|
152 | char *il; /* insert line */ |
---|
153 | char *im; /* insert mode */ |
---|
154 | char *ip; /* insert padding */ |
---|
155 | char *nd; /* non-destructive space */ |
---|
156 | char *vb; /* visible bell */ |
---|
157 | char *so; /* standout */ |
---|
158 | char *se; /* standout end */ |
---|
159 | int bs; |
---|
160 | int li, co; /* lines, columns */ |
---|
161 | |
---|
162 | char termcap[1024]; |
---|
163 | char termstr[1024]; /* for string values */ |
---|
164 | char *termptr; |
---|
165 | |
---|
166 | char rootword[BUFSIZ]; |
---|
167 | struct dent *lastdent; |
---|
168 | |
---|
169 | char *hashstrings; |
---|
170 | |
---|
171 | |
---|
172 | int aflag; |
---|
173 | int lflag; |
---|
174 | |
---|
175 | int erasechar; |
---|
176 | int killchar; |
---|
177 | |
---|
178 | char tempfile[200]; |
---|