1c2c66affSColin Finck /*
2c2c66affSColin Finck * Copyright (c) 1991-1997 Sam Leffler
3c2c66affSColin Finck * Copyright (c) 1991-1997 Silicon Graphics, Inc.
4c2c66affSColin Finck *
5c2c66affSColin Finck * Permission to use, copy, modify, distribute, and sell this software and
6c2c66affSColin Finck * its documentation for any purpose is hereby granted without fee, provided
7c2c66affSColin Finck * that (i) the above copyright notices and this permission notice appear in
8c2c66affSColin Finck * all copies of the software and related documentation, and (ii) the names of
9c2c66affSColin Finck * Sam Leffler and Silicon Graphics may not be used in any advertising or
10c2c66affSColin Finck * publicity relating to the software without the specific, prior written
11c2c66affSColin Finck * permission of Sam Leffler and Silicon Graphics.
12c2c66affSColin Finck *
13c2c66affSColin Finck * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
14c2c66affSColin Finck * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
15c2c66affSColin Finck * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
16c2c66affSColin Finck *
17c2c66affSColin Finck * IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
18c2c66affSColin Finck * ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
19c2c66affSColin Finck * OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
20c2c66affSColin Finck * WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
21c2c66affSColin Finck * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
22c2c66affSColin Finck * OF THIS SOFTWARE.
23c2c66affSColin Finck */
24c2c66affSColin Finck
25c2c66affSColin Finck /* Initialise fax decoder tables
26c2c66affSColin Finck * Decoder support is derived, with permission, from the code
27c2c66affSColin Finck * in Frank Cringle's viewfax program;
28c2c66affSColin Finck * Copyright (C) 1990, 1995 Frank D. Cringle.
29c2c66affSColin Finck */
30c2c66affSColin Finck #include "tif_config.h"
31c2c66affSColin Finck
32c2c66affSColin Finck #include <stdio.h>
33c2c66affSColin Finck #include <stdlib.h>
34c2c66affSColin Finck #include <string.h>
35c2c66affSColin Finck
36c2c66affSColin Finck #ifdef HAVE_UNISTD_H
37c2c66affSColin Finck # include <unistd.h>
38c2c66affSColin Finck #endif
39c2c66affSColin Finck
40c2c66affSColin Finck #include "tif_fax3.h"
41c2c66affSColin Finck
42c2c66affSColin Finck #ifndef HAVE_GETOPT
43*f87faf67SThomas Faber extern int getopt(int argc, char * const argv[], const char *optstring);
44c2c66affSColin Finck #endif
45c2c66affSColin Finck
46c2c66affSColin Finck #define streq(a,b) (strcmp(a,b) == 0)
47c2c66affSColin Finck
48c2c66affSColin Finck /* NB: can't use names in tif_fax3.h 'cuz they are declared const */
49c2c66affSColin Finck TIFFFaxTabEnt MainTable[128];
50c2c66affSColin Finck TIFFFaxTabEnt WhiteTable[4096];
51c2c66affSColin Finck TIFFFaxTabEnt BlackTable[8192];
52c2c66affSColin Finck
53c2c66affSColin Finck struct proto {
54c2c66affSColin Finck uint16 code; /* right justified, lsb-first, zero filled */
55c2c66affSColin Finck uint16 val; /* (pixel count)<<4 + code width */
56c2c66affSColin Finck };
57c2c66affSColin Finck
58c2c66affSColin Finck static struct proto Pass[] = {
59c2c66affSColin Finck { 0x0008, 4 },
60c2c66affSColin Finck { 0, 0 }
61c2c66affSColin Finck };
62c2c66affSColin Finck
63c2c66affSColin Finck static struct proto Horiz[] = {
64c2c66affSColin Finck { 0x0004, 3 },
65c2c66affSColin Finck { 0, 0 }
66c2c66affSColin Finck };
67c2c66affSColin Finck
68c2c66affSColin Finck static struct proto V0[] = {
69c2c66affSColin Finck { 0x0001, 1 },
70c2c66affSColin Finck { 0, 0 }
71c2c66affSColin Finck };
72c2c66affSColin Finck
73c2c66affSColin Finck static struct proto VR[] = {
74c2c66affSColin Finck { 0x0006, (1<<4)+3 },
75c2c66affSColin Finck { 0x0030, (2<<4)+6 },
76c2c66affSColin Finck { 0x0060, (3<<4)+7 },
77c2c66affSColin Finck { 0, 0 }
78c2c66affSColin Finck };
79c2c66affSColin Finck
80c2c66affSColin Finck static struct proto VL[] = {
81c2c66affSColin Finck { 0x0002, (1<<4)+3 },
82c2c66affSColin Finck { 0x0010, (2<<4)+6 },
83c2c66affSColin Finck { 0x0020, (3<<4)+7 },
84c2c66affSColin Finck { 0, 0 }
85c2c66affSColin Finck };
86c2c66affSColin Finck
87c2c66affSColin Finck static struct proto Ext[] = {
88c2c66affSColin Finck { 0x0040, 7 },
89c2c66affSColin Finck { 0, 0 }
90c2c66affSColin Finck };
91c2c66affSColin Finck
92c2c66affSColin Finck static struct proto EOLV[] = {
93c2c66affSColin Finck { 0x0000, 7 },
94c2c66affSColin Finck { 0, 0 }
95c2c66affSColin Finck };
96c2c66affSColin Finck
97c2c66affSColin Finck static struct proto MakeUpW[] = {
98c2c66affSColin Finck { 0x001b, 1029 },
99c2c66affSColin Finck { 0x0009, 2053 },
100c2c66affSColin Finck { 0x003a, 3078 },
101c2c66affSColin Finck { 0x0076, 4103 },
102c2c66affSColin Finck { 0x006c, 5128 },
103c2c66affSColin Finck { 0x00ec, 6152 },
104c2c66affSColin Finck { 0x0026, 7176 },
105c2c66affSColin Finck { 0x00a6, 8200 },
106c2c66affSColin Finck { 0x0016, 9224 },
107c2c66affSColin Finck { 0x00e6, 10248 },
108c2c66affSColin Finck { 0x0066, 11273 },
109c2c66affSColin Finck { 0x0166, 12297 },
110c2c66affSColin Finck { 0x0096, 13321 },
111c2c66affSColin Finck { 0x0196, 14345 },
112c2c66affSColin Finck { 0x0056, 15369 },
113c2c66affSColin Finck { 0x0156, 16393 },
114c2c66affSColin Finck { 0x00d6, 17417 },
115c2c66affSColin Finck { 0x01d6, 18441 },
116c2c66affSColin Finck { 0x0036, 19465 },
117c2c66affSColin Finck { 0x0136, 20489 },
118c2c66affSColin Finck { 0x00b6, 21513 },
119c2c66affSColin Finck { 0x01b6, 22537 },
120c2c66affSColin Finck { 0x0032, 23561 },
121c2c66affSColin Finck { 0x0132, 24585 },
122c2c66affSColin Finck { 0x00b2, 25609 },
123c2c66affSColin Finck { 0x0006, 26630 },
124c2c66affSColin Finck { 0x01b2, 27657 },
125c2c66affSColin Finck { 0, 0 }
126c2c66affSColin Finck };
127c2c66affSColin Finck
128c2c66affSColin Finck static struct proto MakeUpB[] = {
129c2c66affSColin Finck { 0x03c0, 1034 },
130c2c66affSColin Finck { 0x0130, 2060 },
131c2c66affSColin Finck { 0x0930, 3084 },
132c2c66affSColin Finck { 0x0da0, 4108 },
133c2c66affSColin Finck { 0x0cc0, 5132 },
134c2c66affSColin Finck { 0x02c0, 6156 },
135c2c66affSColin Finck { 0x0ac0, 7180 },
136c2c66affSColin Finck { 0x06c0, 8205 },
137c2c66affSColin Finck { 0x16c0, 9229 },
138c2c66affSColin Finck { 0x0a40, 10253 },
139c2c66affSColin Finck { 0x1a40, 11277 },
140c2c66affSColin Finck { 0x0640, 12301 },
141c2c66affSColin Finck { 0x1640, 13325 },
142c2c66affSColin Finck { 0x09c0, 14349 },
143c2c66affSColin Finck { 0x19c0, 15373 },
144c2c66affSColin Finck { 0x05c0, 16397 },
145c2c66affSColin Finck { 0x15c0, 17421 },
146c2c66affSColin Finck { 0x0dc0, 18445 },
147c2c66affSColin Finck { 0x1dc0, 19469 },
148c2c66affSColin Finck { 0x0940, 20493 },
149c2c66affSColin Finck { 0x1940, 21517 },
150c2c66affSColin Finck { 0x0540, 22541 },
151c2c66affSColin Finck { 0x1540, 23565 },
152c2c66affSColin Finck { 0x0b40, 24589 },
153c2c66affSColin Finck { 0x1b40, 25613 },
154c2c66affSColin Finck { 0x04c0, 26637 },
155c2c66affSColin Finck { 0x14c0, 27661 },
156c2c66affSColin Finck { 0, 0 }
157c2c66affSColin Finck };
158c2c66affSColin Finck
159c2c66affSColin Finck static struct proto MakeUp[] = {
160c2c66affSColin Finck { 0x0080, 28683 },
161c2c66affSColin Finck { 0x0180, 29707 },
162c2c66affSColin Finck { 0x0580, 30731 },
163c2c66affSColin Finck { 0x0480, 31756 },
164c2c66affSColin Finck { 0x0c80, 32780 },
165c2c66affSColin Finck { 0x0280, 33804 },
166c2c66affSColin Finck { 0x0a80, 34828 },
167c2c66affSColin Finck { 0x0680, 35852 },
168c2c66affSColin Finck { 0x0e80, 36876 },
169c2c66affSColin Finck { 0x0380, 37900 },
170c2c66affSColin Finck { 0x0b80, 38924 },
171c2c66affSColin Finck { 0x0780, 39948 },
172c2c66affSColin Finck { 0x0f80, 40972 },
173c2c66affSColin Finck { 0, 0 }
174c2c66affSColin Finck };
175c2c66affSColin Finck
176c2c66affSColin Finck static struct proto TermW[] = {
177c2c66affSColin Finck { 0x00ac, 8 },
178c2c66affSColin Finck { 0x0038, 22 },
179c2c66affSColin Finck { 0x000e, 36 },
180c2c66affSColin Finck { 0x0001, 52 },
181c2c66affSColin Finck { 0x000d, 68 },
182c2c66affSColin Finck { 0x0003, 84 },
183c2c66affSColin Finck { 0x0007, 100 },
184c2c66affSColin Finck { 0x000f, 116 },
185c2c66affSColin Finck { 0x0019, 133 },
186c2c66affSColin Finck { 0x0005, 149 },
187c2c66affSColin Finck { 0x001c, 165 },
188c2c66affSColin Finck { 0x0002, 181 },
189c2c66affSColin Finck { 0x0004, 198 },
190c2c66affSColin Finck { 0x0030, 214 },
191c2c66affSColin Finck { 0x000b, 230 },
192c2c66affSColin Finck { 0x002b, 246 },
193c2c66affSColin Finck { 0x0015, 262 },
194c2c66affSColin Finck { 0x0035, 278 },
195c2c66affSColin Finck { 0x0072, 295 },
196c2c66affSColin Finck { 0x0018, 311 },
197c2c66affSColin Finck { 0x0008, 327 },
198c2c66affSColin Finck { 0x0074, 343 },
199c2c66affSColin Finck { 0x0060, 359 },
200c2c66affSColin Finck { 0x0010, 375 },
201c2c66affSColin Finck { 0x000a, 391 },
202c2c66affSColin Finck { 0x006a, 407 },
203c2c66affSColin Finck { 0x0064, 423 },
204c2c66affSColin Finck { 0x0012, 439 },
205c2c66affSColin Finck { 0x000c, 455 },
206c2c66affSColin Finck { 0x0040, 472 },
207c2c66affSColin Finck { 0x00c0, 488 },
208c2c66affSColin Finck { 0x0058, 504 },
209c2c66affSColin Finck { 0x00d8, 520 },
210c2c66affSColin Finck { 0x0048, 536 },
211c2c66affSColin Finck { 0x00c8, 552 },
212c2c66affSColin Finck { 0x0028, 568 },
213c2c66affSColin Finck { 0x00a8, 584 },
214c2c66affSColin Finck { 0x0068, 600 },
215c2c66affSColin Finck { 0x00e8, 616 },
216c2c66affSColin Finck { 0x0014, 632 },
217c2c66affSColin Finck { 0x0094, 648 },
218c2c66affSColin Finck { 0x0054, 664 },
219c2c66affSColin Finck { 0x00d4, 680 },
220c2c66affSColin Finck { 0x0034, 696 },
221c2c66affSColin Finck { 0x00b4, 712 },
222c2c66affSColin Finck { 0x0020, 728 },
223c2c66affSColin Finck { 0x00a0, 744 },
224c2c66affSColin Finck { 0x0050, 760 },
225c2c66affSColin Finck { 0x00d0, 776 },
226c2c66affSColin Finck { 0x004a, 792 },
227c2c66affSColin Finck { 0x00ca, 808 },
228c2c66affSColin Finck { 0x002a, 824 },
229c2c66affSColin Finck { 0x00aa, 840 },
230c2c66affSColin Finck { 0x0024, 856 },
231c2c66affSColin Finck { 0x00a4, 872 },
232c2c66affSColin Finck { 0x001a, 888 },
233c2c66affSColin Finck { 0x009a, 904 },
234c2c66affSColin Finck { 0x005a, 920 },
235c2c66affSColin Finck { 0x00da, 936 },
236c2c66affSColin Finck { 0x0052, 952 },
237c2c66affSColin Finck { 0x00d2, 968 },
238c2c66affSColin Finck { 0x004c, 984 },
239c2c66affSColin Finck { 0x00cc, 1000 },
240c2c66affSColin Finck { 0x002c, 1016 },
241c2c66affSColin Finck { 0, 0 }
242c2c66affSColin Finck };
243c2c66affSColin Finck
244c2c66affSColin Finck static struct proto TermB[] = {
245c2c66affSColin Finck { 0x03b0, 10 },
246c2c66affSColin Finck { 0x0002, 19 },
247c2c66affSColin Finck { 0x0003, 34 },
248c2c66affSColin Finck { 0x0001, 50 },
249c2c66affSColin Finck { 0x0006, 67 },
250c2c66affSColin Finck { 0x000c, 84 },
251c2c66affSColin Finck { 0x0004, 100 },
252c2c66affSColin Finck { 0x0018, 117 },
253c2c66affSColin Finck { 0x0028, 134 },
254c2c66affSColin Finck { 0x0008, 150 },
255c2c66affSColin Finck { 0x0010, 167 },
256c2c66affSColin Finck { 0x0050, 183 },
257c2c66affSColin Finck { 0x0070, 199 },
258c2c66affSColin Finck { 0x0020, 216 },
259c2c66affSColin Finck { 0x00e0, 232 },
260c2c66affSColin Finck { 0x0030, 249 },
261c2c66affSColin Finck { 0x03a0, 266 },
262c2c66affSColin Finck { 0x0060, 282 },
263c2c66affSColin Finck { 0x0040, 298 },
264c2c66affSColin Finck { 0x0730, 315 },
265c2c66affSColin Finck { 0x00b0, 331 },
266c2c66affSColin Finck { 0x01b0, 347 },
267c2c66affSColin Finck { 0x0760, 363 },
268c2c66affSColin Finck { 0x00a0, 379 },
269c2c66affSColin Finck { 0x0740, 395 },
270c2c66affSColin Finck { 0x00c0, 411 },
271c2c66affSColin Finck { 0x0530, 428 },
272c2c66affSColin Finck { 0x0d30, 444 },
273c2c66affSColin Finck { 0x0330, 460 },
274c2c66affSColin Finck { 0x0b30, 476 },
275c2c66affSColin Finck { 0x0160, 492 },
276c2c66affSColin Finck { 0x0960, 508 },
277c2c66affSColin Finck { 0x0560, 524 },
278c2c66affSColin Finck { 0x0d60, 540 },
279c2c66affSColin Finck { 0x04b0, 556 },
280c2c66affSColin Finck { 0x0cb0, 572 },
281c2c66affSColin Finck { 0x02b0, 588 },
282c2c66affSColin Finck { 0x0ab0, 604 },
283c2c66affSColin Finck { 0x06b0, 620 },
284c2c66affSColin Finck { 0x0eb0, 636 },
285c2c66affSColin Finck { 0x0360, 652 },
286c2c66affSColin Finck { 0x0b60, 668 },
287c2c66affSColin Finck { 0x05b0, 684 },
288c2c66affSColin Finck { 0x0db0, 700 },
289c2c66affSColin Finck { 0x02a0, 716 },
290c2c66affSColin Finck { 0x0aa0, 732 },
291c2c66affSColin Finck { 0x06a0, 748 },
292c2c66affSColin Finck { 0x0ea0, 764 },
293c2c66affSColin Finck { 0x0260, 780 },
294c2c66affSColin Finck { 0x0a60, 796 },
295c2c66affSColin Finck { 0x04a0, 812 },
296c2c66affSColin Finck { 0x0ca0, 828 },
297c2c66affSColin Finck { 0x0240, 844 },
298c2c66affSColin Finck { 0x0ec0, 860 },
299c2c66affSColin Finck { 0x01c0, 876 },
300c2c66affSColin Finck { 0x0e40, 892 },
301c2c66affSColin Finck { 0x0140, 908 },
302c2c66affSColin Finck { 0x01a0, 924 },
303c2c66affSColin Finck { 0x09a0, 940 },
304c2c66affSColin Finck { 0x0d40, 956 },
305c2c66affSColin Finck { 0x0340, 972 },
306c2c66affSColin Finck { 0x05a0, 988 },
307c2c66affSColin Finck { 0x0660, 1004 },
308c2c66affSColin Finck { 0x0e60, 1020 },
309c2c66affSColin Finck { 0, 0 }
310c2c66affSColin Finck };
311c2c66affSColin Finck
312c2c66affSColin Finck static struct proto EOLH[] = {
313c2c66affSColin Finck { 0x0000, 11 },
314c2c66affSColin Finck { 0, 0 }
315c2c66affSColin Finck };
316c2c66affSColin Finck
317c2c66affSColin Finck static void
FillTable(TIFFFaxTabEnt * T,int Size,struct proto * P,int State)318c2c66affSColin Finck FillTable(TIFFFaxTabEnt *T, int Size, struct proto *P, int State)
319c2c66affSColin Finck {
320c2c66affSColin Finck int limit = 1 << Size;
321c2c66affSColin Finck
322c2c66affSColin Finck while (P->val) {
323c2c66affSColin Finck int width = P->val & 15;
324c2c66affSColin Finck int param = P->val >> 4;
325c2c66affSColin Finck int incr = 1 << width;
326c2c66affSColin Finck int code;
327c2c66affSColin Finck for (code = P->code; code < limit; code += incr) {
328c2c66affSColin Finck TIFFFaxTabEnt *E = T+code;
329c2c66affSColin Finck E->State = State;
330c2c66affSColin Finck E->Width = width;
331c2c66affSColin Finck E->Param = param;
332c2c66affSColin Finck }
333c2c66affSColin Finck P++;
334c2c66affSColin Finck }
335c2c66affSColin Finck }
336c2c66affSColin Finck
337c2c66affSColin Finck static char* storage_class = "";
338c2c66affSColin Finck static char* const_class = "";
339c2c66affSColin Finck static int packoutput = 1;
340c2c66affSColin Finck static char* prebrace = "";
341c2c66affSColin Finck static char* postbrace = "";
342c2c66affSColin Finck
343c2c66affSColin Finck void
WriteTable(FILE * fd,const TIFFFaxTabEnt * T,int Size,const char * name)344c2c66affSColin Finck WriteTable(FILE* fd, const TIFFFaxTabEnt* T, int Size, const char* name)
345c2c66affSColin Finck {
346c2c66affSColin Finck int i;
347c2c66affSColin Finck char* sep;
348c2c66affSColin Finck
349c2c66affSColin Finck fprintf(fd, "%s %s TIFFFaxTabEnt %s[%d] = {",
350c2c66affSColin Finck storage_class, const_class, name, Size);
351c2c66affSColin Finck if (packoutput) {
352c2c66affSColin Finck sep = "\n";
353c2c66affSColin Finck for (i = 0; i < Size; i++) {
354c2c66affSColin Finck fprintf(fd, "%s%s%d,%d,%d%s",
355c2c66affSColin Finck sep, prebrace, T->State, T->Width, (int) T->Param, postbrace);
356c2c66affSColin Finck if (((i+1) % 10) == 0)
357c2c66affSColin Finck sep = ",\n";
358c2c66affSColin Finck else
359c2c66affSColin Finck sep = ",";
360c2c66affSColin Finck T++;
361c2c66affSColin Finck }
362c2c66affSColin Finck } else {
363c2c66affSColin Finck sep = "\n ";
364c2c66affSColin Finck for (i = 0; i < Size; i++) {
365c2c66affSColin Finck fprintf(fd, "%s%s%3d,%3d,%4d%s",
366c2c66affSColin Finck sep, prebrace, T->State, T->Width, (int) T->Param, postbrace);
367c2c66affSColin Finck if (((i+1) % 6) == 0)
368c2c66affSColin Finck sep = ",\n ";
369c2c66affSColin Finck else
370c2c66affSColin Finck sep = ",";
371c2c66affSColin Finck T++;
372c2c66affSColin Finck }
373c2c66affSColin Finck }
374c2c66affSColin Finck fprintf(fd, "\n};\n");
375c2c66affSColin Finck }
376c2c66affSColin Finck
377c2c66affSColin Finck /* initialise the huffman code tables */
378c2c66affSColin Finck int
main(int argc,char * argv[])379c2c66affSColin Finck main(int argc, char* argv[])
380c2c66affSColin Finck {
381c2c66affSColin Finck FILE* fd;
382c2c66affSColin Finck char* outputfile;
383c2c66affSColin Finck int c;
384c2c66affSColin Finck
385c2c66affSColin Finck #if !HAVE_DECL_OPTARG
386c2c66affSColin Finck extern int optind;
387c2c66affSColin Finck extern char* optarg;
388c2c66affSColin Finck #endif
389c2c66affSColin Finck
390c2c66affSColin Finck while ((c = getopt(argc, argv, "c:s:bp")) != -1)
391c2c66affSColin Finck switch (c) {
392c2c66affSColin Finck case 'c':
393c2c66affSColin Finck const_class = optarg;
394c2c66affSColin Finck break;
395c2c66affSColin Finck case 's':
396c2c66affSColin Finck storage_class = optarg;
397c2c66affSColin Finck break;
398c2c66affSColin Finck case 'p':
399c2c66affSColin Finck packoutput = 0;
400c2c66affSColin Finck break;
401c2c66affSColin Finck case 'b':
402c2c66affSColin Finck prebrace = "{";
403c2c66affSColin Finck postbrace = "}";
404c2c66affSColin Finck break;
405c2c66affSColin Finck case '?':
406c2c66affSColin Finck fprintf(stderr,
407c2c66affSColin Finck "usage: %s [-c const] [-s storage] [-p] [-b] file\n",
408c2c66affSColin Finck argv[0]);
409c2c66affSColin Finck return (-1);
410c2c66affSColin Finck }
411c2c66affSColin Finck outputfile = optind < argc ? argv[optind] : "g3states.h";
412c2c66affSColin Finck fd = fopen(outputfile, "w");
413c2c66affSColin Finck if (fd == NULL) {
414c2c66affSColin Finck fprintf(stderr, "%s: %s: Cannot create output file.\n",
415c2c66affSColin Finck argv[0], outputfile);
416c2c66affSColin Finck return (-2);
417c2c66affSColin Finck }
418c2c66affSColin Finck FillTable(MainTable, 7, Pass, S_Pass);
419c2c66affSColin Finck FillTable(MainTable, 7, Horiz, S_Horiz);
420c2c66affSColin Finck FillTable(MainTable, 7, V0, S_V0);
421c2c66affSColin Finck FillTable(MainTable, 7, VR, S_VR);
422c2c66affSColin Finck FillTable(MainTable, 7, VL, S_VL);
423c2c66affSColin Finck FillTable(MainTable, 7, Ext, S_Ext);
424c2c66affSColin Finck FillTable(MainTable, 7, EOLV, S_EOL);
425c2c66affSColin Finck FillTable(WhiteTable, 12, MakeUpW, S_MakeUpW);
426c2c66affSColin Finck FillTable(WhiteTable, 12, MakeUp, S_MakeUp);
427c2c66affSColin Finck FillTable(WhiteTable, 12, TermW, S_TermW);
428c2c66affSColin Finck FillTable(WhiteTable, 12, EOLH, S_EOL);
429c2c66affSColin Finck FillTable(BlackTable, 13, MakeUpB, S_MakeUpB);
430c2c66affSColin Finck FillTable(BlackTable, 13, MakeUp, S_MakeUp);
431c2c66affSColin Finck FillTable(BlackTable, 13, TermB, S_TermB);
432c2c66affSColin Finck FillTable(BlackTable, 13, EOLH, S_EOL);
433c2c66affSColin Finck
434c2c66affSColin Finck fprintf(fd, "/* WARNING, this file was automatically generated by the\n");
435c2c66affSColin Finck fprintf(fd, " mkg3states program */\n");
436c2c66affSColin Finck fprintf(fd, "#include \"tiff.h\"\n");
437c2c66affSColin Finck fprintf(fd, "#include \"tif_fax3.h\"\n");
438c2c66affSColin Finck WriteTable(fd, MainTable, 128, "TIFFFaxMainTable");
439c2c66affSColin Finck WriteTable(fd, WhiteTable, 4096, "TIFFFaxWhiteTable");
440c2c66affSColin Finck WriteTable(fd, BlackTable, 8192, "TIFFFaxBlackTable");
441c2c66affSColin Finck fclose(fd);
442c2c66affSColin Finck return (0);
443c2c66affSColin Finck }
444c2c66affSColin Finck
445c2c66affSColin Finck /* vim: set ts=8 sts=8 sw=8 noet: */
446c2c66affSColin Finck /*
447c2c66affSColin Finck * Local Variables:
448c2c66affSColin Finck * mode: c
449c2c66affSColin Finck * c-basic-offset: 8
450c2c66affSColin Finck * fill-column: 78
451c2c66affSColin Finck * End:
452c2c66affSColin Finck */
453