--- a/src/server/io.h Sun Oct 30 16:26:57 2011 +0100 +++ b/src/server/io.h Sun Nov 13 13:43:01 2011 +0100 @@ -29,6 +29,8 @@ #ifndef IOSTREAM_H #define IOSTREAM_H +#include "nsapi.h" + #ifdef __cplusplus extern "C" { #endif @@ -49,12 +51,28 @@ } SystemIOStream; +/* iovec buffer */ +typedef struct iovec_buf{ + struct iovec *iov; + int iovctn; + int maxiovec; + pool_handle_t *pool; +} iovec_buf_t; + + +/* system stream */ IOStream* stream_new_from_fd(int fd); - ssize_t system_write(IOStream *st, void *buf, size_t nbytes); ssize_t system_read(IOStream *st, void *buf, size_t nbytes); + +/* iovec buffer */ +iovec_buf_t *iovec_buf_create(pool_handle_t *pool); +void iovec_buf_write(iovec_buf_t *io, void *buf, size_t nbyte); +ssize_t iovec_buf_flush(iovec_buf_t *io, int fd); + + #ifdef __cplusplus } #endif