STRCOLL(3)

๐Ÿ“ฆ
version 15.1 ยท 2 versions
, in freebsd 15.1

๐ŸŒธ NAME

okay so bestie, this is STRCOLL(3) from the Library Functions Manual โ€” the page that literally says compare strings according to current collation. It's giving โ€œsort it the way the locale says,โ€ and no cap, that's the whole assignment. Slay. ๐Ÿ’…

๐Ÿ“š LIBRARY

Standard C Library (libc, -lc). Yes, that libc. ๐Ÿ’–

โœจ SYNOPSIS

#include <string.h>

int
strcoll(const char *s1, const char *s2);

int
strcoll_l(const char *s1, const char *s2, locale_t loc);

๐Ÿ’œ DESCRIPTION

The strcoll() function lexicographically compares the null-terminated strings s1 and s2 according to the current locale collation, then returns an integer greater than, equal to, or less than 0 โ€” depending on whether s1 is greater than, equal to, or less than s2. It's a three-way vibe check: bigger, same, smaller. ๐Ÿ”ฅ

If information about the current locale collation is not available, the value of strcmp(s1, s2) is returned. Lowkey the fallback is just plain strcmp energy โ€” no collation info, no fancy sorting. ๐Ÿซถ

And strcoll_l()? Same energy, but it uses an explicit locale argument rather than the system locale. The loc is literally right there in the signature, iykyk. ๐Ÿ‘‘

๐Ÿ” SEE ALSO

๐Ÿ‘‘ STANDARDS

  • The strcoll() function conforms to ISO/IEC 9899:1990 (โ€œISO C90โ€). โญ
  • The strcoll_l() function conforms to IEEE Std 1003.1-2008 (โ€œPOSIX.1โ€). ๐ŸŒˆ

Both ate, periodt. ๐Ÿ’…


okay that's the whole page, bestie โ€” it comes from Debian, dated June 4, 1993, and STRCOLL(3) is signing off. ๐Ÿ’–โœจ

๐Ÿ“ฆ where this page comes from
  • freebsd 15.1: base 15.1
  • ๐Ÿ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms