1 /* collectn.c Implements variable length pointer arrays [collections]
3 * This file is public domain.
9 void collection_init(Collection
* c
)
13 for (i
= 0; i
< 32; i
++) c
->p
[i
] = NULL
;
17 void ** colln(Collection
* c
, int index
)
21 if (c
->next
== NULL
) {
22 c
->next
= malloc(sizeof(Collection
));
23 collection_init(c
->next
);
27 return &(c
->p
[index
]);
30 void collection_reset(Collection
*c
)
34 collection_reset(c
->next
);
39 for (i
= 0; i
< 32; i
++) c
->p
[i
] = NULL
;