#include <stdio.h>
#include <string.h>
#include "wine/list.h"
Go to the source code of this file.
|
| enum | def_exp_t { exp_text
, exp_concat
, exp_stringize
, exp_subst
} |
| |
| enum | def_type_t { 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
} |
| |
| 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
} |
| |
|
| void | wpp_del_define (const char *name) |
| |
| void | wpp_add_cmdline_define (const char *value) |
| |
| void | wpp_set_debug (int lex_debug, int parser_debug, int msg_debug) |
| |
| void | wpp_add_include_path (const char *path) |
| |
| char * | wpp_find_include (const char *name, const char *parent_name) |
| |
| int | wpp_parse (const char *input, FILE *output) |
| |
| pp_entry_t * | pplookup (const char *ident) |
| |
| pp_entry_t * | pp_add_define (const char *def, const char *text) |
| |
| pp_entry_t * | pp_add_macro (char *ident, char *args[], int nargs, int variadic, mtext_t *exp) |
| |
| void | pp_del_define (const char *name) |
| |
| void * | pp_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 | ppy_error (const char *s,...) __attribute__((format(printf |
| |
| int int | ppy_warning (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) |
| |
| int | ppy_parse (void) |
| |
◆ FLAG_SIGNED
◆ MAXIFSTACK
| #define MAXIFSTACK 64 /* If this isn't enough you should alter the source... */ |
◆ SIZE_INT
◆ SIZE_LONG
◆ SIZE_LONGLONG
◆ SIZE_MASK
◆ cval_t
◆ includelogicentry_t
◆ mtext_t
◆ pp_entry_t
◆ ctype_t
| Enumerator |
|---|
| cv_sint | |
| cv_uint | |
| cv_slong | |
| cv_ulong | |
| cv_sll | |
| cv_ull | |
Definition at line 135 of file wpp_private.h.
◆ def_exp_t
| Enumerator |
|---|
| exp_text | |
| exp_concat | |
| exp_stringize | |
| exp_subst | |
Definition at line 50 of file wpp_private.h.
◆ def_type_t
| Enumerator |
|---|
| def_none | |
| def_define | |
| def_macro | |
| def_special | |
Definition at line 70 of file wpp_private.h.
◆ pp_if_state_t
| Enumerator |
|---|
| if_false | |
| if_true | |
| if_elif | |
| if_elsefalse | |
| if_elsetrue | |
| if_ignore | |
| if_error | |
Definition at line 100 of file wpp_private.h.
◆ pp_add_define()
Definition at line 199 of file wpp.c.
200{
202 char *cptr;
205
208 {
210 ppy_warning(
"Redefinition of %s\n%s:%d: note: previous definition was here",
213 }
215 memset( ppp, 0,
sizeof(*ppp) );
223 {
224
227 {
229 }
230
232 ;
235 }
238
239 return ppp;
240}
char * xstrdup(const char *s)
static void list_add_head(struct list_entry *head, struct list_entry *entry)
_ACRTIMP char *__cdecl strchr(const char *, int)
_ACRTIMP size_t __cdecl strlen(const char *)
#define memmove(s1, s2, n)
union pp_entry::@6056 subst
int ppy_warning(const char *s,...)
static int pphash(const char *str)
pp_entry_t * pplookup(const char *ident)
static struct list pp_defines[HASHKEY]
void pp_del_define(const char *name)
Referenced by add_cmdline_defines(), and add_special_defines().
◆ pp_add_macro()
Definition at line 242 of file wpp.c.
243{
246
249 {
251 ppy_warning(
"Redefinition of %s\n%s:%d: note: previous definition was here",
254 }
256 memset( ppp, 0,
sizeof(*ppp) );
267 {
270 {
272 {
275 break;
278 break;
281 break;
284 break;
285 }
286 }
288 }
289 return ppp;
290}
int WINAPIV fprintf(FILE *file, const char *format,...)
◆ pp_del_define()
Definition at line 178 of file wpp.c.
179{
182
184 {
187 return;
188 }
189
192
197}
static void free_pp_entry(pp_entry_t *ppp, int idx)
Referenced by pp_add_define(), and pp_add_macro().
◆ pp_do_include()
◆ pp_get_if_depth()
◆ pp_if_state()
◆ pp_next_if_state()
Definition at line 467 of file wpp.c.
468{
470 {
474 break;
480 break;
483 }
484}
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
pp_if_state_t pp_if_state(void)
void pp_push_if(pp_if_state_t s)
◆ pp_open_include()
Definition at line 320 of file wpp.c.
321{
323 void *fp;
324
327
328 if (fp)
329 {
332 if (newpath) *newpath =
path;
334 return fp;
335 }
338}
FILE *CDECL fopen(const char *path, const char *mode)
GLuint GLuint GLsizei GLenum type
static char * wpp_lookup(const char *name, int type, const char *parent_name)
◆ pp_pop_if()
Definition at line 423 of file wpp.c.
424{
426 {
427 ppy_error(
"#{endif,else,elif} without #{if,ifdef,ifndef} (#if-stack underflow)");
429 }
430
432 {
435 break;
441 break;
444 }
445
454
456}
static const char *const pp_if_state_str[]
int ppy_error(const char *s,...)
void pp_pop_ignore_state(void)
Referenced by wpp_parse().
◆ pp_pop_ignore_state()
◆ pp_push_if()
Definition at line 397 of file wpp.c.
398{
400 error(
"#if-stack overflow; #{if,ifdef,ifndef} nested too deeply (> %d)\n",
MAXIFSTACK);
401
404
406
408 {
411 break;
417 break;
420 }
421}
void pp_push_ignore_state(void)
Referenced by pp_next_if_state().
◆ pp_push_ignore_state()
◆ pplookup()
Definition at line 124 of file wpp.c.
125{
128
133 {
135 return ppp;
136 }
138}
_ACRTIMP int __cdecl strcmp(const char *, const char *)
#define LIST_FOR_EACH_ENTRY(elem, list, type, field)
_In_ ULONG _In_ ULONG_PTR ident
Referenced by pp_add_define(), pp_add_macro(), and pp_del_define().
◆ ppy_error()
◆ ppy_lex()
◆ ppy_parse()
◆ ppy_warning()
◆ wpp_add_cmdline_define()
Definition at line 588 of file wpp.c.
589{
592
597}
static void wpp_add_define(const char *name, const char *value)
◆ wpp_add_include_path()
Definition at line 298 of file wpp.c.
299{
301 char *cptr;
302
303 for(cptr =
dir; *cptr; cptr++)
304 {
305
306 if(*cptr == '\\')
307 *cptr = '/';
308 }
309
311
313}
static struct strarray includes
◆ wpp_del_define()
Definition at line 571 of file wpp.c.
572{
574
576 {
578 {
581 return;
582 }
583 }
584}
static struct list cmdline_defines
◆ wpp_find_include()
◆ wpp_parse()
Definition at line 610 of file wpp.c.
611{
613
617
621
625
627
630
632
634 {
637 }
638
642}
int CDECL fclose(FILE *file)
GLenum GLenum GLenum input
static void add_special_defines(void)
int pp_get_if_depth(void)
static void pp_free_define_state(void)
static void pp_init_define_state(void)
pp_if_state_t pp_pop_if(void)
static void add_cmdline_defines(void)
◆ wpp_set_debug()
| void wpp_set_debug |
( |
int |
lex_debug, |
|
|
int |
parser_debug, |
|
|
int |
msg_debug |
|
) |
| |
◆ pedantic
◆ pp_flex_debug
◆ pp_incl_state
◆ pp_status
Definition at line 37 of file wpp.c.
◆ ppy_debug
◆ ppy_in
◆ ppy_out
◆ ppy_text