From: roberts Date: Mon, 9 Mar 1998 16:38:13 +0000 (+0000) Subject: Add tmpfile() support. Contributed by Michael Driscoll (fenris@frob.ml.org). X-Git-Tag: 0.67_01~440 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=17abbc3ac9c0d63caff8845e7484c1217b239ebb;p=catagits%2Ffcgi2.git Add tmpfile() support. Contributed by Michael Driscoll (fenris@frob.ml.org). --- diff --git a/include/fcgi_stdio.h b/include/fcgi_stdio.h index ae9243a..ff40a18 100644 --- a/include/fcgi_stdio.h +++ b/include/fcgi_stdio.h @@ -9,7 +9,7 @@ * See the file "LICENSE.TERMS" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * $Id: fcgi_stdio.h,v 1.1 1997/09/16 15:36:32 stanleyg Exp $ + * $Id: fcgi_stdio.h,v 1.2 1998/03/09 16:38:13 roberts Exp $ */ #ifndef _FCGI_STDIO @@ -116,7 +116,9 @@ DLLAPI size_t FCGI_fwrite(void *ptr, size_t size, size_t nmemb, FCGI_FILE *f DLLAPI int FCGI_feof(FCGI_FILE *fp); DLLAPI int FCGI_ferror(FCGI_FILE *fp); -DLLAPI void FCGI_clearerr(FCGI_FILE *fp); +DLLAPI void FCGI_clearerr(FCGI_FILE *fp); + +DLLAPI FCGI_FILE *FCGI_tmpfile(void); DLLAPI int FCGI_fileno(FCGI_FILE *fp); DLLAPI FCGI_FILE *FCGI_fdopen(int fd, const char *mode); @@ -219,7 +221,10 @@ DLLAPI int FCGI_pclose(FCGI_FILE *); #undef ferror #define ferror FCGI_ferror #undef clearerr -#define clearerr FCGI_clearerr +#define clearerr FCGI_clearerr + +#undef tmpfile +#define tmpfile FCGI_tmpfile #undef fileno #define fileno FCGI_fileno diff --git a/libfcgi/fcgi_stdio.c b/libfcgi/fcgi_stdio.c index 5c2577f..fa3f64c 100644 --- a/libfcgi/fcgi_stdio.c +++ b/libfcgi/fcgi_stdio.c @@ -12,7 +12,7 @@ */ #ifndef lint -static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.2 1998/03/09 15:47:09 roberts Exp $"; +static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.3 1998/03/09 16:38:15 roberts Exp $"; #endif /* not lint */ #ifdef _WIN32 @@ -724,7 +724,22 @@ void FCGI_clearerr(FCGI_FILE *fp) FCGX_ClearError(fp->fcgx_stream); } return; +} + +/* + *---------------------------------------------------------------------- + * + * FCGI_tmpfile -- + * + * Wrappers for function defined in H&S Section 15.16 + * + *---------------------------------------------------------------------- + */ +FCGI_FILE *FCGI_tmpfile(void) +{ + return FCGI_OpenFromFile(tmpfile()); } + /* *----------------------------------------------------------------------