X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=include%2Ffcgios.h;h=4e23085907806fd450ce0748bdee9572e0a2eaa5;hb=d423c1c7cd7f6f91f8d83be964f7278dc6144040;hp=6c33638ef0c2434760f7f445c15b1d3ec8e7339d;hpb=344bf0566f5fc2d789dbca4a988cef35c68af497;p=catagits%2Ffcgi2.git diff --git a/include/fcgios.h b/include/fcgios.h index 6c33638..4e23085 100755 --- a/include/fcgios.h +++ b/include/fcgios.h @@ -18,12 +18,14 @@ #ifndef _FCGIOS_H #define _FCGIOS_H -#include "fcgi_config.h" - #ifdef _WIN32 -#include +#define WIN32_LEAN_AND_MEAN +#include +#include #endif +#include "fcgi_config.h" + #ifdef HAVE_SYS_TIME_H #include #endif @@ -32,28 +34,26 @@ extern "C" { #endif - #ifdef _WIN32 - #define OS_Errno GetLastError() #define OS_SetErrno(err) SetLastError(err) - -#ifndef DLLAPI -#define DLLAPI __declspec(dllimport) -#endif - #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 */ +#ifndef DLLAPI +#ifdef _WIN32 +#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). @@ -98,7 +98,7 @@ 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); @@ -112,11 +112,13 @@ DLLAPI int OS_AsyncWrite(int fd, int offset, void *buf, int len, DLLAPI int OS_Close(int fd); DLLAPI int OS_CloseRead(int fd); DLLAPI int OS_DoIo(struct timeval *tmo); -DLLAPI int OS_FcgiIpcAccept(char *clientAddrList); +DLLAPI int OS_Accept(int listen_sock, int fail_on_intr, const char *webServerAddrs); DLLAPI int OS_IpcClose(int ipcFd); -DLLAPI int OS_IsFcgi(void); +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