fstrcolli(3)

πŸ“¦
version 0.7.D001 Β· 2 versions
  • 0.7.D001 Β· debian bookworm, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.7 Β· alpine 3.24, nixpkgs unstable
, in debian bookworm, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu jammy, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– fstrcolli(3) πŸ’–

okay bestie, this one lives in the Library Functions Manual, section 3 (that's the "C library functions" shelf, iykyk) ✨


🌸 NAME 🌸

fstrcolli β€” fuzzy comparison of two strings using the current locale


✨ SYNOPSIS ✨

#include <fstrcmp.h>
#define FSTRCMP_IDENTICAL
#define FSTRCMP_THRESHOLD
#define FSTRCMP_ERROR
int fstrcolli(const char *string1, const char *string2);

πŸ¦‹ DESCRIPTION πŸ¦‹

so the strcolli() function compares the two strings string1 and string2. (the manpage literally spells it sting1, no shade, typo era, it means string1 🫢)

the comparison is based on strings interpreted as appropriate for the program's current locale, for category LC_CTYPE. so like, locale girlies, this one's for you πŸ’…


πŸŽ€ RETURN VALUE πŸŽ€

fstrcolli hands back an int value between 0 and FSTRCMPI_IDENTICAL. here's the vibe check on what those numbers mean:

  • 0 β€” the strings are utterly unalike. not a single crumb in common. πŸ’€
  • FSTRCMPI_IDENTICAL β€” the strings are identical. periodt, twins, matching outfits πŸ‘―
  • more than FSTRCMPI_THRESHOLD (which lies between 0 and FSTRCMPI_IDENTICAL) β€” most people would consider that "similar" 🌈 like, not the same girl but definitely cousins
  • FSTRCMPI_ERROR (always negative) β€” this one means a malloc(3) or mbstowcs(3) failure happened. red flag, abort mission, the allocation did not slay 😭
heads up: the #defines up in the synopsis are spelled FSTRCMP_IDENTICAL, FSTRCMP_THRESHOLD and FSTRCMP_ERROR, while the return value section talks about FSTRCMPI_IDENTICAL, FSTRCMPI_THRESHOLD and FSTRCMPI_ERROR. that's just how the page is written, bestie β€” I'm not touching it, not my job, I just report the lore πŸ“‹

πŸ”₯ SEE ALSO πŸ”₯

  • fstrcmpi(3) β€” fuzzy comparison of two strings
  • fstrcoll(3) β€” fuzzy comparison of two strings using the current locale
  • strcoll(3) β€” compare two strings using the current locale
  • mbstowcs(3) β€” convert a multibyte string to a wide-character string

  • fstrcmp version 0.7
  • Copyright (C) 2009 Peter Miller
  • Peter Miller <pmiller@opensource.org.au>

the comparison code is derived from the fuzzy comparison functions in GNU Gettext 0.17. and those GNU Gettext comparison functions were, in turn, derived from GNU Diff 2.7.

  • Copyright (C) 1988-2009 Free Software Foundation

okay that's the whole page, we ate and left no crumbs πŸ“πŸ’… this was fstrcolli(3) from fstrcmp version 0.7, copyright vibes going all the way back to 2009 (and the Free Software Foundation holding it down since 1988) β€” stay fuzzy, stay slay, bye bestie πŸ§šπŸ’œ