int sp_ireset(spi *i) { uint32_t p = 0; while (p < i->icount) { sp_free(i->a, i->i[p]); p++; } sp_free(i->a, i->i); i->i = NULL; return sp_iinit(i, i->a, i->pagesize, i->cmp, i->cmparg); }
int sp_itruncate(spi *i) { sp_ifree(i); return sp_iinit(i, i->a, i->pagesize, i->cmp, i->cmparg); }