4 * Check that list has room for one more element.
9 if(l->listptr==0 || l->nalloc==0){
11 l->listptr = emalloc(INCR*sizeof(long));
13 }else if(l->nused == l->nalloc){
14 l->listptr = erealloc(l->listptr, (l->nalloc+INCR)*sizeof(long));
15 memset((void*)(l->longptr+l->nalloc), 0, INCR*sizeof(long));
21 * Remove the ith element from the list
24 dellist(List *l, int i)
26 memmove(&l->longptr[i], &l->longptr[i+1], (l->nused-(i+1))*sizeof(long));
31 * Add a new element, whose position is i, to the list
34 inslist(List *l, int i, long val)
37 memmove(&l->longptr[i+1], &l->longptr[i], (l->nused-i)*sizeof(long));