From bd94f959388d6027dc72210a56f14d6400b74a11 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Tue, 30 Mar 2010 15:34:29 +0200 Subject: [PATCH] wpp: Get rid of wpp_parse_temp, temp file management is better left to callers. --- include/wine/wpp.h | 1 - libs/wpp/wpp.c | 37 ------------------------------------- 2 files changed, 38 deletions(-) diff --git a/include/wine/wpp.h b/include/wine/wpp.h index daba277fd20..2d284f154f0 100644 --- a/include/wine/wpp.h +++ b/include/wine/wpp.h @@ -57,7 +57,6 @@ extern void wpp_set_pedantic( int on ); extern int wpp_add_include_path( const char *path ); extern char *wpp_find_include( const char *name, const char *parent_name ); extern int wpp_parse( const char *input, FILE *output ); -extern int wpp_parse_temp( const char *input, const char *output_base, char **output_name ); extern void wpp_set_callbacks( const struct wpp_callbacks *callbacks ); #endif /* __WINE_WPP_H */ diff --git a/libs/wpp/wpp.c b/libs/wpp/wpp.c index de4286fa1f8..582ad6ffc58 100644 --- a/libs/wpp/wpp.c +++ b/libs/wpp/wpp.c @@ -203,43 +203,6 @@ int wpp_parse( const char *input, FILE *output ) } -/* parse into a temporary file */ -int wpp_parse_temp( const char *input, const char *output_base, char **output_name ) -{ - FILE *output; - int ret, fd; - char *temp_name; - - if (!output_base || !output_base[0]) output_base = "wpptmp"; - - temp_name = pp_xmalloc( strlen(output_base) + 8 ); - if(!temp_name) - return 1; - strcpy( temp_name, output_base ); - strcat( temp_name, ".XXXXXX" ); - - if((fd = mkstemps( temp_name, 0 )) == -1) - { - ppy_error("Could not generate a temp name from %s\n", temp_name); - free( temp_name ); - return 2; - } - - if (!(output = fdopen(fd, "wt"))) - { - ppy_error("Could not open fd %s for writing\n", temp_name); - close( fd ); - unlink( temp_name ); - free( temp_name ); - return 2; - } - - *output_name = temp_name; - ret = wpp_parse( input, output ); - fclose( output ); - return ret; -} - void wpp_set_callbacks( const struct wpp_callbacks *callbacks ) { wpp_callbacks = callbacks; -- 2.11.4.GIT