https://code.google.com/p/semicomplete/source/browse/codesamples/tsearch-example.c #include #include #include #include #include typedef struct foo { const char *name; int value; } foo_t; int cmp(const void *a, const void *b) { foo_t *fa, *fb; fa = (foo_t*)a; fb = (foo_t*)b; return strcmp(fa->name, fb->name); } void walker(const void *node, const VISIT which, const int depth) { foo_t *f; f = *(fo..
http://reality.sgiweb.org/davea/tsearch.c/* Copyright David Anderson 2010. This is free software. Permission hereby granted for anyone to copy or use this code for any purpose without restriction. Attribution may be given or may not, it is your choice. September 8, 2011: The tdelete example code was wrong in that it did not clean up entirely. So was the tsearch example code. Both are now fixed (..