*/
#ifndef lint
-static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.11 2001/06/20 00:56:51 robs Exp $";
+static const char rcsid[] = "$Id: fcgi_stdio.c,v 1.12 2001/06/20 16:04:17 robs Exp $";
#endif /* not lint */
-#include "fcgi_config.h"
-
-#ifdef _WIN32
-#define DLLAPI __declspec(dllexport)
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-#endif
-
#include <errno.h> /* for errno */
#include <stdarg.h> /* for va_arg */
#include <stdlib.h> /* for malloc */
#include <string.h> /* for strerror */
+#include "fcgi_config.h"
+
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
+#define DLLAPI __declspec(dllexport)
+
#define NO_FCGI_DEFINES
#include "fcgi_stdio.h"
#undef NO_FCGI_DEFINES
#include "fcgiapp.h"
#include "fcgios.h"
+#include "fcgimisc.h"
#ifndef _WIN32
#endif /* _WIN32 */
-#ifndef FALSE
-#define FALSE (0)
-#endif
-
-#ifndef TRUE
-#define TRUE (1)
-#endif
-
FCGI_FILE _fcgi_sF[3];
}
/*
- * There is no standard equivalent of gets that takes an explicit
- * FILE * argument, so the following "wrapper" implements
- * gets for both FILE * and FCGX_Stream * in terms of FCGI_getchar.
+ * The gets() function reads characters from the standard input stream
+ * into the array pointed to by str until a newline character is read
+ * or an end-of-file condition is encountered. The newline character
+ * is discarded and the string is terminated with a null character.
*/
char *FCGI_gets(char *str)
{
char *s;
int c;
+
for (s = str; ((c = FCGI_getchar()) != '\n');) {
if(c == EOF) {
if(s == str)
else
break;
} else
- *s++ = c;
+ *s++ = (char) c;
}
*s = 0;
return str;