ReactOS  0.4.14-dev-552-g2fad488
wpp_private.h File Reference
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "windef.h"
Include dependency graph for wpp_private.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  includelogicentry
 
struct  marg
 
struct  mtext
 
struct  pp_entry
 
struct  include_state_t
 
struct  cval
 
struct  pp_status
 

Macros

#define MAXIFSTACK   64 /* If this isn't enough you should alter the source... */
 
#define SIZE_CHAR   1
 
#define SIZE_SHORT   2
 
#define SIZE_INT   3
 
#define SIZE_LONG   4
 
#define SIZE_LONGLONG   5
 
#define SIZE_MASK   0x00ff
 
#define FLAG_SIGNED   0x0100
 
#define __attribute__(x)   /*nothing*/
 

Typedefs

typedef struct includelogicentry includelogicentry_t
 
typedef struct marg marg_t
 
typedef struct mtext mtext_t
 
typedef struct pp_entry pp_entry_t
 
typedef struct cval cval_t
 

Enumerations

enum  def_arg_t { arg_single, arg_list, arg_single, arg_list }
 
enum  def_exp_t {
  exp_text, exp_concat, exp_stringize, exp_subst,
  exp_text, exp_concat, exp_stringize, exp_subst
}
 
enum  def_type_t {
  def_none, def_define, def_macro, def_special,
  def_none, def_define, def_macro, def_special
}
 
enum  pp_if_state_t {
  if_false, if_true, if_elif, if_elsefalse,
  if_elsetrue, if_ignore, if_error, if_false,
  if_true, if_elif, if_elsefalse, if_elsetrue,
  if_ignore, if_error
}
 
enum  ctype_t {
  cv_sint = SIZE_INT + FLAG_SIGNED, cv_uint = SIZE_INT, cv_slong = SIZE_LONG + FLAG_SIGNED, cv_ulong = SIZE_LONG,
  cv_sll = SIZE_LONGLONG + FLAG_SIGNED, cv_ull = SIZE_LONGLONG, cv_sint = SIZE_INT + FLAG_SIGNED, cv_uint = SIZE_INT,
  cv_slong = SIZE_LONG + FLAG_SIGNED, cv_ulong = SIZE_LONG, cv_sll = SIZE_LONGLONG + FLAG_SIGNED, cv_ull = SIZE_LONGLONG
}
 

Functions

int wpp_add_define (const char *name, const char *value)
 
void wpp_del_define (const char *name)
 
charwpp_lookup (const char *filename, int type, const char *parent_name)
 
voidwpp_open (const char *filename, int type)
 
void wpp_close (void *file)
 
int wpp_read (void *file, char *buffer, unsigned int len)
 
void wpp_write (const char *buffer, unsigned int len)
 
int wpp_parse (const char *input, FILE *output)
 
voidpp_xmalloc (size_t)
 
voidpp_xrealloc (void *, size_t)
 
charpp_xstrdup (const char *str)
 
pp_entry_tpplookup (const char *ident)
 
int pp_push_define_state (void)
 
void pp_pop_define_state (void)
 
pp_entry_tpp_add_define (const char *def, const char *text)
 
pp_entry_tpp_add_macro (char *ident, marg_t *args[], int nargs, mtext_t *exp)
 
void pp_del_define (const char *name)
 
voidpp_open_include (const char *name, int type, const char *parent_name, char **newpath)
 
void pp_push_if (pp_if_state_t s)
 
void pp_next_if_state (int)
 
pp_if_state_t pp_pop_if (void)
 
pp_if_state_t pp_if_state (void)
 
int pp_get_if_depth (void)
 
int WINAPIV ppy_error (const char *s,...) __attribute__((format(printf
 
int WINAPIV int WINAPIV ppy_warning (const char *s,...) __attribute__((format(printf
 
int WINAPIV int WINAPIV void WINAPIV pp_internal_error (const char *file, int line, const char *s,...) __attribute__((format(printf
 
int ppy_lex (void)
 
void pp_do_include (char *fname, int type)
 
void pp_push_ignore_state (void)
 
void pp_pop_ignore_state (void)
 
void WINAPIV pp_writestring (const char *format,...) __attribute__((format(printf
 
void WINAPIV int ppy_parse (void)
 

Variables

const struct wpp_callbackswpp_callbacks
 
struct pp_status pp_status
 
include_state_t pp_incl_state
 
includelogicentry_tpp_includelogiclist
 
FILEppy_out = (FILE *) 0
 
charppy_text
 

Macro Definition Documentation

◆ __attribute__

#define __attribute__ (   x)    /*nothing*/

Definition at line 207 of file wpp_private.h.

◆ FLAG_SIGNED

#define FLAG_SIGNED   0x0100

Definition at line 153 of file wpp_private.h.

◆ MAXIFSTACK

#define MAXIFSTACK   64 /* If this isn't enough you should alter the source... */

Definition at line 116 of file wpp_private.h.

◆ SIZE_CHAR

#define SIZE_CHAR   1

Definition at line 147 of file wpp_private.h.

◆ SIZE_INT

#define SIZE_INT   3

Definition at line 149 of file wpp_private.h.

◆ SIZE_LONG

#define SIZE_LONG   4

Definition at line 150 of file wpp_private.h.

◆ SIZE_LONGLONG

#define SIZE_LONGLONG   5

Definition at line 151 of file wpp_private.h.

◆ SIZE_MASK

#define SIZE_MASK   0x00ff

Definition at line 152 of file wpp_private.h.

◆ SIZE_SHORT

#define SIZE_SHORT   2

Definition at line 148 of file wpp_private.h.

Typedef Documentation

◆ cval_t

typedef struct cval cval_t

◆ includelogicentry_t

◆ marg_t

typedef struct marg marg_t

◆ mtext_t

typedef struct mtext mtext_t

◆ pp_entry_t

Enumeration Type Documentation

◆ ctype_t

Enumerator
cv_sint 
cv_uint 
cv_slong 
cv_ulong 
cv_sll 
cv_ull 
cv_sint 
cv_uint 
cv_slong 
cv_ulong 
cv_sll 
cv_ull 

Definition at line 155 of file wpp_private.h.

155  {
156 #if 0
157  cv_schar = SIZE_CHAR + FLAG_SIGNED,
158  cv_uchar = SIZE_CHAR,
159  cv_sshort = SIZE_SHORT + FLAG_SIGNED,
160  cv_ushort = SIZE_SHORT,
161 #endif
163  cv_uint = SIZE_INT,
168 } ctype_t;
#define FLAG_SIGNED
Definition: wpp_private.h:153
#define SIZE_LONG
Definition: wpp_private.h:150
#define SIZE_INT
Definition: wpp_private.h:149
#define SIZE_CHAR
Definition: wpp_private.h:147
#define SIZE_SHORT
Definition: wpp_private.h:148
ctype_t
Definition: wpp_private.h:155
#define SIZE_LONGLONG
Definition: wpp_private.h:151

◆ def_arg_t

Enumerator
arg_single 
arg_list 
arg_single 
arg_list 

Definition at line 54 of file wpp_private.h.

54  {
55  arg_single,
56  arg_list
57 } def_arg_t;
def_arg_t
Definition: wpp_private.h:54

◆ def_exp_t

Enumerator
exp_text 
exp_concat 
exp_stringize 
exp_subst 
exp_text 
exp_concat 
exp_stringize 
exp_subst 

Definition at line 68 of file wpp_private.h.

68  {
69  exp_text, /* Simple text substitution */
70  exp_concat, /* Concat (##) operator requested */
71  exp_stringize, /* Stringize (#) operator requested */
72  exp_subst /* Substitute argument */
73 } def_exp_t;
def_exp_t
Definition: wpp_private.h:68

◆ def_type_t

Enumerator
def_none 
def_define 
def_macro 
def_special 
def_none 
def_define 
def_macro 
def_special 

Definition at line 88 of file wpp_private.h.

88  {
89  def_none, /* Not-a-define; used as return value */
90  def_define, /* Simple defines */
91  def_macro, /* Macro defines */
92  def_special /* Special expansions like __LINE__ and __FILE__ */
93 } def_type_t;
def_type_t
Definition: wpp_private.h:88

◆ pp_if_state_t

Enumerator
if_false 
if_true 
if_elif 
if_elsefalse 
if_elsetrue 
if_ignore 
if_error 
if_false 
if_true 
if_elif 
if_elsefalse 
if_elsetrue 
if_ignore 
if_error 

Definition at line 118 of file wpp_private.h.

Function Documentation

◆ pp_add_define()

pp_entry_t* pp_add_define ( const char def,
const char text 
)

Definition at line 194 of file preproc.c.

195 {
196  int len;
197  char *cptr;
198  int idx;
199  pp_entry_t *ppp;
200 
201  if(!def)
202  return NULL;
203  idx = pphash(def);
204  if((ppp = pplookup(def)) != NULL)
205  {
206  if(pp_status.pedantic)
207  ppy_warning("Redefinition of %s\n\tPrevious definition: %s:%d", def, ppp->filename, ppp->linenumber);
208  pp_del_define(def);
209  }
210  ppp = pp_xmalloc(sizeof(pp_entry_t));
211  if(!ppp)
212  return NULL;
213  memset( ppp, 0, sizeof(*ppp) );
214  ppp->ident = pp_xstrdup(def);
215  if(!ppp->ident)
216  goto error;
217  ppp->type = def_define;
218  ppp->subst.text = text ? pp_xstrdup(text) : NULL;
219  if(text && !ppp->subst.text)
220  goto error;
221  ppp->filename = pp_xstrdup(pp_status.input ? pp_status.input : "<internal or cmdline>");
222  if(!ppp->filename)
223  goto error;
225  ppp->next = pp_def_state->defines[idx];
226  pp_def_state->defines[idx] = ppp;
227  if(ppp->next)
228  ppp->next->prev = ppp;
229  if(ppp->subst.text)
230  {
231  /* Strip trailing white space from subst text */
232  len = strlen(ppp->subst.text);
233  while(len && strchr(" \t\r\n", ppp->subst.text[len-1]))
234  {
235  ppp->subst.text[--len] = '\0';
236  }
237  /* Strip leading white space from subst text */
238  for(cptr = ppp->subst.text; *cptr && strchr(" \t\r", *cptr); cptr++)
239  ;
240  if(ppp->subst.text != cptr)
241  memmove(ppp->subst.text, cptr, strlen(cptr)+1);
242  }
243  return ppp;
244 
245 error:
246  free(ppp->ident);
247  free(ppp->subst.text);
248  free(ppp);
249  return NULL;
250 }
pp_entry_t * defines[HASHKEY]
Definition: preproc.c:36
#define memmove(s1, s2, n)
Definition: mkisofs.h:881
union pp_entry::@239 subst
char * text
Definition: wpp_private.h:104
#define error(str)
Definition: mkdosfs.c:1605
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
const WCHAR * text
Definition: package.c:1827
#define free
Definition: debug_ros.c:5
char * ident
Definition: wpp_private.h:99
int line_number
Definition: wpp_private.h:222
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
static int pphash(const char *str)
Definition: preproc.c:87
int linenumber
Definition: wpp_private.h:108
char * input
Definition: wpp_private.h:220
int ppy_warning(const char *s,...)
Definition: preproc.c:745
char * pp_xstrdup(const char *str)
Definition: preproc.c:73
Definition: wpp_private.h:95
void pp_del_define(const char *name)
Definition: preproc.c:176
char * filename
Definition: wpp_private.h:107
GLenum GLsizei len
Definition: glext.h:6722
pp_entry_t * pplookup(const char *ident)
Definition: preproc.c:95
char * strchr(const char *String, int ch)
Definition: utclib.c:501
struct pp_entry * next
Definition: wpp_private.h:96
def_type_t type
Definition: wpp_private.h:98
void * pp_xmalloc(size_t size)
Definition: preproc.c:45
int pedantic
Definition: wpp_private.h:225
#define memset(x, y, z)
Definition: compat.h:39

◆ pp_add_macro()

pp_entry_t* pp_add_macro ( char ident,
marg_t args[],
int  nargs,
mtext_t exp 
)

Definition at line 252 of file preproc.c.

253 {
254  int idx;
255  pp_entry_t *ppp;
256 
257  if(!id)
258  return NULL;
259  idx = pphash(id);
260  if((ppp = pplookup(id)) != NULL)
261  {
262  if(pp_status.pedantic)
263  ppy_warning("Redefinition of %s\n\tPrevious definition: %s:%d", id, ppp->filename, ppp->linenumber);
264  pp_del_define(id);
265  }
266  ppp = pp_xmalloc(sizeof(pp_entry_t));
267  if(!ppp)
268  return NULL;
269  memset( ppp, 0, sizeof(*ppp) );
270  ppp->ident = id;
271  ppp->type = def_macro;
272  ppp->margs = args;
273  ppp->nargs = nargs;
274  ppp->subst.mtext= exp;
275  ppp->filename = pp_xstrdup(pp_status.input ? pp_status.input : "<internal or cmdline>");
276  if(!ppp->filename)
277  {
278  free(ppp);
279  return NULL;
280  }
282  ppp->next = pp_def_state->defines[idx];
283  pp_def_state->defines[idx] = ppp;
284  if(ppp->next)
285  ppp->next->prev = ppp;
286  return ppp;
287 }
pp_entry_t * defines[HASHKEY]
Definition: preproc.c:36
int nargs
Definition: wpp_private.h:101
union pp_entry::@239 subst
#define free
Definition: debug_ros.c:5
char * ident
Definition: wpp_private.h:99
int line_number
Definition: wpp_private.h:222
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
static int pphash(const char *str)
Definition: preproc.c:87
mtext_t * mtext
Definition: wpp_private.h:103
int linenumber
Definition: wpp_private.h:108
char * input
Definition: wpp_private.h:220
int ppy_warning(const char *s,...)
Definition: preproc.c:745
char * pp_xstrdup(const char *str)
Definition: preproc.c:73
Definition: wpp_private.h:95
void pp_del_define(const char *name)
Definition: preproc.c:176
char * filename
Definition: wpp_private.h:107
pp_entry_t * pplookup(const char *ident)
Definition: preproc.c:95
marg_t ** margs
Definition: wpp_private.h:100
DWORD exp
Definition: msg.c:16038
struct pp_entry * next
Definition: wpp_private.h:96
def_type_t type
Definition: wpp_private.h:98
void * pp_xmalloc(size_t size)
Definition: preproc.c:45
GLenum GLuint id
Definition: glext.h:5579
int pedantic
Definition: wpp_private.h:225
#define memset(x, y, z)
Definition: compat.h:39
#define args
Definition: format.c:66

◆ pp_del_define()

void pp_del_define ( const char name)

Definition at line 176 of file preproc.c.

177 {
178  pp_entry_t *ppp;
179  int idx = pphash(name);
180 
181  if((ppp = pplookup(name)) == NULL)
182  {
183  if(pp_status.pedantic)
184  ppy_warning("%s was not defined", name);
185  return;
186  }
187 
188  free( ppp->ident );
189  free( ppp->subst.text );
190  free( ppp->filename );
191  free_pp_entry( ppp, idx );
192 }
union pp_entry::@239 subst
char * text
Definition: wpp_private.h:104
#define free
Definition: debug_ros.c:5
char * ident
Definition: wpp_private.h:99
static void free_pp_entry(pp_entry_t *ppp, int idx)
Definition: preproc.c:111
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
static int pphash(const char *str)
Definition: preproc.c:87
int ppy_warning(const char *s,...)
Definition: preproc.c:745
Definition: wpp_private.h:95
char * filename
Definition: wpp_private.h:107
pp_entry_t * pplookup(const char *ident)
Definition: preproc.c:95
Definition: name.c:38
int pedantic
Definition: wpp_private.h:225

◆ pp_do_include()

void pp_do_include ( char fname,
int  type 
)

Definition at line 4687 of file ppl.yy.c.

4688 {
4689  char *newpath;
4690  int n;
4691  includelogicentry_t *iep;
4692  void *fp;
4693 
4694  if(!fname)
4695  return;
4696 
4697  for(iep = pp_includelogiclist; iep; iep = iep->next)
4698  {
4699  if(!strcmp(iep->filename, fname))
4700  {
4701  /*
4702  * We are done. The file was included before.
4703  * If the define was deleted, then this entry would have
4704  * been deleted too.
4705  */
4706  free(fname);
4707  return;
4708  }
4709  }
4710 
4711  n = strlen(fname);
4712 
4713  if(n <= 2)
4714  {
4715  ppy_error("Empty include filename");
4716  free(fname);
4717  return;
4718  }
4719 
4720  /* Undo the effect of the quotation */
4721  fname[n-1] = '\0';
4722 
4723  if((fp = pp_open_include(fname+1, type, pp_status.input, &newpath)) == NULL)
4724  {
4725  ppy_error("Unable to open include file %s", fname+1);
4726  free(fname);
4727  return;
4728  }
4729 
4730  fname[n-1] = *fname; /* Redo the quotes */
4731  push_buffer(NULL, newpath, fname, 0);
4733  pp_incl_state.state = 0;
4735 
4736  pp_status.file = fp;
4738 
4739  pp_writestring("# 1 \"%s\" 1%s\n", newpath, type ? "" : " 3");
4740 }
int WINAPIV ppy_error(const char *msg,...)
Definition: compiler.c:135
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define free
Definition: debug_ros.c:5
GLdouble n
Definition: glext.h:7729
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
void ppy__switch_to_buffer(YY_BUFFER_STATE new_buffer)
Definition: ppl.yy.c:3165
void * pp_open_include(const char *name, int type, const char *parent_name, char **newpath)
Definition: preproc.c:290
smooth NULL
Definition: ftsmooth.c:416
char * input
Definition: wpp_private.h:220
includelogicentry_t * pp_includelogiclist
Definition: ppl.yy.c:1547
static void push_buffer(pp_entry_t *ppp, char *filename, char *incname, int pop)
Definition: ppl.yy.c:4434
include_state_t pp_incl_state
Definition: ppl.yy.c:1539
YY_BUFFER_STATE ppy__create_buffer(FILE *file, int size)
Definition: ppl.yy.c:3210
struct includelogicentry * next
Definition: wpp_private.h:45
void WINAPIV pp_writestring(const char *format,...)
Definition: ppl.yy.c:1556
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
void * file
Definition: wpp_private.h:221
#define YY_BUF_SIZE
Definition: ppl.yy.c:399

◆ pp_get_if_depth()

int pp_get_if_depth ( void  )

Definition at line 433 of file preproc.c.

434 {
435  return if_stack_idx;
436 }
static int if_stack_idx
Definition: preproc.c:43

◆ pp_if_state()

pp_if_state_t pp_if_state ( void  )

Definition at line 405 of file preproc.c.

406 {
407  if(!if_stack_idx)
408  return if_true;
409  else
410  return if_stack[if_stack_idx-1];
411 }
static pp_if_state_t if_stack[MAXIFSTACK]
Definition: preproc.c:42
static int if_stack_idx
Definition: preproc.c:43

◆ pp_internal_error()

int WINAPIV int WINAPIV void WINAPIV pp_internal_error ( const char file,
int  line,
const char s,
  ... 
)

◆ pp_next_if_state()

void pp_next_if_state ( int  )

Definition at line 414 of file preproc.c.

415 {
416  switch(pp_if_state())
417  {
418  case if_true:
419  case if_elsetrue:
421  break;
422  case if_false:
423  case if_elsefalse:
424  case if_elif:
425  case if_ignore:
427  break;
428  default:
429  pp_internal_error(__FILE__, __LINE__, "Invalid pp_if_state (%d) in #{if,ifdef,ifndef} directive", (int)pp_if_state());
430  }
431 }
void WINAPIV pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:438
void pp_push_if(pp_if_state_t s)
Definition: preproc.c:357
pp_if_state_t pp_if_state(void)
Definition: preproc.c:405
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

◆ pp_open_include()

void* pp_open_include ( const char name,
int  type,
const char parent_name,
char **  newpath 
)

Definition at line 290 of file preproc.c.

291 {
292  char *path;
293  void *fp;
294 
295  if (!(path = wpp_lookup(name, type, parent_name))) return NULL;
296  fp = wpp_open(path, type);
297 
298  if (fp)
299  {
300  if (newpath) *newpath = path;
301  else free( path );
302  return fp;
303  }
304  free( path );
305  return NULL;
306 }
GLsizei const GLchar ** path
Definition: glext.h:7234
#define free
Definition: debug_ros.c:5
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
smooth NULL
Definition: ftsmooth.c:416
void * wpp_open(const char *filename, int type)
Definition: compiler.c:195
char * wpp_lookup(const char *filename, int type, const char *parent_name)
Definition: compiler.c:162
Definition: name.c:38

◆ pp_pop_define_state()

void pp_pop_define_state ( void  )

Definition at line 161 of file preproc.c.

162 {
163  int i;
164  pp_entry_t *ppp;
166 
167  for (i = 0; i < HASHKEY; i++)
168  {
169  while ((ppp = pp_def_state->defines[i]) != NULL) pp_del_define( ppp->ident );
170  }
172  pp_def_state = state->next;
173  free( state );
174 }
pp_entry_t * defines[HASHKEY]
Definition: preproc.c:36
static pp_def_state_t * pp_def_state
Definition: preproc.c:39
#define free
Definition: debug_ros.c:5
char * ident
Definition: wpp_private.h:99
#define HASHKEY
Definition: preproc.c:31
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
smooth NULL
Definition: ftsmooth.c:416
Definition: wpp_private.h:95
static int state
Definition: maze.c:121
void pp_del_define(const char *name)
Definition: preproc.c:176

◆ pp_pop_if()

pp_if_state_t pp_pop_if ( void  )

Definition at line 380 of file preproc.c.

381 {
382  if(if_stack_idx <= 0)
383  {
384  ppy_error("#{endif,else,elif} without #{if,ifdef,ifndef} (#if-stack underflow)");
385  return if_error;
386  }
387 
388  switch(pp_if_state())
389  {
390  case if_true:
391  case if_elsetrue:
392  break;
393  case if_false:
394  case if_elsefalse:
395  case if_elif:
396  case if_ignore:
398  break;
399  default:
400  pp_internal_error(__FILE__, __LINE__, "Invalid pp_if_state (%d)", (int)pp_if_state());
401  }
402  return if_stack[--if_stack_idx];
403 }
void WINAPIV pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:438
pp_if_state_t pp_if_state(void)
Definition: preproc.c:405
int ppy_error(const char *s,...)
Definition: preproc.c:735
static pp_if_state_t if_stack[MAXIFSTACK]
Definition: preproc.c:42
static int if_stack_idx
Definition: preproc.c:43
void pp_pop_ignore_state(void)
Definition: ppl.yy.c:4753

◆ pp_pop_ignore_state()

void pp_pop_ignore_state ( void  )

Definition at line 4753 of file ppl.yy.c.

4754 {
4755  yy_pop_state();
4756 }
static void yy_pop_state(void)

◆ pp_push_define_state()

int pp_push_define_state ( void  )

Definition at line 148 of file preproc.c.

149 {
150  pp_def_state_t *state = pp_xmalloc( sizeof(*state) );
151  if(!state)
152  return 1;
153 
154  memset( state->defines, 0, sizeof(state->defines) );
155  state->next = pp_def_state;
157  return 0;
158 }
static pp_def_state_t * pp_def_state
Definition: preproc.c:39
static int state
Definition: maze.c:121
void * pp_xmalloc(size_t size)
Definition: preproc.c:45
#define memset(x, y, z)
Definition: compat.h:39

◆ pp_push_if()

void pp_push_if ( pp_if_state_t  s)

Definition at line 357 of file preproc.c.

358 {
359  if(if_stack_idx >= MAXIFSTACK)
360  pp_internal_error(__FILE__, __LINE__, "#if-stack overflow; #{if,ifdef,ifndef} nested too deeply (> %d)", MAXIFSTACK);
361 
362  if_stack[if_stack_idx++] = s;
363 
364  switch(s)
365  {
366  case if_true:
367  case if_elsetrue:
368  break;
369  case if_false:
370  case if_elsefalse:
371  case if_elif:
372  case if_ignore:
374  break;
375  default:
376  pp_internal_error(__FILE__, __LINE__, "Invalid pp_if_state (%d)", (int)pp_if_state());
377  }
378 }
void WINAPIV pp_internal_error(const char *file, int line, const char *s,...)
Definition: preproc.c:438
pp_if_state_t pp_if_state(void)
Definition: preproc.c:405
static pp_if_state_t if_stack[MAXIFSTACK]
Definition: preproc.c:42
GLdouble s
Definition: gl.h:2039
void pp_push_ignore_state(void)
Definition: ppl.yy.c:4748
static int if_stack_idx
Definition: preproc.c:43
#define MAXIFSTACK
Definition: preproc.c:41

◆ pp_push_ignore_state()

void pp_push_ignore_state ( void  )

Definition at line 4748 of file ppl.yy.c.

4749 {
4751 }
#define pp_ignore
Definition: ppl.yy.c:1627
static void yy_push_state(int _new_state)

◆ pp_writestring()

void WINAPIV pp_writestring ( const char format,
  ... 
)

◆ pp_xmalloc()

void* pp_xmalloc ( size_t  )

Definition at line 45 of file preproc.c.

46 {
47  void *res;
48 
49  assert(size > 0);
50  res = malloc(size);
51  if(res == NULL)
52  {
53  /* Set the error flag */
54  pp_status.state = 1;
55  }
56  return res;
57 }
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
#define malloc
Definition: debug_ros.c:4

◆ pp_xrealloc()

void* pp_xrealloc ( void ,
size_t   
)

Definition at line 59 of file preproc.c.

60 {
61  void *res;
62 
63  assert(size > 0);
64  res = realloc(p, size);
65  if(res == NULL)
66  {
67  /* Set the error flag */
68  pp_status.state = 1;
69  }
70  return res;
71 }
#define realloc
Definition: debug_ros.c:6
#define assert(x)
Definition: debug.h:53
smooth NULL
Definition: ftsmooth.c:416
GLsizeiptr size
Definition: glext.h:5919
GLuint res
Definition: glext.h:9613
GLfloat GLfloat p
Definition: glext.h:8902

◆ pp_xstrdup()

char* pp_xstrdup ( const char str)

Definition at line 73 of file preproc.c.

74 {
75  char *s;
76  int len;
77 
78  assert(str != NULL);
79  len = strlen(str)+1;
80  s = pp_xmalloc(len);
81  if(!s)
82  return NULL;
83  return memcpy(s, str, len);
84 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
#define assert(x)
Definition: debug.h:53
const WCHAR * str
smooth NULL
Definition: ftsmooth.c:416
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
GLdouble s
Definition: gl.h:2039
void * pp_xmalloc(size_t size)
Definition: preproc.c:45

◆ pplookup()

pp_entry_t* pplookup ( const char ident)

Definition at line 95 of file preproc.c.

96 {
97  int idx;
98  pp_entry_t *ppp;
99 
100  if(!ident)
101  return NULL;
102  idx = pphash(ident);
103  for(ppp = pp_def_state->defines[idx]; ppp; ppp = ppp->next)
104  {
105  if(!strcmp(ident, ppp->ident))
106  return ppp;
107  }
108  return NULL;
109 }
pp_entry_t * defines[HASHKEY]
Definition: preproc.c:36
char * ident
Definition: wpp_private.h:99
unsigned int idx
Definition: utils.c:41
smooth NULL
Definition: ftsmooth.c:416
static int pphash(const char *str)
Definition: preproc.c:87
_In_ ULONG _In_ ULONG_PTR ident
Definition: winddi.h:3993
Definition: wpp_private.h:95
struct pp_entry * next
Definition: wpp_private.h:96
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ ppy_error()

int WINAPIV ppy_error ( const char s,
  ... 
)

◆ ppy_lex()

int ppy_lex ( void  )

◆ ppy_parse()

void WINAPIV int ppy_parse ( void  )

◆ ppy_warning()

int WINAPIV int WINAPIV ppy_warning ( const char s,
  ... 
)

◆ wpp_add_define()

int wpp_add_define ( const char name,
const char value 
)

Definition at line 377 of file compiler.c.

378 {
379  struct define *def;
380 
381  if (!value) value = "";
382 
383  for (def = cmdline_defines; def; def = def->next)
384  {
385  if (!strcmp( def->name, name ))
386  {
387  char *new_value = pp_xstrdup(value);
388  if(!new_value)
389  return 1;
390  free( def->value );
391  def->value = new_value;
392 
393  return 0;
394  }
395  }
396 
397  def = pp_xmalloc( sizeof(*def) );
398  if(!def)
399  return 1;
400  def->next = cmdline_defines;
401  def->name = pp_xstrdup(name);
402  if(!def->name)
403  {
404  free(def);
405  return 1;
406  }
407  def->value = pp_xstrdup(value);
408  if(!def->value)
409  {
410  free(def->name);
411  free(def);
412  return 1;
413  }
414  cmdline_defines = def;
415  return 0;
416 }
#define free
Definition: debug_ros.c:5
static struct define * cmdline_defines
Definition: compiler.c:70
char * pp_xstrdup(const char *str)
Definition: preproc.c:73
char * name
Definition: compiler.c:66
char * value
Definition: compiler.c:67
struct define * next
Definition: compiler.c:65
Definition: name.c:38
void * pp_xmalloc(size_t size)
Definition: preproc.c:45
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ wpp_close()

void wpp_close ( void file)

Definition at line 258 of file compiler.c.

259 {
260  struct mem_file_desc *desc = file;
261 
262  if(desc != &current_shader)
263  {
264  if(current_include)
265  ID3DInclude_Close(current_include, desc->buffer);
266  else
267  ERR("current_include == NULL, desc == %p, buffer = %s\n",
268  desc, desc->buffer);
269 
271  }
272 }
static ID3DInclude * current_include
Definition: compiler.c:42
static struct mem_file_desc current_shader
Definition: compiler.c:41
static const WCHAR desc[]
Definition: protectdata.c:36
#define GetProcessHeap()
Definition: compat.h:403
const char file[]
Definition: icontest.c:11
#define ERR(fmt,...)
Definition: debug.h:109
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by pop_buffer(), and wpp_parse().

◆ wpp_del_define()

void wpp_del_define ( const char name)

Definition at line 420 of file compiler.c.

421 {
422  struct define *def;
423 
424  for (def = cmdline_defines; def; def = def->next)
425  {
426  if (!strcmp( def->name, name ))
427  {
428  free( def->value );
429  def->value = NULL;
430  return;
431  }
432  }
433 }
#define free
Definition: debug_ros.c:5
static struct define * cmdline_defines
Definition: compiler.c:70
smooth NULL
Definition: ftsmooth.c:416
char * name
Definition: compiler.c:66
char * value
Definition: compiler.c:67
struct define * next
Definition: compiler.c:65
Definition: name.c:38
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469

◆ wpp_lookup()

char* wpp_lookup ( const char filename,
int  type,
const char parent_name 
)

Definition at line 162 of file compiler.c.

163 {
164  /* We don't check for file existence here. We will potentially fail on
165  * the following wpp_open_mem(). */
166  char *path;
167  int i;
168 
169  TRACE("Looking for include %s, parent %s.\n", debugstr_a(filename), debugstr_a(parent_name));
170 
172  if (strcmp(parent_name, initial_filename))
173  {
174  for(i = 0; i < includes_size; i++)
175  {
176  if(!strcmp(parent_name, includes[i].name))
177  {
178  parent_include = includes[i].data;
179  break;
180  }
181  }
182  if(parent_include == NULL)
183  {
184  ERR("Parent include %s missing.\n", debugstr_a(parent_name));
185  return NULL;
186  }
187  }
188 
189  path = malloc(strlen(filename) + 1);
190  if(path)
192  return path;
193 }
ACPI_SIZE strlen(const char *String)
Definition: utclib.c:269
GLsizei const GLchar ** path
Definition: glext.h:7234
const char * filename
Definition: ioapi.h:135
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
smooth NULL
Definition: ftsmooth.c:416
static struct loaded_include * includes
Definition: compiler.c:53
#define TRACE(s)
Definition: solgame.cpp:4
#define debugstr_a
Definition: kernel32.h:31
static const char * initial_filename
Definition: compiler.c:43
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static const char * parent_include
Definition: compiler.c:55
#define ERR(fmt,...)
Definition: debug.h:109
static int includes_size
Definition: compiler.c:54
Definition: name.c:38
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define malloc
Definition: debug_ros.c:4

Referenced by pp_open_include().

◆ wpp_open()

void* wpp_open ( const char filename,
int  type 
)

Definition at line 195 of file compiler.c.

196 {
197  struct mem_file_desc *desc;
198  HRESULT hr;
199 
200  TRACE("Opening include %s.\n", debugstr_a(filename));
201 
203  {
204  current_shader.pos = 0;
205  return &current_shader;
206  }
207 
208  if(current_include == NULL) return NULL;
209  desc = HeapAlloc(GetProcessHeap(), 0, sizeof(*desc));
210  if(!desc)
211  return NULL;
212 
214  filename, parent_include, (const void **)&desc->buffer, &desc->size)))
215  {
217  return NULL;
218  }
219 
221  {
222  if(includes_capacity == 0)
223  {
225  if(includes == NULL)
226  {
227  ERR("Error allocating memory for the loaded includes structure\n");
228  goto error;
229  }
230  includes_capacity = INCLUDES_INITIAL_CAPACITY * sizeof(*includes);
231  }
232  else
233  {
234  int newcapacity = includes_capacity * 2;
235  struct loaded_include *newincludes =
236  HeapReAlloc(GetProcessHeap(), 0, includes, newcapacity);
237  if(newincludes == NULL)
238  {
239  ERR("Error reallocating memory for the loaded includes structure\n");
240  goto error;
241  }
242  includes = newincludes;
243  includes_capacity = newcapacity;
244  }
245  }
247  includes[includes_size++].data = desc->buffer;
248 
249  desc->pos = 0;
250  return desc;
251 
252 error:
253  ID3DInclude_Close(current_include, desc->buffer);
255  return NULL;
256 }
HRESULT hr
Definition: shlfolder.c:183
#define error(str)
Definition: mkdosfs.c:1605
static ID3DInclude * current_include
Definition: compiler.c:42
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
const char * filename
Definition: ioapi.h:135
static struct mem_file_desc current_shader
Definition: compiler.c:41
static const WCHAR desc[]
Definition: protectdata.c:36
smooth NULL
Definition: ftsmooth.c:416
static struct loaded_include * includes
Definition: compiler.c:53
#define TRACE(s)
Definition: solgame.cpp:4
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define debugstr_a
Definition: kernel32.h:31
LONG HRESULT
Definition: typedefs.h:77
static const char * initial_filename
Definition: compiler.c:43
static const char * parent_include
Definition: compiler.c:55
#define ERR(fmt,...)
Definition: debug.h:109
static int includes_size
Definition: compiler.c:54
#define HeapReAlloc
Definition: compat.h:401
int strcmp(const char *String1, const char *String2)
Definition: utclib.c:469
#define INCLUDES_INITIAL_CAPACITY
Definition: compiler.c:45
static int includes_capacity
Definition: compiler.c:54
#define HeapFree(x, y, z)
Definition: compat.h:402

Referenced by pp_open_include(), and wpp_parse().

◆ wpp_parse()

int wpp_parse ( const char input,
FILE output 
)

Definition at line 437 of file compiler.c.

438 {
439  int ret;
440 
441  pp_status.input = NULL;
444  pp_status.state = 0;
445 
447  if(ret)
448  return ret;
451 
452  if (!input) pp_status.file = stdin;
453  else if (!(pp_status.file = wpp_open(input, 1)))
454  {
455  ppy_error("Could not open %s\n", input);
459  return 2;
460  }
461 
463 
464  ppy_out = output;
465  pp_writestring("# 1 \"%s\" 1\n", input ? input : "");
466 
467  ret = ppy_parse();
468  /* If there were errors during processing, return an error code */
469  if (!ret && pp_status.state) ret = pp_status.state;
470 
471  if (input)
472  {
475  }
476  /* Clean if_stack, it could remain dirty on errors */
477  while (pp_get_if_depth()) pp_pop_if();
481  return ret;
482 }
static void add_special_defines(void)
Definition: compiler.c:346
int WINAPIV ppy_error(const char *msg,...)
Definition: compiler.c:135
static UCHAR ULONG UCHAR ULONG UCHAR * output
Definition: bcrypt.c:29
int pp_get_if_depth(void)
Definition: preproc.c:433
#define free
Definition: debug_ros.c:5
int line_number
Definition: wpp_private.h:222
static void add_cmdline_defines(void)
Definition: compiler.c:326
FILE * stdin
int char_number
Definition: wpp_private.h:223
smooth NULL
Definition: ftsmooth.c:416
char * input
Definition: wpp_private.h:220
int ppy_parse(void)
char * pp_xstrdup(const char *str)
Definition: preproc.c:73
void * wpp_open(const char *filename, int type)
Definition: compiler.c:195
int ret
void wpp_close(void *file)
Definition: compiler.c:258
GLenum GLenum GLenum input
Definition: glext.h:9031
void WINAPIV pp_writestring(const char *format,...)
Definition: ppl.yy.c:1556
FILE * ppy_out
Definition: ppl.yy.c:370
int pp_push_define_state(void)
Definition: preproc.c:148
static void del_cmdline_defines(void)
Definition: compiler.c:336
void pp_pop_define_state(void)
Definition: preproc.c:161
void * file
Definition: wpp_private.h:221
pp_if_state_t pp_pop_if(void)
Definition: preproc.c:380
static void del_special_defines(void)
Definition: compiler.c:367

◆ wpp_read()

int wpp_read ( void file,
char buffer,
unsigned int  len 
)

Definition at line 274 of file compiler.c.

275 {
276  struct mem_file_desc *desc = file;
277 
278  len = min(len, desc->size - desc->pos);
279  memcpy(buffer, desc->buffer + desc->pos, len);
280  desc->pos += len;
281  return len;
282 }
GLuint buffer
Definition: glext.h:5915
static const WCHAR desc[]
Definition: protectdata.c:36
const char file[]
Definition: icontest.c:11
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define min(a, b)
Definition: monoChain.cc:55

◆ wpp_write()

void wpp_write ( const char buffer,
unsigned int  len 
)

Definition at line 284 of file compiler.c.

285 {
286  char *new_wpp_output;
287 
288  if(wpp_output_capacity == 0)
289  {
291  if(!wpp_output)
292  return;
293 
295  }
297  {
299  {
300  wpp_output_capacity *= 2;
301  }
302  new_wpp_output = HeapReAlloc(GetProcessHeap(), 0, wpp_output,
304  if(!new_wpp_output)
305  {
306  ERR("Error allocating memory\n");
307  return;
308  }
309  wpp_output = new_wpp_output;
310  }
312  wpp_output_size += len;
313 }
static char * wpp_output
Definition: compiler.c:57
static int wpp_output_size
Definition: compiler.c:58
GLuint buffer
Definition: glext.h:5915
#define GetProcessHeap()
Definition: compat.h:403
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
#define BUFFER_INITIAL_CAPACITY
Definition: compiler.c:32
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
#define ERR(fmt,...)
Definition: debug.h:109
#define HeapReAlloc
Definition: compat.h:401
static int wpp_output_capacity
Definition: compiler.c:58

Referenced by pp_writestring(), and put_buffer().

Variable Documentation

◆ pp_incl_state

include_state_t pp_incl_state

Definition at line 1539 of file ppl.yy.c.

◆ pp_includelogiclist

includelogicentry_t* pp_includelogiclist

Definition at line 1547 of file ppl.yy.c.

◆ pp_status

Definition at line 29 of file preproc.c.

◆ ppy_out

FILE * ppy_out = (FILE *) 0

Definition at line 370 of file ppl.yy.c.

Referenced by wpp_default_write(), and wpp_parse().

◆ ppy_text

char * ppy_text

Definition at line 1051 of file ppl.yy.c.

Referenced by ppy_error(), and ppy_warning().

◆ wpp_callbacks

Definition at line 733 of file preproc.c.