1 | /*
|
---|
2 | * Exported functions of the Wine preprocessor
|
---|
3 | *
|
---|
4 | * Copyright 2002 Alexandre Julliard
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Lesser General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2.1 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Lesser General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Lesser General Public
|
---|
17 | * License along with this library; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
19 | */
|
---|
20 |
|
---|
21 | /*
|
---|
22 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
23 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
24 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
25 | * a choice of LGPL license versions is made available with the language indicating
|
---|
26 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
27 | * of the LGPL is applied is otherwise unspecified.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef __WINE_WPP_H
|
---|
31 | #define __WINE_WPP_H
|
---|
32 |
|
---|
33 | #include <stdio.h>
|
---|
34 | #include <stdarg.h>
|
---|
35 |
|
---|
36 | struct wpp_callbacks
|
---|
37 | {
|
---|
38 | /* I/O callbacks */
|
---|
39 |
|
---|
40 | /* Looks for a file to include, returning the path where it is found */
|
---|
41 | /* parent_name is the directory of the parent source file (for local
|
---|
42 | * includes), includepath is an array of additional include paths */
|
---|
43 | char *(*lookup)( const char *filename, const char *parent_name,
|
---|
44 | char **include_path, int include_path_count );
|
---|
45 | /* Opens an include file */
|
---|
46 | /* The type param is true if it is a local ("...") include */
|
---|
47 | void *(*open)( const char *filename, int type );
|
---|
48 | /* Closes a previously opened file */
|
---|
49 | void (*close)( void *file );
|
---|
50 | /* Reads buffer from the input */
|
---|
51 | int (*read)( void *file, char *buffer, unsigned int len );
|
---|
52 | /* Writes buffer to the output */
|
---|
53 | void (*write)( const char *buffer, unsigned int len );
|
---|
54 |
|
---|
55 | /* Error callbacks */
|
---|
56 | void (*error)( const char *file, int line, int col, const char *near, const char *msg, va_list ap );
|
---|
57 | void (*warning)( const char *file, int line, int col, const char *near, const char *msg, va_list ap );
|
---|
58 | };
|
---|
59 |
|
---|
60 | /* Return value == 0 means successful execution */
|
---|
61 | extern int wpp_add_define( const char *name, const char *value );
|
---|
62 | extern void wpp_del_define( const char *name );
|
---|
63 | extern int wpp_add_cmdline_define( const char *value );
|
---|
64 | extern void wpp_set_debug( int lex_debug, int parser_debug, int msg_debug );
|
---|
65 | extern void wpp_set_pedantic( int on );
|
---|
66 | extern int wpp_add_include_path( const char *path );
|
---|
67 | extern char *wpp_find_include( const char *name, const char *parent_name );
|
---|
68 | extern int wpp_parse( const char *input, FILE *output );
|
---|
69 | extern void wpp_set_callbacks( const struct wpp_callbacks *callbacks );
|
---|
70 |
|
---|
71 | #endif /* __WINE_WPP_H */
|
---|