fmemcmpi(3)
π fmemcmpi(3) π
okay bestie, this one lives in the Library Functions Manual section of the man pages, and it's genuinely such a slay little function. let's get into it π«Ά
β¨ NAME β¨
fmemcmpi β fuzzy comparison of two memory areas π¦
πΈ SYNOPSIS πΈ
#include <fstrcmp.h>
#define FSTRCMPI_IDENTICAL
#define FSTRCMPI_THRESHOLD
#define FSTRCMPI_ERROR
int fmemcmpi(const void *data1, size_t size1, const void *data2, size_t
size2);
π DESCRIPTION π
The fmemcmpi() function compares the two memory areas β that's the size1 bytes pointed to by data1, and the size2 bytes pointed to by data2. that's it. that's the whole vibe. two blobs of memory, walkin' into a comparison like πβ¨
π RETURN VALUE π
fmemcmpi hands you back an int value somewhere between 0 and FSTRCMPI_IDENTICAL. let's break down the scale, bestie:
- a value of
0means the memory areas are utterly unalike π not even a little bit matching. - a value of
FSTRCMPI_IDENTICALmeans the memory areas are identical β full match, main character energy, ate and left no crumbs. π₯ - a value of more than
FSTRCMPI_THRESHOLD(and heads up, that threshold lies between0.0andFSTRCMP_IDENTICAL) would be considered "similar" by most people. so like, not identical-identical, but close enough that a human would be like "yeah those are the same thing basically". π
and then there's the sad path:
- a value of
FSTRCMPI_ERROR(which is always negative) indicates amalloc(3)failure. not the vibe. memory said no. π
π¦ SEE ALSO π¦
fmemcmp(3)β fuzzy comparison of two memory areasfstrcmpi(3)β fuzzy comparison of two stringsmemcmp(3)β compare memory areas
π 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 π it's fmemcmpi(3) from fstrcmp version 0.7, brought to you by Peter Miller and a whole lineage of fuzzy-comparison ancestors, and that footer energy is giving 2009 in the best way. go compare some memory, you've got this. 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, 2012 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