TSEARCH(3P)

πŸ’– hey bestie, welcome to TSEARCH(3P) πŸ’–

okay so this one lives in the POSIX Programmer's Manual, and it's filed under section 3P, which is the ✨ POSIX-flavoured ✨ part of the library. it's called tsearch and it's all about searching a binary search tree. yes, the actual tree. slay. 🌳


🌸 PROLOG 🌸

quick lil heads up before we go any further, bestie, and this one's important:

This manual page is part of the POSIX Programmer's Manual. The Linux implementation of this interface may differ (consult the corresponding Linux manual page for details of Linux behavior), or the interface may not be implemented on Linux.

ngl that last bit is giving "she might not even show up to the party" 😭 always check your own system's man page before you commit, fr fr.

πŸ‘‘ NAME πŸ‘‘

tsearch β€” search a binary search tree

like. that's the whole job. she searches. iconic behaviour. πŸ’…


✨ SYNOPSIS ✨

so here's the whole vibe, verbatim, no notes:

#include <search.h>

void *tsearch(const void *key, void **rootp,
    int (*compar)(const void *, const void *));

three args, one include, zero drama. we love a low-maintenance icon. πŸŽ€


πŸ¦‹ DESCRIPTION πŸ¦‹

okay so this is the part where I have to be honest with you: this page doesn't actually spell out the description itself. it just says:

Refer to tdelete().

that's it. that's the whole section. she's pointing you at her sister page, which honestly? valid. the tdelete() page is where the real lore lives β€” tsearch(), tfind(), tdelete() and twalk() all get explained together over there. so go read that one, bestie, I'm not even joking. 🫢


okay now the part where we give credit, because we always give credit in this house. ✨

Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

basically: if this page and the official standard ever beef, the standard wins. periodt.

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .

if you spot a typo, it's probably from the format conversion, not the standard itself β€” go tell the kernel.org man-pages folks at that link. they'll handle it. πŸ’–

🌈 SEE ALSO 🌈

not gonna lie, this page doesn't have a SEE ALSO section of its own β€” but it does tell you to go look at tdelete() in the DESCRIPTION, so that's your next stop. consider this your group-chat invite to the next page. πŸŽ€


and that's the whole thing, bestie!! you ate that. πŸ’…βœ¨

this page came to you courtesy of IEEE/The Open Group, dated 2017 β€” thanks for reading my lil rewrite of the POSIX tsearch(3P) man page, ily, go touch some grass and then go read tdelete() πŸ¦‹πŸ’œ

πŸ“¦ where this page comes from