123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213 |
- #ifndef __WINE_WPP_PRIVATE_H
- #define __WINE_WPP_PRIVATE_H
- #include <stdio.h>
- #include <string.h>
- #include "wine/list.h"
- struct pp_entry;
- typedef struct includelogicentry {
- struct list entry;
- struct pp_entry *ppp;
- char *filename;
- } includelogicentry_t;
- typedef enum {
- exp_text,
- exp_concat,
- exp_stringize,
- exp_subst
- } def_exp_t;
- typedef struct mtext {
- struct mtext *next;
- struct mtext *prev;
- def_exp_t type;
- union {
- char *text;
- int argidx;
- } subst;
- } mtext_t;
- typedef enum {
- def_none,
- def_define,
- def_macro,
- def_special
- } def_type_t;
- typedef struct pp_entry {
- struct list entry;
- def_type_t type;
- char *ident;
- char **margs;
- int nargs;
- union {
- mtext_t *mtext;
- char *text;
- } subst;
- int expanding;
- char *filename;
- int linenumber;
- includelogicentry_t *iep;
- } pp_entry_t;
- #define MAXIFSTACK 64
- typedef enum {
- if_false,
- if_true,
- if_elif,
- if_elsefalse,
- if_elsetrue,
- if_ignore,
- if_error
- } pp_if_state_t;
- typedef struct
- {
- int state;
- char *ppp;
- int ifdepth;
- int seen_junk;
- } include_state_t;
- #define SIZE_INT 1
- #define SIZE_LONG 2
- #define SIZE_LONGLONG 3
- #define SIZE_MASK 0x00ff
- #define FLAG_SIGNED 0x0100
- typedef enum {
- 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
- } ctype_t;
- typedef struct cval {
- ctype_t type;
- union {
- int si;
- unsigned int ui;
- long sl;
- unsigned long ul;
- __int64 sll;
- unsigned __int64 ull;
- } val;
- } cval_t;
- void *pp_xmalloc(size_t);
- void *pp_xrealloc(void *, size_t);
- char *pp_xstrdup(const char *str);
- pp_entry_t *pplookup(const char *ident);
- void pp_init_define_state(void);
- void pp_free_define_state(void);
- pp_entry_t *pp_add_define(const char *def, const char *text);
- pp_entry_t *pp_add_macro(char *ident, char *args[], int nargs, 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);
- char *wpp_lookup(const char *name, int type, const char *parent_name,
- char **include_path, int include_path_count);
- #ifndef __GNUC__
- #define __attribute__(x)
- #endif
- int ppy_error(const char *s, ...) __attribute__((format (printf, 1, 2)));
- int ppy_warning(const char *s, ...) __attribute__((format (printf, 1, 2)));
- void pp_internal_error(const char *file, int line, const char *s, ...) __attribute__((format (printf, 3, 4)));
- struct pp_status
- {
- char *input;
- FILE *file;
- int line_number;
- int char_number;
- int pedantic;
- int debug;
- };
- extern struct pp_status pp_status;
- extern include_state_t pp_incl_state;
- extern struct list pp_includelogiclist;
- extern FILE *ppy_in;
- extern FILE *ppy_out;
- extern char *ppy_text;
- extern int pp_flex_debug;
- 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 pp_writestring(const char *format, ...) __attribute__((format (printf, 1, 2)));
- int ppy_parse(void);
- extern int ppy_debug;
- #endif
|