HSORT(3)

πŸ“¦ version 93vu, in opensuse-leap 16.0

✨ NAME ✨

okay so bestie, this is the HSORT(3) page from the Library Functions Manual, and the NAME line is giving hsort - array heap sort 🫢. yes, the page name says hsort while the actual function is strsort β€” we’re keeping both exactly as printed, no cap πŸ’….

🌸 SYNOPSIS 🌸

here’s the whole vibe in code form β€” literally copy it exactly:

#include <ast.h>

void    strsort(char** array, int elements, int (*compare)(const char* a, const char* b));

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so strsort does a heap sort on the array of pointers array with elements elements, using the comparison function compare πŸ”₯.

and compare is the little referee, fr fr β€” it returns:

  • -1 if a is lexicographically less than b
  • 0 if a is equal to b
  • 1 if a is lexicographically greater than b

that’s the whole compare contract, bestie β€” no extra plot twists πŸ’–.


and that’s the whole HSORT(3) page from the Library Functions Manual, bestie πŸŽ€ β€” the footer was just the page tag with no separate source/version or date info, so we’re not inventing any. periodt. πŸ’…

πŸ“¦ where this page comes from