|
|
2edde3 |
From c0ea79151d25c2e2e486cbc86cbdf9f375c13e34 Mon Sep 17 00:00:00 2001
|
|
|
2edde3 |
From: Boris Ranto <branto@redhat.com>
|
|
|
2edde3 |
Date: Tue, 21 Feb 2017 13:46:59 +0100
|
|
|
2edde3 |
Subject: [PATCH] Add fake fcgiapp.h for rgw
|
|
|
2edde3 |
|
|
|
2edde3 |
- do not link against fcgi
|
|
|
2edde3 |
|
|
|
2edde3 |
Signed-off-by: Boris Ranto <branto@redhat.com>
|
|
|
2edde3 |
---
|
|
|
2edde3 |
src/rgw/Makefile.am | 1 -
|
|
|
2edde3 |
src/rgw/fcgiapp.h | 622 ++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
|
2edde3 |
2 files changed, 622 insertions(+), 1 deletion(-)
|
|
|
2edde3 |
create mode 100644 src/rgw/fcgiapp.h
|
|
|
2edde3 |
|
|
|
2edde3 |
diff --git a/src/rgw/Makefile.am b/src/rgw/Makefile.am
|
|
|
2edde3 |
index a94e4e2..d4c5ad8 100644
|
|
|
2edde3 |
--- a/src/rgw/Makefile.am
|
|
|
2edde3 |
+++ b/src/rgw/Makefile.am
|
|
|
2edde3 |
@@ -93,7 +93,6 @@ LIBRGW_DEPS += \
|
|
|
2edde3 |
-lcurl \
|
|
|
2edde3 |
-lexpat \
|
|
|
2edde3 |
-lm \
|
|
|
2edde3 |
- -lfcgi \
|
|
|
2edde3 |
-ldl
|
|
|
2edde3 |
|
|
|
2edde3 |
librgw_la_LIBADD = $(LIBRGW_DEPS) \
|
|
|
2edde3 |
diff --git a/src/rgw/fcgiapp.h b/src/rgw/fcgiapp.h
|
|
|
2edde3 |
new file mode 100644
|
|
|
2edde3 |
index 0000000..41852f9
|
|
|
2edde3 |
--- /dev/null
|
|
|
2edde3 |
+++ b/src/rgw/fcgiapp.h
|
|
|
2edde3 |
@@ -0,0 +1,622 @@
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ * fcgiapp.h --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Definitions for FastCGI application server programs
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Copyright (c) 1996 Open Market, Inc.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * See the file "LICENSE.TERMS" for information on usage and redistribution
|
|
|
2edde3 |
+ * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * $Id: fcgiapp.h,v 1.12 2001/11/21 21:10:11 robs Exp $
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+#ifndef _FCGIAPP_H
|
|
|
2edde3 |
+#define _FCGIAPP_H
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/* Hack to see if we are building TCL - TCL needs varargs not stdarg */
|
|
|
2edde3 |
+#ifndef TCL_LIBRARY
|
|
|
2edde3 |
+#include <stdarg.h>
|
|
|
2edde3 |
+#else
|
|
|
2edde3 |
+#include <varargs.h>
|
|
|
2edde3 |
+#endif
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+#ifndef DLLAPI
|
|
|
2edde3 |
+#ifdef _WIN32
|
|
|
2edde3 |
+#define DLLAPI __declspec(dllimport)
|
|
|
2edde3 |
+#else
|
|
|
2edde3 |
+#define DLLAPI
|
|
|
2edde3 |
+#endif
|
|
|
2edde3 |
+#endif
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+#if defined (c_plusplus) || defined (__cplusplus)
|
|
|
2edde3 |
+extern "C" {
|
|
|
2edde3 |
+#endif
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ * Error codes. Assigned to avoid conflict with EOF and errno(2).
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+#define FCGX_UNSUPPORTED_VERSION -2
|
|
|
2edde3 |
+#define FCGX_PROTOCOL_ERROR -3
|
|
|
2edde3 |
+#define FCGX_PARAMS_ERROR -4
|
|
|
2edde3 |
+#define FCGX_CALL_SEQ_ERROR -5
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ * This structure defines the state of a FastCGI stream.
|
|
|
2edde3 |
+ * Streams are modeled after the FILE type defined in stdio.h.
|
|
|
2edde3 |
+ * (We wouldn't need our own if platform vendors provided a
|
|
|
2edde3 |
+ * standard way to subclass theirs.)
|
|
|
2edde3 |
+ * The state of a stream is private and should only be accessed
|
|
|
2edde3 |
+ * by the procedures defined below.
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+typedef struct FCGX_Stream {
|
|
|
2edde3 |
+ unsigned char *rdNext; /* reader: first valid byte
|
|
|
2edde3 |
+ * writer: equals stop */
|
|
|
2edde3 |
+ unsigned char *wrNext; /* writer: first free byte
|
|
|
2edde3 |
+ * reader: equals stop */
|
|
|
2edde3 |
+ unsigned char *stop; /* reader: last valid byte + 1
|
|
|
2edde3 |
+ * writer: last free byte + 1 */
|
|
|
2edde3 |
+ unsigned char *stopUnget; /* reader: first byte of current buffer
|
|
|
2edde3 |
+ * fragment, for ungetc
|
|
|
2edde3 |
+ * writer: undefined */
|
|
|
2edde3 |
+ int isReader;
|
|
|
2edde3 |
+ int isClosed;
|
|
|
2edde3 |
+ int wasFCloseCalled;
|
|
|
2edde3 |
+ int FCGI_errno; /* error status */
|
|
|
2edde3 |
+ void (*fillBuffProc) (struct FCGX_Stream *stream);
|
|
|
2edde3 |
+ void (*emptyBuffProc) (struct FCGX_Stream *stream, int doClose);
|
|
|
2edde3 |
+ void *data;
|
|
|
2edde3 |
+} FCGX_Stream;
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ * An environment (as defined by environ(7)): A NULL-terminated array
|
|
|
2edde3 |
+ * of strings, each string having the form name=value.
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+typedef char **FCGX_ParamArray;
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ * FCGX_Request Flags
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Setting FCGI_FAIL_ACCEPT_ON_INTR prevents FCGX_Accept() from
|
|
|
2edde3 |
+ * restarting upon being interrupted.
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+#define FCGI_FAIL_ACCEPT_ON_INTR 1
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ * FCGX_Request -- State associated with a request.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Its exposed for API simplicity, I expect parts of it to change!
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+typedef struct FCGX_Request {
|
|
|
2edde3 |
+ int requestId; /* valid if isBeginProcessed */
|
|
|
2edde3 |
+ int role;
|
|
|
2edde3 |
+ FCGX_Stream *in;
|
|
|
2edde3 |
+ FCGX_Stream *out;
|
|
|
2edde3 |
+ FCGX_Stream *err;
|
|
|
2edde3 |
+ char **envp;
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+ /* Don't use anything below here */
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+ struct Params *paramsPtr;
|
|
|
2edde3 |
+ int ipcFd; /* < 0 means no connection */
|
|
|
2edde3 |
+ int isBeginProcessed; /* FCGI_BEGIN_REQUEST seen */
|
|
|
2edde3 |
+ int keepConnection; /* don't close ipcFd at end of request */
|
|
|
2edde3 |
+ int appStatus;
|
|
|
2edde3 |
+ int nWriters; /* number of open writers (0..2) */
|
|
|
2edde3 |
+ int flags;
|
|
|
2edde3 |
+ int listen_sock;
|
|
|
2edde3 |
+} FCGX_Request;
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ * Control
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_IsCGI --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Returns TRUE iff this process appears to be a CGI process
|
|
|
2edde3 |
+ * rather than a FastCGI process.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_IsCGI(void) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_Init --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Initialize the FCGX library. Call in multi-threaded apps
|
|
|
2edde3 |
+ * before calling FCGX_Accept_r().
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Returns 0 upon success.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_Init(void) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_OpenSocket --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Create a FastCGI listen socket.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * path is the Unix domain socket (named pipe for WinNT), or a colon
|
|
|
2edde3 |
+ * followed by a port number. e.g. "/tmp/fastcgi/mysocket", ":5000"
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * backlog is the listen queue depth used in the listen() call.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Returns the socket's file descriptor or -1 on error.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_OpenSocket(const char *path, int backlog) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_InitRequest --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Initialize a FCGX_Request for use with FCGX_Accept_r().
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * sock is a file descriptor returned by FCGX_OpenSocket() or 0 (default).
|
|
|
2edde3 |
+ * The only supported flag at this time is FCGI_FAIL_ON_INTR.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Returns 0 upon success.
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_InitRequest(FCGX_Request *request, int sock, int flags) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_Accept_r --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Accept a new request (multi-thread safe). Be sure to call
|
|
|
2edde3 |
+ * FCGX_Init() first.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * 0 for successful call, -1 for error.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Side effects:
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Finishes the request accepted by (and frees any
|
|
|
2edde3 |
+ * storage allocated by) the previous call to FCGX_Accept.
|
|
|
2edde3 |
+ * Creates input, output, and error streams and
|
|
|
2edde3 |
+ * assigns them to *in, *out, and *err respectively.
|
|
|
2edde3 |
+ * Creates a parameters data structure to be accessed
|
|
|
2edde3 |
+ * via getenv(3) (if assigned to environ) or by FCGX_GetParam
|
|
|
2edde3 |
+ * and assigns it to *envp.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * DO NOT retain pointers to the envp array or any strings
|
|
|
2edde3 |
+ * contained in it (e.g. to the result of calling FCGX_GetParam),
|
|
|
2edde3 |
+ * since these will be freed by the next call to FCGX_Finish
|
|
|
2edde3 |
+ * or FCGX_Accept.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * DON'T use the FCGX_Request, its structure WILL change.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_Accept_r(FCGX_Request *request) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_Finish_r --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Finish the request (multi-thread safe).
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Side effects:
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Finishes the request accepted by (and frees any
|
|
|
2edde3 |
+ * storage allocated by) the previous call to FCGX_Accept.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * DO NOT retain pointers to the envp array or any strings
|
|
|
2edde3 |
+ * contained in it (e.g. to the result of calling FCGX_GetParam),
|
|
|
2edde3 |
+ * since these will be freed by the next call to FCGX_Finish
|
|
|
2edde3 |
+ * or FCGX_Accept.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI void FCGX_Finish_r(FCGX_Request *request) {};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_Free --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Free the memory and, if close is true,
|
|
|
2edde3 |
+ * IPC FD associated with the request (multi-thread safe).
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI void FCGX_Free(FCGX_Request * request, int close) {};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_Accept --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Accept a new request (NOT multi-thread safe).
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * 0 for successful call, -1 for error.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Side effects:
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Finishes the request accepted by (and frees any
|
|
|
2edde3 |
+ * storage allocated by) the previous call to FCGX_Accept.
|
|
|
2edde3 |
+ * Creates input, output, and error streams and
|
|
|
2edde3 |
+ * assigns them to *in, *out, and *err respectively.
|
|
|
2edde3 |
+ * Creates a parameters data structure to be accessed
|
|
|
2edde3 |
+ * via getenv(3) (if assigned to environ) or by FCGX_GetParam
|
|
|
2edde3 |
+ * and assigns it to *envp.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * DO NOT retain pointers to the envp array or any strings
|
|
|
2edde3 |
+ * contained in it (e.g. to the result of calling FCGX_GetParam),
|
|
|
2edde3 |
+ * since these will be freed by the next call to FCGX_Finish
|
|
|
2edde3 |
+ * or FCGX_Accept.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_Accept(
|
|
|
2edde3 |
+ FCGX_Stream **in,
|
|
|
2edde3 |
+ FCGX_Stream **out,
|
|
|
2edde3 |
+ FCGX_Stream **err,
|
|
|
2edde3 |
+ FCGX_ParamArray *envp) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_Finish --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Finish the current request (NOT multi-thread safe).
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Side effects:
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Finishes the request accepted by (and frees any
|
|
|
2edde3 |
+ * storage allocated by) the previous call to FCGX_Accept.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * DO NOT retain pointers to the envp array or any strings
|
|
|
2edde3 |
+ * contained in it (e.g. to the result of calling FCGX_GetParam),
|
|
|
2edde3 |
+ * since these will be freed by the next call to FCGX_Finish
|
|
|
2edde3 |
+ * or FCGX_Accept.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI void FCGX_Finish(void) {};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_StartFilterData --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * stream is an input stream for a FCGI_FILTER request.
|
|
|
2edde3 |
+ * stream is positioned at EOF on FCGI_STDIN.
|
|
|
2edde3 |
+ * Repositions stream to the start of FCGI_DATA.
|
|
|
2edde3 |
+ * If the preconditions are not met (e.g. FCGI_STDIN has not
|
|
|
2edde3 |
+ * been read to EOF) sets the stream error code to
|
|
|
2edde3 |
+ * FCGX_CALL_SEQ_ERROR.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * 0 for a normal return, < 0 for error
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_StartFilterData(FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_SetExitStatus --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Sets the exit status for stream's request. The exit status
|
|
|
2edde3 |
+ * is the status code the request would have exited with, had
|
|
|
2edde3 |
+ * the request been run as a CGI program. You can call
|
|
|
2edde3 |
+ * SetExitStatus several times during a request; the last call
|
|
|
2edde3 |
+ * before the request ends determines the value.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI void FCGX_SetExitStatus(int status, FCGX_Stream *stream) {};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ * Parameters
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_GetParam -- obtain value of FCGI parameter in environment
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * Value bound to name, NULL if name not present in the
|
|
|
2edde3 |
+ * environment envp. Caller must not mutate the result
|
|
|
2edde3 |
+ * or retain it past the end of this request.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI char *FCGX_GetParam(const char *name, FCGX_ParamArray envp) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ * Readers
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_GetChar --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Reads a byte from the input stream and returns it.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * The byte, or EOF (-1) if the end of input has been reached.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_GetChar(FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_UnGetChar --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Pushes back the character c onto the input stream. One
|
|
|
2edde3 |
+ * character of pushback is guaranteed once a character
|
|
|
2edde3 |
+ * has been read. No pushback is possible for EOF.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * Returns c if the pushback succeeded, EOF if not.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_UnGetChar(int c, FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_GetStr --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Reads up to n consecutive bytes from the input stream
|
|
|
2edde3 |
+ * into the character array str. Performs no interpretation
|
|
|
2edde3 |
+ * of the input bytes.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * Number of bytes read. If result is smaller than n,
|
|
|
2edde3 |
+ * the end of input has been reached.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_GetStr(char *str, int n, FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_GetLine --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Reads up to n-1 consecutive bytes from the input stream
|
|
|
2edde3 |
+ * into the character array str. Stops before n-1 bytes
|
|
|
2edde3 |
+ * have been read if '\n' or EOF is read. The terminating '\n'
|
|
|
2edde3 |
+ * is copied to str. After copying the last byte into str,
|
|
|
2edde3 |
+ * stores a '\0' terminator.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * NULL if EOF is the first thing read from the input stream,
|
|
|
2edde3 |
+ * str otherwise.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI char *FCGX_GetLine(char *str, int n, FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_HasSeenEOF --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Returns EOF if end-of-file has been detected while reading
|
|
|
2edde3 |
+ * from stream; otherwise returns 0.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Note that FCGX_HasSeenEOF(s) may return 0, yet an immediately
|
|
|
2edde3 |
+ * following FCGX_GetChar(s) may return EOF. This function, like
|
|
|
2edde3 |
+ * the standard C stdio function feof, does not provide the
|
|
|
2edde3 |
+ * ability to peek ahead.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * EOF if end-of-file has been detected, 0 if not.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+DLLAPI int FCGX_HasSeenEOF(FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ * Writers
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_PutChar --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Writes a byte to the output stream.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * The byte, or EOF (-1) if an error occurred.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_PutChar(int c, FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_PutStr --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Writes n consecutive bytes from the character array str
|
|
|
2edde3 |
+ * into the output stream. Performs no interpretation
|
|
|
2edde3 |
+ * of the output bytes.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * Number of bytes written (n) for normal return,
|
|
|
2edde3 |
+ * EOF (-1) if an error occurred.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_PutStr(const char *str, int n, FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_PutS --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Writes a null-terminated character string to the output stream.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * number of bytes written for normal return,
|
|
|
2edde3 |
+ * EOF (-1) if an error occurred.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_PutS(const char *str, FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_FPrintF, FCGX_VFPrintF --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Performs printf-style output formatting and writes the results
|
|
|
2edde3 |
+ * to the output stream.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * number of bytes written for normal return,
|
|
|
2edde3 |
+ * EOF (-1) if an error occurred.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_FPrintF(FCGX_Stream *stream, const char *format, ...) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+DLLAPI int FCGX_VFPrintF(FCGX_Stream *stream, const char *format, va_list arg) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_FFlush --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Flushes any buffered output.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Server-push is a legitimate application of FCGX_FFlush.
|
|
|
2edde3 |
+ * Otherwise, FCGX_FFlush is not very useful, since FCGX_Accept
|
|
|
2edde3 |
+ * does it implicitly. Calling FCGX_FFlush in non-push applications
|
|
|
2edde3 |
+ * results in extra writes and therefore reduces performance.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * EOF (-1) if an error occurred.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_FFlush(FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ * Both Readers and Writers
|
|
|
2edde3 |
+ *======================================================================
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_FClose --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Closes the stream. For writers, flushes any buffered
|
|
|
2edde3 |
+ * output.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Close is not a very useful operation since FCGX_Accept
|
|
|
2edde3 |
+ * does it implicitly. Closing the out stream before the
|
|
|
2edde3 |
+ * err stream results in an extra write if there's nothing
|
|
|
2edde3 |
+ * in the err stream, and therefore reduces performance.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Results:
|
|
|
2edde3 |
+ * EOF (-1) if an error occurred.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_FClose(FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_GetError --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Return the stream error code. 0 means no error, > 0
|
|
|
2edde3 |
+ * is an errno(2) error, < 0 is an FastCGI error.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI int FCGX_GetError(FCGX_Stream *stream) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_ClearError --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Clear the stream error code and end-of-file indication.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI void FCGX_ClearError(FCGX_Stream *stream) {};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_CreateWriter --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Create a FCGX_Stream (used by cgi-fcgi). This shouldn't
|
|
|
2edde3 |
+ * be needed by a FastCGI applictaion.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI FCGX_Stream *FCGX_CreateWriter(
|
|
|
2edde3 |
+ int socket,
|
|
|
2edde3 |
+ int requestId,
|
|
|
2edde3 |
+ int bufflen,
|
|
|
2edde3 |
+ int streamType) {return 0;};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/*
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * FCGX_FreeStream --
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Free a FCGX_Stream (used by cgi-fcgi). This shouldn't
|
|
|
2edde3 |
+ * be needed by a FastCGI applictaion.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ *----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI void FCGX_FreeStream(FCGX_Stream **stream) {};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+/* ----------------------------------------------------------------------
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * Prevent the lib from accepting any new requests. Signal handler safe.
|
|
|
2edde3 |
+ *
|
|
|
2edde3 |
+ * ----------------------------------------------------------------------
|
|
|
2edde3 |
+ */
|
|
|
2edde3 |
+DLLAPI void FCGX_ShutdownPending(void) {};
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+#if defined (__cplusplus) || defined (c_plusplus)
|
|
|
2edde3 |
+} /* terminate extern "C" { */
|
|
|
2edde3 |
+#endif
|
|
|
2edde3 |
+
|
|
|
2edde3 |
+#endif /* _FCGIAPP_H */
|
|
|
2edde3 |
--
|
|
|
2edde3 |
2.9.3
|
|
|
2edde3 |
|