tsearch (SunOS) tsearch (SunOS)
NAME
tsearch, tfind, tdelete, twalk - Manage binary search trees
LIBRARY
Standard C Library (libc.a)
SUN OS SYNOPSIS
#include <search.h>
char *tsearch(
char *key,
char **rootp,
int (*compar) ( ));
char *tfind(
char *key,
char **rootp,
int (*compar) ( ));
char *tdelete(
char*key,
char **rootp,
int (*compar) ( ));
void twalk(
char *root,
void (*action) ( ));
DIGITAL UNIX SYNOPSIS
#include <search.h>
void *tsearch(
const void *key,
void **rootp,
int (*compar) (const void *, const void *));
void *tfind(
const void *key,
void * const *rootp,
int (*compar) (const void *, const void *));
void *tdelete(
const void *key,
void **rootp,
int (*compar) (const void *, const void *));
void twalk(
const void *root,
void (*action) (const void *, VISIT, int));
PARAMETERS
Points to a key that specifies the entry to be searched in the binary
tree. Points to a variable that points to the root of the binary tree.
Specifies the name (that you supply) of a comparison function (str‐
cmp(), for example). This function is called with two parameters that
point to the data undergoing comparison in the binary tree. Points to
the root of the binary tree to be walked. The name of a routine to be
invoked at each node during a walk through the binary tree.
DIFFERENCES
Declaration changes: return type of tdelete() is now void*, variable
key is now void*, and variable rootp is now void**.
RELATED INFORMATION
Digital UNIX Functions:
tsearch(3) delim off
tsearch (SunOS)