14#ifndef _SReadlineInfo_
15#define _SReadlineInfo_ 1
30# define forever for ( ; ; )
35# define SSetjmp(a) sigsetjmp(a, 1)
36# define SLongjmp(a,b) siglongjmp(a, b)
37# define Sjmp_buf sigjmp_buf
39# define SSetjmp(a) setjmp(a)
40# define SLongjmp(a,b) longjmp(a, b)
41# define Sjmp_buf jmp_buf
45#define kReUseAddrYes 1
49#define kFullBufferNotRequired 00000
50#define kFullBufferRequired 00001
51#define kFullBufferRequiredExceptLast 00002
52#define kNoFirstSelect 00010
58#define kTimeoutErr (-2)
59#define kBrokenPipeErr (-3)
61#define kAddrStrToAddrMiscErr (-4)
62#define kAddrStrToAddrBadHost (-5)
64#define kSNewFailed (-6)
65#define kSBindFailed (-7)
66#define kSListenFailed (-8)
68#define kSrlBufSize 2048
81#define SAccept SAcceptS
84# if defined(NO_SIGNALS) || defined(WIN32) || defined(_WINDOWS)
85# define SAccept SAcceptS
87# define SAccept SAcceptA
91#if !defined(ETIMEDOUT) && defined(WSAETIMEDOUT)
92# define ETIMEDOUT WSAETIMEDOUT
95#if !defined(EADDRNOTAVAIL) && defined(WSAEADDRNOTAVAIL)
96# define EADDRNOTAVAIL WSAEADDRNOTAVAIL
99#if !defined(EWOULDBLOCK) && defined(WSAEWOULDBLOCK)
100# define EWOULDBLOCK WSAEWOULDBLOCK
103#if !defined(EINPROGRESS) && defined(WSAEINPROGRESS)
104# define EINPROGRESS WSAEINPROGRESS
107#if !defined(WIN32) && !defined(_WINDOWS) && !defined(closesocket)
108# define closesocket close
111#if !defined(WIN32) && !defined(_WINDOWS) && !defined(ioctlsocket)
112# define ioctlsocket ioctl
115#if defined(WIN32) || defined(_WINDOWS)
116# define SETERRNO errno = WSAGetLastError();
117# define SETWSATIMEOUTERR WSASetLastError(WSAETIMEDOUT);
120# define SETWSATIMEOUTERR
134#if (defined(__GNUC__)) && (__GNUC__ >= 2)
136# define UNUSED(a) a __attribute__ ((unused))
138# define LIBSIO_USE_VAR(a)
140# define LIBSIO_USE_VAR(a) gLibSio_Uses_Me_To_Quiet_Variable_Unused_Warnings = (a == 0)
147int PRead(
int,
char *
const,
size_t,
int);
150int PWrite(
int,
const char *
const,
size_t);
159int SBind(
int,
const int,
const int,
const int);
178int SRead(
int,
char *
const,
size_t,
int,
int);
187int SRecv(
int,
char *
const,
size_t,
int,
int,
int);
203int SSend(
int,
char *,
size_t,
int,
int);
206int SSendto(
int,
const char *
const,
size_t,
int,
const struct sockaddr_in *
const,
int);
210int SSendtoByName(
int,
const char *
const,
size_t,
int,
const char *
const,
int);
211int SendtoByName(
int,
const char *
const,
size_t,
const char *
const);
218int SWrite(
int,
const char *
const,
size_t,
int,
int);
UINT(* handler)(MSIPACKAGE *)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
int SetSocketBufSize(int, size_t, size_t)
int SSend(int, char *, size_t, int, int)
int SetSocketNagleAlgorithm(const int, const int)
int SAcceptA(int, struct sockaddr_in *const, int)
void SelectSetRemove(SelectSetPtr const, const int)
int SNewDatagramClient(void)
int SRecv(int, char *const, size_t, int, int, int)
const char * SError(int e)
int SConnectByName(int, const char *const, const int)
void FlushSReadlineInfo(SReadlineInfo *)
void SelectSetAdd(SelectSetPtr const, const int)
int PWrite(int, const char *const, size_t)
int Sendto(int, const char *const, size_t, const struct sockaddr_in *const)
int SConnect(int, const struct sockaddr_in *const, int)
struct SelectSet * SelectSetPtr
int SSendtoByName(int, const char *const, size_t, int, const char *const, int)
int SWrite(int, const char *const, size_t, int, int)
int SRecvmsg(int, void *const, int, int)
int PRead(int, char *const, size_t, int)
int GetSocketBufSize(int, size_t *const, size_t *const)
int SNewDatagramServer(const int, const int, const int)
char * AddrToAddrStr(char *const dst, size_t dsize, struct sockaddr_in *const saddrp, int dns, const char *fmt)
int SRecvfrom(int, char *const, size_t, int, struct sockaddr_in *const, int)
void DisposeSReadlineInfo(SReadlineInfo *)
int GetSocketNagleAlgorithm(const int)
int GetSocketLinger(const int, int *const)
volatile sio_sigproc_t vsio_sigproc_t
int SBind(int, const int, const int, const int)
void(*)(int) SSignal(int signum, void(*handler)(int))
int SNewStreamClient(void)
int SendtoByName(int, const char *const, size_t, const char *const)
int SNewStreamServer(const int, const int, const int, int)
int SetSocketLinger(const int, const int, const int)
int AddrStrToAddr(const char *const, struct sockaddr_in *const, const int)
int SReadline(SReadlineInfo *, char *const, size_t)
int SWaitUntilReadyForReading(const int sfd, const int tlen)
int InitSReadlineInfo(SReadlineInfo *, int, char *, size_t, int, int)
int SelectR(SelectSetPtr, SelectSetPtr)
int SRead(int, char *const, size_t, int, int)
int gLibSio_Uses_Me_To_Quiet_Variable_Unused_Warnings
int SWaitUntilReadyForWriting(const int sfd, const int tlen)
void(* sio_sigproc_t)(int)
int SelectW(SelectSetPtr, SelectSetPtr)
int SAcceptS(int, struct sockaddr_in *const, int)
void SelectSetInit(SelectSetPtr const, const double)
int SSendto(int, const char *const, size_t, int, const struct sockaddr_in *const, int)