libowfat/io/iob_reset.c

17 lines
342 B
C
Raw Normal View History

2003-09-08 20:29:39 +00:00
#include <stdlib.h>
2007-10-17 13:06:56 +00:00
#include <sys/mman.h>
2003-09-24 23:31:35 +00:00
#include "byte.h"
2003-09-08 20:29:39 +00:00
#include "iob_internal.h"
void iob_reset(io_batch* b) {
unsigned long i,l;
iob_entry* x=array_start(&b->b);
l=array_length(&b->b,sizeof(iob_entry));
for (i=0; i<l; ++i) {
if (x[i].cleanup)
x[i].cleanup(x+i);
}
2003-09-08 20:29:39 +00:00
array_reset(&b->b);
2003-09-24 23:32:42 +00:00
byte_zero(b,sizeof(*b));
2003-09-08 20:29:39 +00:00
}