X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=libfcgi%2Ffcgi_stdio.c;h=379cb12c54dcf14ca5331527b55436f59d2d8fe1;hb=6ad90ad201152849cc42354608bd406684e290e6;hp=79ca3078260632767ce99fa684275b26ee1d13fa;hpb=d1ac78e4c5193867a4780853a5f70ea731366700;p=catagits%2Ffcgi2.git diff --git a/libfcgi/fcgi_stdio.c b/libfcgi/fcgi_stdio.c index 79ca307..379cb12 100644 --- a/libfcgi/fcgi_stdio.c +++ b/libfcgi/fcgi_stdio.c @@ -12,47 +12,62 @@ */ #ifndef lint -static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.7 1999/07/27 15:00:16 roberts Exp $"; +static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.8 1999/07/28 00:24:15 roberts Exp $"; #endif /* not lint */ +#include "fcgi_config.h" + #ifdef _WIN32 #define DLLAPI __declspec(dllexport) +#include #endif -#define NO_FCGI_DEFINES -#include "fcgi_stdio.h" -#undef NO_FCGI_DEFINES +#include /* for errno */ +#include /* for va_arg */ +#include /* for malloc */ +#include /* for strerror */ -#ifdef _WIN32 -#include -#endif -#include - /* for errno */ -#include - /* for va_arg */ -#include - /* for malloc */ -#include - /* for strerror */ #ifdef HAVE_UNISTD_H #include #endif +#define NO_FCGI_DEFINES +#include "fcgi_stdio.h" +#undef NO_FCGI_DEFINES + #include "fcgiapp.h" #include "fcgios.h" +#ifndef _WIN32 + +extern char **environ; + +/* These definitions should be supplied by stdio.h but for some + * reason they get lost on certain platforms. */ +#ifndef fileno +extern int fileno(FILE *stream); +#endif + +extern FILE *fdopen(int fildes, const char *type); +extern FILE *popen(const char *command, const char *type); +extern int pclose(FILE *stream); + +#else /* _WIN32 */ + +#define popen _popen + +#endif /* _WIN32 */ + #ifndef FALSE #define FALSE (0) #endif + #ifndef TRUE #define TRUE (1) #endif FCGI_FILE _fcgi_sF[3]; -#ifdef _WIN32 -#define popen _popen -#endif /* *---------------------------------------------------------------------- @@ -101,9 +116,6 @@ FCGI_FILE _fcgi_sF[3]; */ static int acceptCalled = FALSE; static int isCGI = FALSE; -#ifndef _WIN32 -extern char **environ; -#endif int FCGI_Accept(void) { @@ -748,22 +760,6 @@ FCGI_FILE *FCGI_tmpfile(void) *---------------------------------------------------------------------- */ -/* - * These definitions should be supplied by stdio.h but for some - * reason they get lost on certain platforms. - */ -/* - * XXX: Need to find the right way to handle this for NT - */ -#ifndef _WIN32 -#ifndef fileno -extern int fileno(FILE *stream); -#endif -extern FILE *fdopen(int fildes, const char *type); -extern FILE *popen(const char *command, const char *type); -extern int pclose(FILE *stream); -#endif - int FCGI_fileno(FCGI_FILE *fp) { if(fp->stdio_stream)