2003-09-08 20:29:39 +00:00
|
|
|
#include "iob_internal.h"
|
|
|
|
|
|
|
|
int iob_addfile(io_batch* b,int64 fd,uint64 off,uint64 n) {
|
2004-04-07 08:38:41 +00:00
|
|
|
iob_entry* e;
|
|
|
|
if (n==0) return 1;
|
2004-11-25 22:55:46 +00:00
|
|
|
io_fd(fd);
|
2004-04-07 08:38:41 +00:00
|
|
|
e=array_allocate(&b->b,sizeof(iob_entry),
|
2003-09-26 15:55:44 +00:00
|
|
|
array_length(&b->b,sizeof(iob_entry)));
|
2003-09-08 20:29:39 +00:00
|
|
|
if (!e) return 0;
|
|
|
|
e->type=FROMFILE;
|
|
|
|
e->fd=fd;
|
|
|
|
e->buf=0;
|
|
|
|
e->n=n;
|
|
|
|
e->offset=off;
|
2007-10-17 13:25:44 +00:00
|
|
|
e->cleanup=0;
|
2003-09-08 20:29:39 +00:00
|
|
|
b->bytesleft+=n;
|
|
|
|
++b->files;
|
|
|
|
return 1;
|
|
|
|
}
|