commit new generated MANIFEST
[catagits/fcgi2.git] / include / fcgiapp.h
index 1145dac..7d7ec86 100644 (file)
@@ -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: fcgiapp.h,v 1.4 1999/08/05 21:25:52 roberts Exp $
+ * $Id: fcgiapp.h,v 1.14 2003/06/22 00:16:44 robs Exp $
  */
 
 #ifndef _FCGIAPP_H
 #include <varargs.h>
 #endif
 
-#if defined (c_plusplus) || defined (__cplusplus)
-extern "C" {
-#endif
-
-#ifdef _WIN32
-
 #ifndef DLLAPI
+#ifdef _WIN32
 #define DLLAPI __declspec(dllimport)
-#endif
-
-#else  /* !_WIN32 */
-
+#else
 #define DLLAPI
+#endif
+#endif
 
-#endif /* !_WIN32 */
+#if defined (c_plusplus) || defined (__cplusplus)
+extern "C" {
+#endif
 
 /*
  * Error codes.  Assigned to avoid conflict with EOF and errno(2).
@@ -98,9 +94,9 @@ typedef struct FCGX_Request {
     FCGX_Stream *in;
     FCGX_Stream *out;
     FCGX_Stream *err;
-       char **envp;
+    char **envp;
 
-       /* Don't use anything below here */
+    /* Don't use anything below here */
 
     struct Params *paramsPtr;
     int ipcFd;               /* < 0 means no connection */
@@ -108,8 +104,9 @@ typedef struct FCGX_Request {
     int keepConnection;       /* don't close ipcFd at end of request */
     int appStatus;
     int nWriters;             /* number of open writers (0..2) */
-       int flags;
-       int listen_sock;
+    int flags;
+    int listen_sock;
+    int detached;
 } FCGX_Request;
 
 \f
@@ -234,6 +231,18 @@ DLLAPI void FCGX_Finish_r(FCGX_Request *request);
 /*
  *----------------------------------------------------------------------
  *
+ * FCGX_Free --
+ *
+ *      Free the memory and, if close is true, 
+ *         IPC FD associated with the request (multi-thread safe).
+ *
+ *----------------------------------------------------------------------
+ */
+DLLAPI void FCGX_Free(FCGX_Request * request, int close);
+
+/*
+ *----------------------------------------------------------------------
+ *
  * FCGX_Accept --
  *
  *      Accept a new request (NOT multi-thread safe).
@@ -571,6 +580,50 @@ DLLAPI int FCGX_GetError(FCGX_Stream *stream);
  */
 DLLAPI void FCGX_ClearError(FCGX_Stream *stream);
 
+/*
+ *----------------------------------------------------------------------
+ *
+ * FCGX_CreateWriter --
+ *
+ *      Create a FCGX_Stream (used by cgi-fcgi).  This shouldn't 
+ *      be needed by a FastCGI applictaion.
+ *
+ *----------------------------------------------------------------------
+ */
+DLLAPI FCGX_Stream *FCGX_CreateWriter(
+        int socket,
+        int requestId,
+        int bufflen,
+        int streamType);
+
+/*
+ *----------------------------------------------------------------------
+ *
+ * FCGX_FreeStream --
+ *
+ *      Free a FCGX_Stream (used by cgi-fcgi).  This shouldn't 
+ *      be needed by a FastCGI applictaion.
+ *
+ *----------------------------------------------------------------------
+ */
+DLLAPI void FCGX_FreeStream(FCGX_Stream **stream);
+
+/* ----------------------------------------------------------------------
+ *
+ *  Prevent the lib from accepting any new requests.  Signal handler safe.
+ *
+ * ----------------------------------------------------------------------
+ */
+DLLAPI void FCGX_ShutdownPending(void);
+
+
+/*
+ *  Attach/Detach an accepted request from its listen socket.
+ *  XXX This is not fully implemented at this time (patch welcome).
+ */
+DLLAPI int FCGX_Attach(FCGX_Request * r);
+DLLAPI int FCGX_Detach(FCGX_Request * r);
+
 
 #if defined (__cplusplus) || defined (c_plusplus)
 } /* terminate extern "C" { */