On Mon, Jun 07, 2010 at 05:02:09PM -0400, Mark Bucciarelli wrote:
> Hi,
>
> On GNU/Linux, _GNU_SOURCE enables
> tdestroy(). How do I free a binary tree in
> OpenBSD?
>
> I grepped /usr/src and didn't find any
> places "tdelete(" is used.
Can't you just do
while (rootp != NULL)
tdelete(rootp, &rootp, compar);
where, of course, compar() must be defined as usual for the tree
routines?
Note that the macros in sys/tree.h, which are available under the
liberal ISC (BSD) license and documented in tree(3), are usually
preferable to tsearch() and friends.
Joachim