fstrcmp(3)
β¨ fstrcmp β fuzzy comparison of two strings β¨
okay bestie, pull up a chair, because fstrcmp(3) is literally the moment. this is the <fstrcmp.h> girlie from the Library Functions Manual, and she is here to tell you how similar two strings are β not just "same or not same" like some basic function, but an actual β¨vibe scoreβ¨. π
π¦ SYNOPSIS
#include <fstrcmp.h>
#define FSTRCMP_IDENTICAL
#define FSTRCMP_THRESHOLD
#define FSTRCMP_ERROR
double fstrcmp(const char *string1, const char *string2);
like. look at her. four defines and one function. minimalism, but make it iconic. π
πΈ DESCRIPTION
The fstrcmp() function compares the two strings, string1 and string2.
that's it. that's the whole description. she's mysterious, she's concise, she contains multitudes. π§
π RETURN VALUE
okay so this is the part you actually came for, so listen up fr fr.
fstrcmp returns a floating point value between 0.0 and FSTRCMP_IDENTICAL. let's break that down:
0.0β the strings are utterly un-alike. like, not even a little bit. zero chemistry. the vibe check failed. πFSTRCMP_IDENTICALβ the strings are identical. twin flames. matching energy. slay. π₯- more than
FSTRCMP_THRESHOLDβ this value lies between0.0andFSTRCMP_IDENTICAL, and crossing it means most people would consider the strings "similar". bestie-certified close enough. π«Ά
and then there's the sad path:
FSTRCMP_ERRORβ always negative, and it indicates amalloc(3)failure. π not the memory allocation ghosting us again.
ngl the threshold thing is the whole personality of this function. it's not a yes/no, it's a how much, and that's highkey gorgeous.
π SEE ALSO
your girl has a whole friend group, and you should meet all of them:
fmemcmp(3)β fuzzy comparison of two memory areas. same energy, but for raw memory. πfstrcasecmp(3)β fuzzy comparison of two strings ignoring case. becauseHELLOandhelloare obviously the same person. πfstrcmpi(3)β fuzzy comparison of two strings. yes, another one. the family is big and we love them all. βstrcmp(3)β compare two strings. the og. the strict one. no fuzzy feelings, just exact matching. iconic in her own rigid way. π
π COPYRIGHT
okay so here's the receipts, and we always give credit in this house:
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
like, the lineage? the ancestry? this function has main character energy and a family tree. πβ¨
and that's the whole fstrcmp(3) page from the Library Functions Manual, bestie β fstrcmp version 0.7, Copyright (C) 2009 Peter Miller. now go forth and compare things fuzzily. periodt. π
ππ¦
π¦ 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