1 #ifndef IO_BUF__COMMON__H__ 2 #define IO_BUF__COMMON__H__ 8 #define CRLF "\015\012" 29 #define IOBUF_TIMEOUT 4 31 #define IOBUF_BADFLAGS 0xf 33 #define IOBUF_SEEKABLE 0x10 35 #define IOBUF_NEEDSCLOSE 0x20 37 #define IOBUF_NEEDSFREE 0x40 39 #define IOBUF_NEEDSMUNMAP 0x80 72 #define IOBUF_SET_ERROR(io) \ 74 io->flags |= IOBUF_ERROR; \ 83 #define iobuf_closed(io) ((io)->fd == -1) 85 #define iobuf_error(io) ((io)->flags & IOBUF_ERROR) 87 #define iobuf_timedout(io) ((io)->flags & IOBUF_TIMEOUT) 89 #define iobuf_bad(io) ((io)->flags & IOBUF_BADFLAGS) unsigned bufstart
Definition: iobuf_common.h:59
char * buffer
Definition: iobuf_common.h:53
unsigned timeout
Definition: iobuf_common.h:63
unsigned buflen
Definition: iobuf_common.h:57
int iobuf_timeout(iobuf *io, int poll_out)
Definition: iobuf_timeout.c:6
int iobuf_init(iobuf *io, int fd, unsigned bufsize, char *buffer, unsigned flags)
Definition: iobuf_init.c:19
int errnum
Definition: iobuf_common.h:67
int iobuf_close(iobuf *io)
Definition: iobuf_close.c:8
int fd
Definition: iobuf_common.h:51
Definition: iobuf_common.h:48
unsigned flags
Definition: iobuf_common.h:65
unsigned iobuf_bufsize
Definition: iobuf_init.c:8
unsigned bufsize
Definition: iobuf_common.h:55
unsigned offset
Definition: iobuf_common.h:61