X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Ffcgios.h;h=f99e5e93981c64144fa705bcd3ead1dfbc819d70;hb=b123beeec36dd9eea9e3da208fbdc42e15ede2d4;hp=47fcea1da61f95c3c2256a225eda83488608ff6c;hpb=ee03fac494268b8f1f49c1981e33503ae29fe542;p=catagits%2Ffcgi2.git diff --git a/include/fcgios.h b/include/fcgios.h index 47fcea1..f99e5e9 100755 --- a/include/fcgios.h +++ b/include/fcgios.h @@ -19,21 +19,45 @@ #define _FCGIOS_H #ifdef _WIN32 +#define WIN32_LEAN_AND_MEAN +#include +#include +#endif + +#include "fcgi_config.h" + +#ifdef HAVE_SYS_TIME_H +#include +#endif + +#ifdef HAVE_SYS_TYPES_H +#include +#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) +#ifndef O_NONBLOCK +#define O_NONBLOCK 0x0004 /* no delay */ #endif -#else -#define DLLAPI +#else /* !_WIN32 */ #define OS_Errno errno #define OS_SetErrno(err) errno = (err) -#endif +#endif /* !_WIN32 */ +#ifndef DLLAPI #ifdef _WIN32 -#include +#define DLLAPI __declspec(dllimport) +#else +#define DLLAPI +#endif #endif + /* 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 * a drop-dead timer. Its only used for AF_UNIX sockets (not TCP sockets). @@ -49,7 +73,6 @@ #define STDIN_FILENO 0 #endif - #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif @@ -66,16 +89,6 @@ #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; @@ -89,25 +102,27 @@ typedef void (*OS_AsyncProc) (ClientData clientData, int len); DLLAPI int OS_LibInit(int stdioFds[3]); DLLAPI void OS_LibShutdown(void); -DLLAPI int OS_CreateLocalIpcFd(char *bindPath); +DLLAPI int OS_CreateLocalIpcFd(const char *bindPath, int backlog); DLLAPI int OS_FcgiConnect(char *bindPath); DLLAPI int OS_Read(int fd, char * buf, size_t len); DLLAPI int OS_Write(int fd, char * buf, size_t len); DLLAPI int OS_SpawnChild(char *execPath, int listenFd); DLLAPI int OS_AsyncReadStdin(void *buf, int len, OS_AsyncProc procPtr, - ClientData clientData); + ClientData clientData); DLLAPI int OS_AsyncRead(int fd, int offset, void *buf, int len, - OS_AsyncProc procPtr, ClientData clientData); + OS_AsyncProc procPtr, ClientData clientData); DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len, - OS_AsyncProc procPtr, ClientData clientData); -DLLAPI int OS_Close(int fd); + OS_AsyncProc procPtr, ClientData clientData); +DLLAPI int OS_Close(int fd, int shutdown); DLLAPI int OS_CloseRead(int fd); DLLAPI int OS_DoIo(struct timeval *tmo); -DLLAPI int OS_FcgiIpcAccept(char *clientAddrList); -DLLAPI int OS_IpcClose(int ipcFd); -DLLAPI int OS_IsFcgi(void); +DLLAPI int OS_Accept(int listen_sock, int fail_on_intr, const char *webServerAddrs); +DLLAPI int OS_IpcClose(int ipcFd, int shutdown); +DLLAPI int OS_IsFcgi(int sock); DLLAPI void OS_SetFlags(int fd, int flags); +DLLAPI void OS_ShutdownPending(void); + #if defined (__cplusplus) || defined (c_plusplus) } /* terminate extern "C" { */ #endif