libowfat/io/iob_addbuf.c

16 lines
318 B
C
Raw Normal View History

2003-09-08 20:29:39 +00:00
#include "iob_internal.h"
2003-09-10 00:28:51 +00:00
int iob_addbuf(io_batch* b,const void* buf,uint64 n) {
2003-09-08 20:29:39 +00:00
io_entry* e=array_allocate(&b->b,sizeof(io_entry),
array_length(&b->b,sizeof(io_entry)));
if (!e) return 0;
e->type=FROMBUF;
e->fd=-1;
e->buf=buf;
e->n=n;
e->offset=0;
b->bytesleft+=n;
++b->bufs;
return 1;
}