fstrcoll(3)
π fstrcoll β NAME π
okay so bestie, welcome to fstrcoll(3) β straight out of the Library Functions Manual, and she's here to do one job and do it iconically.
fstrcoll β fuzzy comparison of two strings using the current locale π¦
β¨ SYNOPSIS β¨
#include <fstrcmp.h>
#define FSTRCMP_IDENTICAL
#define FSTRCMP_THRESHOLD
#define FSTRCMP_ERROR
double fstrcoll(const char *string1, const char *string2);
πΈ DESCRIPTION πΈ
so the strcoll() function compares the two strings sting1 and string2. (yes bestie, it literally says sting1 in the source β typo and all, we stan a legend π
).
the comparison is based on strings interpreted as appropriate for the program's current locale for category LC_CTYPE. like, she's not just eyeballing bytes, she's doing it culturally aware, main character energy fr fr.
π RETURN VALUE π
fstrcoll hands you back a floating point value between 0.0 and FSTRCMP_IDENTICAL. here's the vibe check:
0.0β the strings are utterly unalike. not even a little. πFSTRCMP_IDENTICALβ the strings are identical. twin flames. periodt. π―- more than
FSTRCMP_THRESHOLDβ and heads up,FSTRCMP_THRESHOLDlies somewhere between0.0andFSTRCMP_IDENTICALβ that's what most people would consider "similar". π₯°
and if you get FSTRCMP_ERROR? that value is always negative, and it means a malloc(3) or mbstowcs(3) failure went down. so sorry bestie, something broke in the plumbing π
π₯ SEE ALSO π₯
fstrcmp(3)β fuzzy comparison of two stringsfstrcolli(3)β fuzzy comparison of two strings using the current localestrcoll(3)β compare two strings using the current localembstowcs(3)β convert a multibyte string to a wide-character string
π COPYRIGHT π
- 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. it's giving a whole family tree π
- Copyright (C) 1988-2009 Free Software Foundation
ngl the lineage here is unmatched β three generations of fuzzy comparison royalty just vibing in one manpage π«Ά
okay bye bestie, this was fstrcoll(3) from the Library Functions Manual, living in fstrcmp version 0.7, with that copyright clocked at 2009. go compare some strings, you're gonna slay β¨π
π¦ where this page comes from
- debian bookworm: libfstrcmp-dev 0.7.D001-3 Β· LGPL-3.0-or-later
- debian trixie: libfstrcmp-dev 0.7.D001-5 Β· GPL-3.0-or-later
- fedora 43: fstrcmp-devel 0.7.D001-26.fc43 Β· GPL-3.0-or-later
- fedora 43: fstrcmp-devel 0.7.D001-26.fc43 Β· GPL-3.0-or-later
- fedora 44: fstrcmp-devel 0.7.D001-27.fc44 Β· GPL-3.0-or-later
- fedora 44: fstrcmp-devel 0.7.D001-27.fc44 Β· GPL-3.0-or-later
- opensuse-leap 16.0: fstrcmp-devel 0.7.D001-bp160.1.12 Β· GPL-3.0-or-later
- opensuse-leap 16.0: fstrcmp-devel 0.7.D001-bp160.1.12 Β· GPL-3.0-or-later
- opensuse-leap 16.0: fstrcmp-devel 0.7.D001-bp160.1.12 Β· GPL-3.0-or-later
- opensuse-leap 16.0: fstrcmp-devel 0.7.D001-bp160.1.12 Β· GPL-3.0-or-later
- ubuntu jammy: libfstrcmp-dev 0.7.D001-2 Β· LGPL-3.0-or-later
- ubuntu noble: libfstrcmp-dev 0.7.D001-3build1 Β· LGPL-3.0-or-later
- ubuntu questing: libfstrcmp-dev 0.7.D001-5
- ubuntu resolute: libfstrcmp-dev 0.7.D001-5build1 Β· GPL-3.0-or-later
- ubuntu stonking: libfstrcmp-dev 0.7.D001-5build1 Β· GPL-3.0-or-later
- Copyright (C) 2009, 2011 Peter Miller
- Copyright (C) 2009 Peter Miller
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms