diff options
author | Brian Gianforcaro <bgianf@serenityos.org> | 2021-12-21 15:58:29 -0800 |
---|---|---|
committer | Brian Gianforcaro <b.gianfo@gmail.com> | 2021-12-21 18:16:48 -0800 |
commit | ea355fbf17b1360221ff12f86a38c427db273309 (patch) | |
tree | 7494bc34e808dbea396e7835936d7532dc19688f /Userland/Libraries/LibC | |
parent | 140a5440513d706bc08e04b59121b74890e3d868 (diff) | |
download | serenity-ea355fbf17b1360221ff12f86a38c427db273309.zip |
LibC: Add POSIX spec comments for search APIs
Diffstat (limited to 'Userland/Libraries/LibC')
-rw-r--r-- | Userland/Libraries/LibC/search.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Userland/Libraries/LibC/search.cpp b/Userland/Libraries/LibC/search.cpp index 289fbfe5d0..76c58cc8ca 100644 --- a/Userland/Libraries/LibC/search.cpp +++ b/Userland/Libraries/LibC/search.cpp @@ -36,6 +36,7 @@ void delete_node_recursive(struct search_tree_node* node) extern "C" { +// https://pubs.opengroup.org/onlinepubs/9699919799/functions/tsearch.html void* tsearch(const void* key, void** rootp, int (*comparator)(const void*, const void*)) { if (!rootp) @@ -69,6 +70,7 @@ void* tsearch(const void* key, void** rootp, int (*comparator)(const void*, cons VERIFY_NOT_REACHED(); } +// https://pubs.opengroup.org/onlinepubs/9699919799/functions/tfind.html void* tfind(const void* key, void* const* rootp, int (*comparator)(const void*, const void*)) { if (!rootp) @@ -90,6 +92,7 @@ void* tfind(const void* key, void* const* rootp, int (*comparator)(const void*, return nullptr; } +// https://pubs.opengroup.org/onlinepubs/9699919799/functions/tdelete.html void* tdelete(const void*, void**, int (*)(const void*, const void*)) { dbgln("FIXME: Implement tdelete()"); @@ -113,6 +116,7 @@ static void twalk_internal(const struct search_tree_node* node, void (*action)(c action(node, endorder, depth); } +// https://pubs.opengroup.org/onlinepubs/9699919799/functions/twalk.html void twalk(const void* rootp, void (*action)(const void*, VISIT, int)) { auto node = static_cast<const struct search_tree_node*>(rootp); |