#include "standards.h" #include #include #include "vec.h" type_status vec_cutn(size_t typesize, vec_type* v, size_t i, void* d, size_t n) { size_t it=i*typesize, nt=n*typesize, nit=it+nt; if (it/typesize!=i || nt/typesize!=n || nitv->len) return (errno=EINVAL, -1); if (d!=NULL) memcpy(d, v->s+it, nt); memmove(v->s+it, v->s+nit, v->len-nit); v->len-=nt; return 0; }