[libc-commits] [libc] [libc] add doc for search.h (PR #80492)

Nick Desaulniers via libc-commits libc-commits at lists.llvm.org
Fri Feb 2 15:33:58 PST 2024


================
@@ -0,0 +1,85 @@
+=============
+Search Tables
+=============
+
+.. include:: check.rst
+
+---------------
+Source location
+---------------
+
+-   The main source for bitwise utility functions is located at:
+    ``libc/src/search``.
+
+-   Hashtable implementation is located at:
+    ``libc/src/__support/HashTable``.
+
+-   The tests are located at:
+    ``libc/test/src/search/``.
+
+---------------------
+Implementation Status
+---------------------
+
+POSIX Standard Types
+====================
+
+============================ =========
+Type Name                    Available
+============================ =========
+ACTION                       |check|
+ENTRY                        |check|
+VISIT                        
+============================ =========
+
+
+GNU Extension Types
+===================
+
+============================ ================= =========
+Type Name                    Associated Macro  Available
+============================ ================= ========= 
+struct qelem                 
+__compar_fn_t                __COMPAR_FN_T
+comparison_fn_t
+__action_fn_t                __ACTION_FN_T
+__free_fn_t
----------------
nickdesaulniers wrote:

Thanks! So for `qelem`, my read of the man page is that that is historical minutia; I suspect POSIX made these functions take `void*` specifically to avoid this.  Mentioning them at all might lead users or fellow implementers to believe that these are on the TODO list.  To be clear, they are not.

As such I think we should either:
- Mark that we will not implement these.
- Simply do not mention them at all.

---

> The remaining are for the binary tree operations.

Those are not mentioned in any man pages AFAICT. Are you getting these identifiers from glibc sources?

---

> Notice that __compar_fn_t is the same as the one for qsort

Also not mentioned in any man pages. Where are you seeing any mention of `__compar_fn_t`?

https://github.com/llvm/llvm-project/pull/80492


More information about the libc-commits mailing list