each.c
345 Bytes
#include <search.h>
#include "hash.h"
static void (*cb)(void*);
static
inline
void
walk(const void * node, const VISIT which, const int depth)
{
if (endorder == which || leaf == which) {
cb(*(void**)node);
}
}
void
hashEach(Hash this, void (*callback)(const void*))
{
cb = callback;
twalk(this->root, walk);
}
// vim: set ts=4 sw=4: