scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

newitem.c (255B)


      1 #include "../../inc/scc.h"
      2 
      3 void
      4 newitem(struct items *items, char *item)
      5 {
      6 	if ((items->n + 1) < items->n)
      7 		die("newitem: overflow (%u + 1)", items->n);
      8 
      9 	items->s = xrealloc(items->s, (items->n + 1) * sizeof(char **));
     10 	items->s[items->n++] = item;
     11 }
     12