--- libaitio/inc/aitio.h 2010/04/16 13:33:00 1.4.2.1 +++ libaitio/inc/aitio.h 2010/07/05 11:01:56 1.4.2.3 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ -* $Id: aitio.h,v 1.4.2.1 2010/04/16 13:33:00 misho Exp $ +* $Id: aitio.h,v 1.4.2.3 2010/07/05 11:01:56 misho Exp $ * *************************************************************************/ #ifndef __AITIO_H @@ -189,6 +189,32 @@ int ioURLGetValue(struct tagIOURL *url, const char *cs * return: -1 error:: can`t read; 0 ok */ int ioURLGetFile(struct tagIOURL *url, char * __restrict psValue, int valLen); + + +/* + * io_rread() Raw VFS read function + * @fd = File handle + * @buf = Read buffer + * @nbytes = Read buffer size + * @offset = Read from position, if -1 read nbytes from current position + * @update = Update file handle position !0 + * return: -1 error or !=-1 readed bytes + */ +inline int io_rread(int fd, void * __restrict buf, size_t nbytes, off_t offset, int update); +/* + * io_rwrite() Raw VFS write function + * @fd = File handle + * @buf = Write buffer + * @nbytes = Write bytes from buffer + * @offset = Write at position, if -1 write nbytes from current position + * @update = Update file handle position !0 + * return: -1 error or !=-1 writed bytes + */ +inline int io_rwrite(int fd, void * __restrict buf, size_t nbytes, off_t offset, int update); + +/* Disk I/O helper macros */ +#define io_read(f, b, n) io_rread(f, b, n, -1, 1) +#define io_write(f, b, n) io_rwrite(f, b, n, -1, 1) #endif