af062818b47340eef15700d2f0211576ba3506eevboxsync/*
af062818b47340eef15700d2f0211576ba3506eevboxsync * Exported functions of the Wine preprocessor
af062818b47340eef15700d2f0211576ba3506eevboxsync *
af062818b47340eef15700d2f0211576ba3506eevboxsync * Copyright 2002 Alexandre Julliard
af062818b47340eef15700d2f0211576ba3506eevboxsync *
af062818b47340eef15700d2f0211576ba3506eevboxsync * This library is free software; you can redistribute it and/or
af062818b47340eef15700d2f0211576ba3506eevboxsync * modify it under the terms of the GNU Lesser General Public
af062818b47340eef15700d2f0211576ba3506eevboxsync * License as published by the Free Software Foundation; either
af062818b47340eef15700d2f0211576ba3506eevboxsync * version 2.1 of the License, or (at your option) any later version.
af062818b47340eef15700d2f0211576ba3506eevboxsync *
af062818b47340eef15700d2f0211576ba3506eevboxsync * This library is distributed in the hope that it will be useful,
af062818b47340eef15700d2f0211576ba3506eevboxsync * but WITHOUT ANY WARRANTY; without even the implied warranty of
af062818b47340eef15700d2f0211576ba3506eevboxsync * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
af062818b47340eef15700d2f0211576ba3506eevboxsync * Lesser General Public License for more details.
af062818b47340eef15700d2f0211576ba3506eevboxsync *
af062818b47340eef15700d2f0211576ba3506eevboxsync * You should have received a copy of the GNU Lesser General Public
af062818b47340eef15700d2f0211576ba3506eevboxsync * License along with this library; if not, write to the Free Software
af062818b47340eef15700d2f0211576ba3506eevboxsync * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
af062818b47340eef15700d2f0211576ba3506eevboxsync */
af062818b47340eef15700d2f0211576ba3506eevboxsync
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync/*
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
4b9d6701570cb98fd36e209314239d104ec584d3vboxsync * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * a choice of LGPL license versions is made available with the language indicating
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * that LGPLv2 or any later version may be used, or where a choice of which version
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync * of the LGPL is applied is otherwise unspecified.
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync */
b955672b950093ff7416d1269dd4d3b69983bd8fvboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#ifndef __WINE_WPP_H
af062818b47340eef15700d2f0211576ba3506eevboxsync#define __WINE_WPP_H
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#include <stdio.h>
5112e32d7072e280613921c982a6672f2c859cf3vboxsync#include <stdarg.h>
af062818b47340eef15700d2f0211576ba3506eevboxsync
5112e32d7072e280613921c982a6672f2c859cf3vboxsyncstruct wpp_callbacks
5112e32d7072e280613921c982a6672f2c859cf3vboxsync{
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* I/O callbacks */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* Looks for a file to include, returning the path where it is found */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* parent_name is the directory of the parent source file (for local
5112e32d7072e280613921c982a6672f2c859cf3vboxsync * includes), includepath is an array of additional include paths */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync char *(*lookup)( const char *filename, const char *parent_name,
5112e32d7072e280613921c982a6672f2c859cf3vboxsync char **include_path, int include_path_count );
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* Opens an include file */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* The type param is true if it is a local ("...") include */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync void *(*open)( const char *filename, int type );
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* Closes a previously opened file */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync void (*close)( void *file );
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* Reads buffer from the input */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync int (*read)( void *file, char *buffer, unsigned int len );
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* Writes buffer to the output */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync void (*write)( const char *buffer, unsigned int len );
5112e32d7072e280613921c982a6672f2c859cf3vboxsync
5112e32d7072e280613921c982a6672f2c859cf3vboxsync /* Error callbacks */
5112e32d7072e280613921c982a6672f2c859cf3vboxsync void (*error)( const char *file, int line, int col, const char *near, const char *msg, va_list ap );
5112e32d7072e280613921c982a6672f2c859cf3vboxsync void (*warning)( const char *file, int line, int col, const char *near, const char *msg, va_list ap );
5112e32d7072e280613921c982a6672f2c859cf3vboxsync};
5112e32d7072e280613921c982a6672f2c859cf3vboxsync
5112e32d7072e280613921c982a6672f2c859cf3vboxsync/* Return value == 0 means successful execution */
5112e32d7072e280613921c982a6672f2c859cf3vboxsyncextern int wpp_add_define( const char *name, const char *value );
af062818b47340eef15700d2f0211576ba3506eevboxsyncextern void wpp_del_define( const char *name );
5112e32d7072e280613921c982a6672f2c859cf3vboxsyncextern int wpp_add_cmdline_define( const char *value );
af062818b47340eef15700d2f0211576ba3506eevboxsyncextern void wpp_set_debug( int lex_debug, int parser_debug, int msg_debug );
af062818b47340eef15700d2f0211576ba3506eevboxsyncextern void wpp_set_pedantic( int on );
5112e32d7072e280613921c982a6672f2c859cf3vboxsyncextern int wpp_add_include_path( const char *path );
af062818b47340eef15700d2f0211576ba3506eevboxsyncextern char *wpp_find_include( const char *name, const char *parent_name );
af062818b47340eef15700d2f0211576ba3506eevboxsyncextern int wpp_parse( const char *input, FILE *output );
5112e32d7072e280613921c982a6672f2c859cf3vboxsyncextern void wpp_set_callbacks( const struct wpp_callbacks *callbacks );
af062818b47340eef15700d2f0211576ba3506eevboxsync
af062818b47340eef15700d2f0211576ba3506eevboxsync#endif /* __WINE_WPP_H */