fstrcasecmp(3)
π fstrcasecmp β the fuzzy-girlie string matcher π
okay so bestie, welcome to fstrcasecmp(3), a page from the Library Functions Manual. no cap, this one is short but it's giving extremely useful. let's get into it π«Ά
β¨ NAME β¨
fstrcasecmp β fuzzy comparison of two strings ignoring case
like, it compares two strings but it's chill about it. and it does NOT care about your capitalization. case? don't know her. π
β¨ SYNOPSIS β¨
#include <fstrcmp.h>
#define FSTRCMP_IDENTICAL
#define FSTRCMP_THRESHOLD
#define FSTRCMP_ERROR
double fstrcasecmp(const char *string1, const char *string2);
so you pull in the header, you get these three little defines β FSTRCMP_IDENTICAL, FSTRCMP_THRESHOLD and FSTRCMP_ERROR β and then there's the actual function, fstrcasecmp(), taking two const char *s named string1 and string2. iconic signature honestly πΈ
β¨ DESCRIPTION β¨
The fstrcmp() function compares the two strings, string1 and string2, ignoring case.
that's it. that's the whole vibe check. two strings walk in, case gets ignored, a fuzzy number walks out. β¨
β¨ RETURN VALUE β¨
so what do you actually get back? a floating point value between 0.0 and FSTRCMP_IDENTICAL. let's break it down, bestie:
0.0β the strings are utterly unalike. not even a little bit. strangers. π₯FSTRCMP_IDENTICALβ the strings are identical. soulmates. matching bestie bracelets. π- anything more than
FSTRCMP_THRESHOLDβ and fyi,FSTRCMP_THRESHOLDlies between0.0andFSTRCMP_IDENTICALβ would be considered "similar" by most people. so like, not twins but definitely cousins. π
π¨ and then there'sFSTRCMP_ERROR, which is always negative, and it means amalloc(3)failure happened. so if you see a negative number come back, that's not a similarity score, that's the malloc girlies failing you. be dramatic about it, you've earned it. π
β¨ SEE ALSO β¨
go read your sisters, they're all slaying in their own lanes:
fmemcmp(3)β fuzzy comparison of two memory areasfstrcasecmpi(3)β fuzzy comparison of two strings ignoring casefstrcmp(3)β fuzzy comparison of two stringsstrcasecmp(3)β compare two strings ignoring case
β¨ 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. The GNU Gettext comparison functions were, in turn, derived from GNU Diff 2.7.
Copyright (C) 1988-2009 Free Software Foundation
and that's the whole page, bestie π fstrcmp version 0.7, copyright 2009 Peter Miller, dropped back on fstrcasecmp(3) β go forth and compare things fuzzily, you absolute main character. mwah ππ¦
π¦ 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