<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/134118>134118</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc] Combine the function prototype `int (*compar)(const void *, const void *)`?
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
c8ef
</td>
</tr>
</table>
<pre>
There are several different names for the same type of function pointer parameter `int (*compar)(const void *, const void *)`:
- https://github.com/llvm/llvm-project/blob/main/libc/include/llvm-libc-types/__bsearchcompare_t.h
- https://github.com/llvm/llvm-project/blob/main/libc/include/llvm-libc-types/__lsearchcompare_t.h
And tsearch may have its own `__tsearchcompare_t.h`, resulting in a lot of code duplication. Perhaps we could generalize it to something like `__search_key_compare_t`?
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy8k82OnDAQhJ_GXFo7Ms3PwIHDZFecc8gd-acZnDU2ss2sJk8fmclmpSSXKFIkJMCmu-iqzyJGc3VEA2s-sealEHtafBhUR3Mhvb4PXxYKBCIQRLpREBa0mWcK5BI4sVKE2QdIC0EUK0G6bwR-hnl3KhnvYPPGJQqwiSBWyk-s5cYlYNgxvCi_biIw7Bl2yruY4OaNBoYXhs_w60rPWs6qC-P5eoIlpS3mdxwZjleTll2elF8Zjtbe3m9PW_BfSSWGo7ReMhxXYVzeNFIxHI1Tdtf0_nVefcpjRIbjNMlIIqjl8Z80pdPy36Ttn6QZv1ychvTYg1XcYRE3ApMi-DeX3Z2m9Htly7OhgeJuk3FXMA4EWJ9yWMprAr1v1iiRQzvBZwqL2CK8ESi_Ww1Xcjl88y0rQfIQ_UppyZ2seaWH7EN1eqX79FP6SGws9FDpvupFQUN5rqu2rOoGi2WoWmxb0o0sZaN6rPiseqVUP3f1ua0qLMyAHBtecyzPvC7x1Km21v0sSTfdWdSc1ZxWYewpW3jy4VqYGHcayqouy66wQpKNB96ID9sxgx6Gw3K5XyOruTUxxY8OySR7HImjoHmBZ79K4-jg_APt4JM_gP9npMdiD3b4a6iOSTMsP4a9Dfg9AAD__3OvQOM">