ReactOS 0.4.16-dev-2613-g9533ad7
mkg3states.c File Reference
#include "libport.h"
#include "tif_config.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "tif_fax3.h"
Include dependency graph for mkg3states.c:

Go to the source code of this file.

Classes

struct  proto
 

Macros

#define streq(a, b)   (strcmp(a, b) == 0)
 

Functions

static void FillTable (TIFFFaxTabEnt *T, int Size, struct proto *P, int State)
 
void WriteTable (FILE *fd, const TIFFFaxTabEnt *T, int Size, const char *name)
 
int main (int argc, char *argv[])
 

Variables

TIFFFaxTabEnt MainTable [128]
 
TIFFFaxTabEnt WhiteTable [4096]
 
TIFFFaxTabEnt BlackTable [8192]
 
static struct proto Pass [] = {{0x0008, 4}, {0, 0}}
 
static struct proto Horiz [] = {{0x0004, 3}, {0, 0}}
 
static struct proto V0 [] = {{0x0001, 1}, {0, 0}}
 
static struct proto VR []
 
static struct proto VL []
 
static struct proto Ext [] = {{0x0040, 7}, {0, 0}}
 
static struct proto EOLV [] = {{0x0000, 7}, {0, 0}}
 
static struct proto MakeUpW []
 
static struct proto MakeUpB []
 
static struct proto MakeUp []
 
static struct proto TermW []
 
static struct proto TermB []
 
static struct proto EOLH [] = {{0x0000, 11}, {0, 0}}
 
static charstorage_class = ""
 
static charconst_class = ""
 
static int packoutput = 1
 
static charprebrace = ""
 
static charpostbrace = ""
 

Macro Definition Documentation

◆ streq

#define streq (   a,
  b 
)    (strcmp(a, b) == 0)

Definition at line 43 of file mkg3states.c.

Function Documentation

◆ FillTable()

static void FillTable ( TIFFFaxTabEnt T,
int  Size,
struct proto P,
int  State 
)
static

Definition at line 132 of file mkg3states.c.

133{
134 int limit = 1 << Size;
135
136 while (P->val)
137 {
138 int width = P->val & 15;
139 int param = P->val >> 4;
140 int incr = 1 << width;
141 int code;
142 for (code = P->code; code < limit; code += incr)
143 {
144 TIFFFaxTabEnt *E = T + code;
145 E->State = State;
146 E->Width = width;
147 E->Param = param;
148 }
149 P++;
150 }
151}
#define P(row, col)
static const WCHAR E[]
Definition: oid.c:1253
GLint GLint GLsizei width
Definition: gl.h:1546
GLint limit
Definition: glext.h:10326
GLfloat param
Definition: glext.h:5796
#define T(num)
Definition: thunks.c:311
Definition: inflate.c:139
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4539

Referenced by main().

◆ main()

int main ( int  argc,
char argv[] 
)

hosttype.c Copyright (C) 2002 by Brian Palmer brian.nosp@m.p@sg.nosp@m.inet..nosp@m.com

Definition at line 198 of file mkg3states.c.

199{
200 FILE *fd;
201 char *outputfile;
202 int c;
203
204#if !HAVE_DECL_OPTARG
205 extern int optind;
206 extern char *optarg;
207#endif
208
209 while ((c = getopt(argc, argv, "c:s:bp")) != -1)
210 switch (c)
211 {
212 case 'c':
214 break;
215 case 's':
217 break;
218 case 'p':
219 packoutput = 0;
220 break;
221 case 'b':
222 prebrace = "{";
223 postbrace = "}";
224 break;
225 case '?':
227 "usage: %s [-c const] [-s storage] [-p] [-b] file\n",
228 argv[0]);
229 return (-1);
230 }
231 outputfile = optind < argc ? argv[optind] : "g3states.h";
232 fd = fopen(outputfile, "w");
233 if (fd == NULL)
234 {
235 fprintf(stderr, "%s: %s: Cannot create output file.\n", argv[0],
236 outputfile);
237 return (-2);
238 }
254
255 fprintf(fd, "/* WARNING, this file was automatically generated by the\n");
256 fprintf(fd, " mkg3states program */\n");
257 fprintf(fd, "#include <stdint.h>\n");
258 fprintf(fd, "#include \"tiff.h\"\n");
259 fprintf(fd, "#include \"tif_fax3.h\"\n");
260 WriteTable(fd, MainTable, 128, "TIFFFaxMainTable");
261 WriteTable(fd, WhiteTable, 4096, "TIFFFaxWhiteTable");
262 WriteTable(fd, BlackTable, 8192, "TIFFFaxBlackTable");
263 fprintf(fd, "/*\n"
264 " * Local Variables:\n"
265 " * mode: c\n"
266 " * c-basic-offset: 8\n"
267 " * fill-column: 78\n"
268 " * End:\n"
269 " */\n");
270 fclose(fd);
271 return (0);
272}
int getopt(int nargc, char *const *nargv, const char *ostr)
Definition: getopt.c:55
const char * optarg
Definition: getopt.c:49
int optind
Definition: getopt.c:47
#define NULL
Definition: types.h:112
MonoAssembly int argc
Definition: metahost.c:107
int CDECL fclose(FILE *file)
Definition: file.c:3757
int WINAPIV fprintf(FILE *file, const char *format,...)
Definition: file.c:5549
FILE *CDECL fopen(const char *path, const char *mode)
Definition: file.c:4310
#define stderr
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
static char * prebrace
Definition: mkg3states.c:156
static struct proto EOLV[]
Definition: mkg3states.c:74
static struct proto Pass[]
Definition: mkg3states.c:56
static struct proto V0[]
Definition: mkg3states.c:60
static struct proto Ext[]
Definition: mkg3states.c:72
static void FillTable(TIFFFaxTabEnt *T, int Size, struct proto *P, int State)
Definition: mkg3states.c:132
TIFFFaxTabEnt BlackTable[8192]
Definition: mkg3states.c:48
static struct proto MakeUp[]
Definition: mkg3states.c:94
static struct proto TermW[]
Definition: mkg3states.c:100
TIFFFaxTabEnt WhiteTable[4096]
Definition: mkg3states.c:47
static char * const_class
Definition: mkg3states.c:154
static struct proto MakeUpW[]
Definition: mkg3states.c:76
static struct proto TermB[]
Definition: mkg3states.c:115
TIFFFaxTabEnt MainTable[128]
Definition: mkg3states.c:46
static struct proto VR[]
Definition: mkg3states.c:62
static struct proto EOLH[]
Definition: mkg3states.c:130
void WriteTable(FILE *fd, const TIFFFaxTabEnt *T, int Size, const char *name)
Definition: mkg3states.c:159
static int packoutput
Definition: mkg3states.c:155
static char * postbrace
Definition: mkg3states.c:157
static struct proto VL[]
Definition: mkg3states.c:67
static struct proto Horiz[]
Definition: mkg3states.c:58
static struct proto MakeUpB[]
Definition: mkg3states.c:85
#define argv
Definition: mplay32.c:18
static int fd
Definition: io.c:51
#define S_Ext
Definition: tif_fax3.h:76
#define S_MakeUpB
Definition: tif_fax3.h:80
#define S_TermW
Definition: tif_fax3.h:77
#define S_VR
Definition: tif_fax3.h:74
#define S_EOL
Definition: tif_fax3.h:82
#define S_MakeUp
Definition: tif_fax3.h:81
#define S_Pass
Definition: tif_fax3.h:71
#define S_VL
Definition: tif_fax3.h:75
#define S_Horiz
Definition: tif_fax3.h:72
#define S_TermB
Definition: tif_fax3.h:78
#define S_V0
Definition: tif_fax3.h:73
#define S_MakeUpW
Definition: tif_fax3.h:79
storage_class
Definition: widltypes.h:246

◆ WriteTable()

void WriteTable ( FILE fd,
const TIFFFaxTabEnt T,
int  Size,
const char name 
)

Definition at line 159 of file mkg3states.c.

160{
161 int i;
162 char *sep;
163
164 fprintf(fd, "%s %s TIFFFaxTabEnt %s[%d] = {", storage_class, const_class,
165 name, Size);
166 if (packoutput)
167 {
168 sep = "\n";
169 for (i = 0; i < Size; i++)
170 {
171 fprintf(fd, "%s%s%d,%d,%d%s", sep, prebrace, T->State, T->Width,
172 (int)T->Param, postbrace);
173 if (((i + 1) % 10) == 0)
174 sep = ",\n";
175 else
176 sep = ",";
177 T++;
178 }
179 }
180 else
181 {
182 sep = "\n ";
183 for (i = 0; i < Size; i++)
184 {
185 fprintf(fd, "%s%s%3d,%3d,%4d%s", sep, prebrace, T->State, T->Width,
186 (int)T->Param, postbrace);
187 if (((i + 1) % 6) == 0)
188 sep = ",\n ";
189 else
190 sep = ",";
191 T++;
192 }
193 }
194 fprintf(fd, "\n};\n");
195}
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
Definition: name.c:39

Referenced by main().

Variable Documentation

◆ BlackTable

TIFFFaxTabEnt BlackTable[8192]

Definition at line 48 of file mkg3states.c.

Referenced by main().

◆ const_class

char* const_class = ""
static

Definition at line 154 of file mkg3states.c.

Referenced by main(), and WriteTable().

◆ EOLH

struct proto EOLH[] = {{0x0000, 11}, {0, 0}}
static

Definition at line 130 of file mkg3states.c.

Referenced by main().

◆ EOLV

struct proto EOLV[] = {{0x0000, 7}, {0, 0}}
static

Definition at line 74 of file mkg3states.c.

Referenced by main().

◆ Ext

◆ Horiz

struct proto Horiz[] = {{0x0004, 3}, {0, 0}}
static

Definition at line 58 of file mkg3states.c.

Referenced by main().

◆ MainTable

TIFFFaxTabEnt MainTable[128]

Definition at line 46 of file mkg3states.c.

Referenced by main().

◆ MakeUp

struct proto MakeUp[]
static
Initial value:
= {
{0x0080, 28683}, {0x0180, 29707}, {0x0580, 30731}, {0x0480, 31756},
{0x0c80, 32780}, {0x0280, 33804}, {0x0a80, 34828}, {0x0680, 35852},
{0x0e80, 36876}, {0x0380, 37900}, {0x0b80, 38924}, {0x0780, 39948},
{0x0f80, 40972}, {0, 0}}

Definition at line 94 of file mkg3states.c.

Referenced by main().

◆ MakeUpB

struct proto MakeUpB[]
static
Initial value:
= {
{0x03c0, 1034}, {0x0130, 2060}, {0x0930, 3084}, {0x0da0, 4108},
{0x0cc0, 5132}, {0x02c0, 6156}, {0x0ac0, 7180}, {0x06c0, 8205},
{0x16c0, 9229}, {0x0a40, 10253}, {0x1a40, 11277}, {0x0640, 12301},
{0x1640, 13325}, {0x09c0, 14349}, {0x19c0, 15373}, {0x05c0, 16397},
{0x15c0, 17421}, {0x0dc0, 18445}, {0x1dc0, 19469}, {0x0940, 20493},
{0x1940, 21517}, {0x0540, 22541}, {0x1540, 23565}, {0x0b40, 24589},
{0x1b40, 25613}, {0x04c0, 26637}, {0x14c0, 27661}, {0, 0}}

Definition at line 85 of file mkg3states.c.

Referenced by main().

◆ MakeUpW

struct proto MakeUpW[]
static
Initial value:
= {
{0x001b, 1029}, {0x0009, 2053}, {0x003a, 3078}, {0x0076, 4103},
{0x006c, 5128}, {0x00ec, 6152}, {0x0026, 7176}, {0x00a6, 8200},
{0x0016, 9224}, {0x00e6, 10248}, {0x0066, 11273}, {0x0166, 12297},
{0x0096, 13321}, {0x0196, 14345}, {0x0056, 15369}, {0x0156, 16393},
{0x00d6, 17417}, {0x01d6, 18441}, {0x0036, 19465}, {0x0136, 20489},
{0x00b6, 21513}, {0x01b6, 22537}, {0x0032, 23561}, {0x0132, 24585},
{0x00b2, 25609}, {0x0006, 26630}, {0x01b2, 27657}, {0, 0}}

Definition at line 76 of file mkg3states.c.

Referenced by main().

◆ packoutput

int packoutput = 1
static

Definition at line 155 of file mkg3states.c.

Referenced by main(), and WriteTable().

◆ Pass

struct proto Pass[] = {{0x0008, 4}, {0, 0}}
static

Definition at line 56 of file mkg3states.c.

Referenced by main(), NtGdiCreateServerMetaFile(), and SetupLdrScanBootDrivers().

◆ postbrace

char* postbrace = ""
static

Definition at line 157 of file mkg3states.c.

Referenced by main(), and WriteTable().

◆ prebrace

char* prebrace = ""
static

Definition at line 156 of file mkg3states.c.

Referenced by main(), and WriteTable().

◆ storage_class

char* storage_class = ""
static

Definition at line 153 of file mkg3states.c.

◆ TermB

struct proto TermB[]
static
Initial value:
= {
{0x03b0, 10}, {0x0002, 19}, {0x0003, 34}, {0x0001, 50}, {0x0006, 67},
{0x000c, 84}, {0x0004, 100}, {0x0018, 117}, {0x0028, 134}, {0x0008, 150},
{0x0010, 167}, {0x0050, 183}, {0x0070, 199}, {0x0020, 216}, {0x00e0, 232},
{0x0030, 249}, {0x03a0, 266}, {0x0060, 282}, {0x0040, 298}, {0x0730, 315},
{0x00b0, 331}, {0x01b0, 347}, {0x0760, 363}, {0x00a0, 379}, {0x0740, 395},
{0x00c0, 411}, {0x0530, 428}, {0x0d30, 444}, {0x0330, 460}, {0x0b30, 476},
{0x0160, 492}, {0x0960, 508}, {0x0560, 524}, {0x0d60, 540}, {0x04b0, 556},
{0x0cb0, 572}, {0x02b0, 588}, {0x0ab0, 604}, {0x06b0, 620}, {0x0eb0, 636},
{0x0360, 652}, {0x0b60, 668}, {0x05b0, 684}, {0x0db0, 700}, {0x02a0, 716},
{0x0aa0, 732}, {0x06a0, 748}, {0x0ea0, 764}, {0x0260, 780}, {0x0a60, 796},
{0x04a0, 812}, {0x0ca0, 828}, {0x0240, 844}, {0x0ec0, 860}, {0x01c0, 876},
{0x0e40, 892}, {0x0140, 908}, {0x01a0, 924}, {0x09a0, 940}, {0x0d40, 956},
{0x0340, 972}, {0x05a0, 988}, {0x0660, 1004}, {0x0e60, 1020}, {0, 0}}

Definition at line 115 of file mkg3states.c.

Referenced by main().

◆ TermW

struct proto TermW[]
static
Initial value:
= {
{0x00ac, 8}, {0x0038, 22}, {0x000e, 36}, {0x0001, 52}, {0x000d, 68},
{0x0003, 84}, {0x0007, 100}, {0x000f, 116}, {0x0019, 133}, {0x0005, 149},
{0x001c, 165}, {0x0002, 181}, {0x0004, 198}, {0x0030, 214}, {0x000b, 230},
{0x002b, 246}, {0x0015, 262}, {0x0035, 278}, {0x0072, 295}, {0x0018, 311},
{0x0008, 327}, {0x0074, 343}, {0x0060, 359}, {0x0010, 375}, {0x000a, 391},
{0x006a, 407}, {0x0064, 423}, {0x0012, 439}, {0x000c, 455}, {0x0040, 472},
{0x00c0, 488}, {0x0058, 504}, {0x00d8, 520}, {0x0048, 536}, {0x00c8, 552},
{0x0028, 568}, {0x00a8, 584}, {0x0068, 600}, {0x00e8, 616}, {0x0014, 632},
{0x0094, 648}, {0x0054, 664}, {0x00d4, 680}, {0x0034, 696}, {0x00b4, 712},
{0x0020, 728}, {0x00a0, 744}, {0x0050, 760}, {0x00d0, 776}, {0x004a, 792},
{0x00ca, 808}, {0x002a, 824}, {0x00aa, 840}, {0x0024, 856}, {0x00a4, 872},
{0x001a, 888}, {0x009a, 904}, {0x005a, 920}, {0x00da, 936}, {0x0052, 952},
{0x00d2, 968}, {0x004c, 984}, {0x00cc, 1000}, {0x002c, 1016}, {0, 0}}

Definition at line 100 of file mkg3states.c.

Referenced by main().

◆ V0

struct proto V0[] = {{0x0001, 1}, {0, 0}}
static

Definition at line 60 of file mkg3states.c.

Referenced by main().

◆ VL

struct proto VL[]
static
Initial value:
= {{0x0002, (1 << 4) + 3},
{0x0010, (2 << 4) + 6},
{0x0020, (3 << 4) + 7},
{0, 0}}

Definition at line 67 of file mkg3states.c.

Referenced by main().

◆ VR

struct proto VR[]
static
Initial value:
= {{0x0006, (1 << 4) + 3},
{0x0030, (2 << 4) + 6},
{0x0060, (3 << 4) + 7},
{0, 0}}

Definition at line 62 of file mkg3states.c.

Referenced by main().

◆ WhiteTable

TIFFFaxTabEnt WhiteTable[4096]

Definition at line 47 of file mkg3states.c.

Referenced by main().