2 * miscellaneous utilities
6 * This software is part of the SBCL system. See the README file for
9 * This software is derived from the CMU CL system, which was
10 * written at Carnegie Mellon University and released into the
11 * public domain. The software is in the public domain and is
12 * provided with absolutely no warranty. See the COPYING and CREDITS
13 * files for more information.
17 * a utility to accumulate a zero-terminated array of void* values
19 * (Ah, lovely C, makes it such a delight to accumulate a collection
20 * whose length isn't known in advance.. but it's probably more fun
21 * than trying to teach the SBCL debugger to walk g++ stack frames, not to
22 * mention dealing with g++'s lovely in-which-file-do-templates-expand
23 * issues; or than trying to use Lisp for all accumulation and having to
24 * hassle about FFIing all the details of opendir/readdir/closedir
27 * We more or less simulate C++-style ctors and dtors.
30 voidacc
{ /* the accumulator itself, to be treated as an opaque data type */
36 int voidacc_ctor(voidacc
*); /* the ctor, returning 0 for success */
37 int voidacc_acc(voidacc
*, void*); /* Accumulate an element into result,
38 * returning 0 for success. */
39 void** voidacc_give_away_result(voidacc
*); /* giving away ownership */
40 void voidacc_dtor(voidacc
*); /* the dtor */