Finish <search.h>.
I'm unable to find a bug, but we've had requests for this internally
once or twice (though I pointed those folks at the STL), and there's
code we build for the host or in our bootloaders that would use this,
and there's reasonable-looking FreeBSD implementation ready and waiting.
Bug: N/A
Test: ran tests
Change-Id: I6ddee4b71bea4c22ed015debd31d3eaac4fcdd35
diff --git a/libc/bionic/tdestroy.cpp b/libc/bionic/tdestroy.cpp
index 95c3e64..2968ff9 100644
--- a/libc/bionic/tdestroy.cpp
+++ b/libc/bionic/tdestroy.cpp
@@ -14,10 +14,15 @@
* limitations under the License.
*/
-#define _SEARCH_PRIVATE
#include <search.h>
#include <stdlib.h>
+struct node_t {
+ char* key;
+ struct node* llink;
+ struct node* rlink;
+};
+
// Destroy a tree and free all allocated resources.
// This is a GNU extension, not available from BSD.
void tdestroy(void* root, void (*destroy_func)(void*)) {