File indexing completed on 2025-01-17 09:55:22
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018 #ifndef _FCGIOS_H
0019 #define _FCGIOS_H
0020
0021 #ifdef _WIN32
0022 #define WIN32_LEAN_AND_MEAN
0023 #include <windows.h>
0024 #include <winsock2.h>
0025 #endif
0026
0027 #include "fcgi_config.h"
0028
0029 #ifdef HAVE_SYS_TIME_H
0030 #include <sys/time.h>
0031 #endif
0032
0033 #ifdef HAVE_SYS_TYPES_H
0034 #include <sys/types.h>
0035 #endif
0036
0037 #if defined (c_plusplus) || defined (__cplusplus)
0038 extern "C" {
0039 #endif
0040
0041 #ifdef _WIN32
0042 #define OS_Errno GetLastError()
0043 #define OS_SetErrno(err) SetLastError(err)
0044 #ifndef O_NONBLOCK
0045 #define O_NONBLOCK 0x0004
0046 #endif
0047 #else
0048 #define OS_Errno errno
0049 #define OS_SetErrno(err) errno = (err)
0050 #endif
0051
0052 #ifndef DLLAPI
0053 #if defined (_WIN32) && defined (_MSC_VER)
0054 #define DLLAPI __declspec(dllimport)
0055 #else
0056 #define DLLAPI
0057 #endif
0058 #endif
0059
0060
0061
0062
0063
0064
0065
0066
0067
0068
0069
0070 #define READABLE_UNIX_FD_DROP_DEAD_TIMEVAL 2,0
0071
0072 #ifndef STDIN_FILENO
0073 #define STDIN_FILENO 0
0074 #endif
0075
0076 #ifndef STDOUT_FILENO
0077 #define STDOUT_FILENO 1
0078 #endif
0079
0080 #ifndef STDERR_FILENO
0081 #define STDERR_FILENO 2
0082 #endif
0083
0084 #ifndef MAXPATHLEN
0085 #define MAXPATHLEN 1024
0086 #endif
0087
0088 #ifndef X_OK
0089 #define X_OK 0x01
0090 #endif
0091
0092 #ifndef _CLIENTDATA
0093 # if defined(__STDC__) || defined(__cplusplus)
0094 typedef void *ClientData;
0095 # else
0096 typedef int *ClientData;
0097 # endif
0098 #define _CLIENTDATA
0099 #endif
0100
0101 typedef void (*OS_AsyncProc) (ClientData clientData, int len);
0102
0103 DLLAPI int OS_LibInit(int stdioFds[3]);
0104 DLLAPI void OS_LibShutdown(void);
0105 DLLAPI int OS_CreateLocalIpcFd(const char *bindPath, int backlog);
0106 DLLAPI int OS_FcgiConnect(char *bindPath);
0107 DLLAPI int OS_Read(int fd, char * buf, size_t len);
0108 DLLAPI int OS_Write(int fd, char * buf, size_t len);
0109 DLLAPI int OS_SpawnChild(char *execPath, int listenFd);
0110 DLLAPI int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr,
0111 ClientData clientData);
0112 DLLAPI int OS_AsyncRead(int fd, int offset, void *buf, int len,
0113 OS_AsyncProc procPtr, ClientData clientData);
0114 DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len,
0115 OS_AsyncProc procPtr, ClientData clientData);
0116 DLLAPI int OS_Close(int fd, int shutdown);
0117 DLLAPI int OS_CloseRead(int fd);
0118 DLLAPI int OS_DoIo(struct timeval *tmo);
0119 DLLAPI int OS_Accept(int listen_sock, int fail_on_intr, const char *webServerAddrs);
0120 DLLAPI int OS_IpcClose(int ipcFd, int shutdown);
0121 DLLAPI int OS_IsFcgi(int sock);
0122 DLLAPI void OS_SetFlags(int fd, int flags);
0123
0124 DLLAPI void OS_ShutdownPending(void);
0125
0126 #if defined (__cplusplus) || defined (c_plusplus)
0127 }
0128 #endif
0129
0130 #endif