ref: d0234eb0cd492eac9501ba1e359757ce90ccb234
parent: 710daae0fea4176e4524f1107c46058cb8f197a7
author: Ori Bernstein <[email protected]>
date: Sat Jan 14 16:51:13 EST 2012
Move lappend into util.c It's no longer Node* specific.
--- a/parse/util.c
+++ b/parse/util.c
@@ -92,3 +92,15 @@
ret = xalloc(len);
return memcpy(ret, mem, len);
}
+
+void lappend(void *l, size_t *len, void *n)
+{
+ void ***pl;
+
+ assert(n != NULL);
+ pl = l;
+ *pl = xrealloc(*pl, (*len + 1)*sizeof(Node*));
+ (*pl)[*len] = n;
+ (*len)++;
+}
+