#include #include #include "html.h" #include "lists.h" //lists always grow until they are freed void **append(void **l, int *lm, void *a)//put pointer at end of list, growing backing buffer if nescesary //so much void * { if(!l){ l=calloc(PRLC,sizeof(char *)); *lm=PRLC; } if(!a) return l; int len; for(len=0;(l)[len]&&len<*lm;len++); if(len==(*lm)-1){//the extra elment garuntees null terminator l=realloc(l,*lm+PRLC+1); *lm=*lm+PRLC; int i; for(i=0;i