-/*
+/*
* log-dump.c --
*
* FastCGI example program to illustrate both an Authorizer and a
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
*/
-
#ifndef lint
-static const char rcsid[] = "$Id: log-dump.c,v 1.3 1999/07/26 05:33:01 roberts Exp $";
+static const char rcsid[] = "$Id: log-dump.c,v 1.4 1999/07/28 00:30:10 roberts Exp $";
#endif /* not lint */
-#if defined HAVE_UNISTD_H || defined __linux__
-#include <unistd.h>
-#endif
-#include <sys/types.h>
-#if defined __linux__
-int kill(pid_t pid, int sig);
-#endif
+#include "fcgi_config.h"
-#include "fcgi_stdio.h"
+#include <sys/types.h>
#include <stdlib.h>
#include <signal.h>
#include <string.h>
#include <fcntl.h>
#include <errno.h>
+#if defined __linux__
+int kill(pid_t pid, int sig);
+#endif
+
+#if defined HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#include "fcgi_stdio.h"
+
#ifndef NULL
#define NULL 0
#endif
int fd, n, i, j;
char temp[4096];
char temp2[5000];
-
+
while(FCGI_Accept() >= 0) {
rolePtr = getenv("FCGI_ROLE");
if(rolePtr == NULL) {
continue;
}
}
-
+
exit(0);
}
-/*
+/*
* fcgiapp.h --
*
* Definitions for FastCGI application server programs
* See the file "LICENSE.TERMS" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * $Id: fcgiapp.h,v 1.2 1999/07/26 04:28:10 roberts Exp $
+ * $Id: fcgiapp.h,v 1.3 1999/07/28 00:27:51 roberts Exp $
*/
#ifndef _FCGIAPP_H
#define _FCGIAPP_H
-#ifndef TCL_LIBRARY /* Hack to see if we are building TCL since TCL
- * needs varargs not stdarg
- */
-#ifdef _WIN32
-#ifndef DLLAPI
-#define DLLAPI __declspec(dllimport)
-#endif
-#else
-#define DLLAPI
-#endif
-
+/* Hack to see if we are building TCL - TCL needs varargs not stdarg */
+#ifndef TCL_LIBRARY
#include <stdarg.h>
#else
#include <varargs.h>
-#endif /* TCL_LIBARARY */
-#include "fcgi_config.h"
+#endif
#if defined (c_plusplus) || defined (__cplusplus)
extern "C" {
#endif
+#ifdef _WIN32
+
+#ifndef DLLAPI
+#define DLLAPI __declspec(dllimport)
+#endif
+
+#else /* !_WIN32 */
+
+#define DLLAPI
+
+#endif /* !_WIN32 */
+
/*
* Error codes. Assigned to avoid conflict with EOF and errno(2).
*/
typedef char **FCGX_ParamArray;
/*
- * State associated with a request.
+ * State associated with a request.
*
* Its exposed for API simplicity, DON'T use it - it WILL change!
*/
*
* FCGX_Accept_r --
*
- * Accept a new request (multi-thread safe). Be sure to call
+ * Accept a new request (multi-thread safe). Be sure to call
* FCGX_Init() first.
*
* Results:
* FCGX_CALL_SEQ_ERROR.
*
* Results:
- * 0 for a normal return, < 0 for error
+ * 0 for a normal return, < 0 for error
*
*----------------------------------------------------------------------
*/
*
* Results:
* The byte, or EOF (-1) if an error occurred.
- *
+ *
*----------------------------------------------------------------------
*/
DLLAPI int FCGX_PutChar(int c, FCGX_Stream *stream);
* Results:
* Number of bytes written (n) for normal return,
* EOF (-1) if an error occurred.
- *
+ *
*----------------------------------------------------------------------
*/
DLLAPI int FCGX_PutStr(const char *str, int n, FCGX_Stream *stream);
* Results:
* number of bytes written for normal return,
* EOF (-1) if an error occurred.
- *
+ *
*----------------------------------------------------------------------
*/
DLLAPI int FCGX_PutS(const char *str, FCGX_Stream *stream);
* Results:
* number of bytes written for normal return,
* EOF (-1) if an error occurred.
- *
+ *
*----------------------------------------------------------------------
*/
DLLAPI int FCGX_FPrintF(FCGX_Stream *stream, const char *format, ...);
*
* Results:
* EOF (-1) if an error occurred.
- *
+ *
*----------------------------------------------------------------------
*/
DLLAPI int FCGX_FFlush(FCGX_Stream *stream);
*
* Results:
* EOF (-1) if an error occurred.
- *
+ *
*----------------------------------------------------------------------
*/
DLLAPI int FCGX_FClose(FCGX_Stream *stream);
#ifndef _FCGIOS_H
#define _FCGIOS_H
+#include "fcgi_config.h"
+
#ifdef _WIN32
#include <io.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#if defined (c_plusplus) || defined (__cplusplus)
+extern "C" {
+#endif
+
+
+#ifdef _WIN32
+
#define OS_Errno GetLastError()
#define OS_SetErrno(err) SetLastError(err)
+
#ifndef DLLAPI
#define DLLAPI __declspec(dllimport)
#endif
-#else /* !_WIN32 */
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
+#ifndef O_NONBLOCK
+#define O_NONBLOCK 0x0004 /* no delay */
#endif
+
+#else /* !_WIN32 */
+
#define DLLAPI
#define OS_Errno errno
#define OS_SetErrno(err) errno = (err)
-#endif /* !_WIN32 */
+#endif /* !_WIN32 */
/* This is the initializer for a "struct timeval" used in a select() call
* right after a new request is accept()ed to determine readablity. Its
#define X_OK 0x01
#endif
-#ifdef _WIN32
-#ifndef O_NONBLOCK
-#define O_NONBLOCK 0x0004 /* no delay */
-#endif
-#endif
-
-#if defined (c_plusplus) || defined (__cplusplus)
-extern "C" {
-#endif
-
#ifndef _CLIENTDATA
# if defined(__STDC__) || defined(__cplusplus)
typedef void *ClientData;