fstrcmpi(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

πŸ’– fstrcmpi β€” like, the fuzzy string comparison one πŸ’–

okay bestie, so this is a page from the Library Functions Manual, and today we're learning about fstrcmpi(3). it's giving "are these two strings kinda the same" energy and honestly? obsessed. πŸ¦‹


✨ NAME ✨

fstrcmpi β€” fuzzy comparison of two strings 🌸


✨ SYNOPSIS ✨

#include <fstrcmp.h>
#define FSTRCMPI_IDENTICAL
#define FSTRCMPI_THRESHOLD
#define FSTRCMPI_ERROR
int fstrcmpi(const char *string1, const char *string2);

✨ DESCRIPTION ✨

so the fstrcmpi() function compares two strings, string1 and string2. that's it. that's the whole vibe. πŸ’…


✨ RETURN VALUE ✨

the fstrcmpi function hands back an int that's somewhere between 0 and FSTRCMPI_IDENTICAL. here's the tea:

  • 0 β€” the strings are utterly un-alike. like, not even a little. πŸ’€
  • FSTRCMPI_IDENTICAL β€” the strings are identical, periodt. πŸ‘‘
  • more than FSTRCMPI_THRESHOLD β€” and btw FSTRCMPI_THRESHOLD lies somewhere between 0 and FSTRCMPI_IDENTICAL β€” would be considered "similar" by most people. 🫢
  • FSTRCMPI_ERROR β€” which is always negative, btw β€” means a malloc(3) failure happened. 😭
no cap, that negative return is your signal that memory said "not today."

✨ SEE ALSO ✨

  • fstrcasecmpi(3) β€” compare two strings ignoring case ✨
  • fstrcmp(3) β€” fuzzy comparison of two strings πŸ’–
  • fmemcmp(3) β€” fuzzy comparison of two memory areas 🌈
  • strcmp(3) β€” compare two strings ⭐

this is fstrcmp version 0.7, and the copyright is Copyright (C) 2009 Peter Miller β€” you can reach him at Peter Miller <pmiller@opensource.org.au> πŸ’Œ

and here's the lore, bestie: 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 generational talent. 🧚

also: Copyright (C) 1988-2009 Free Software Foundation


and that's the whole page, bestie πŸŽ€ β€” the manual name is fstrcmpi, from the Library Functions Manual, and this little love letter of a page is fstrcmp version 0.7, dated Copyright (C) 2009 Peter Miller. slay, stay fuzzy, bye πŸ’œ