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

πŸ’– fwcscmpi β€” bestie edition πŸ’–

okay so you found a page in the Library Functions Manual and it's about fwcscmpi, and honestly? it's giving "fuzzy vibes only." sit down, grab a strawberry πŸ“, and let's get into it.


✨ NAME ✨

fwcscmpi β€” fuzzy comparison of two wide-character strings

like... it compares two wide strings but it's NOT a hater about it, it's a fuzzy comparison, iykyk πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

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

🌸 DESCRIPTION 🌸

so the fwcscmpi() function compares the two wide-character strings, string1 and string2. that's it. that's the whole thing. no cap.


πŸ‘‘ RETURN VALUE πŸ‘‘

fwcscmpi hands back an int value between 0 and FSTRCMPI_IDENTICAL. let's break it down bestie:

  • 0 β€” the two wide-character strings are utterly un-alike. like, not even a little bit. strangers. never met. πŸ’€
  • FSTRCMPI_IDENTICAL β€” the two wide-character strings are identical. twins. soulmates. periodt. ✨
  • anything more than FSTRCMPI_THRESHOLD (and just so we're clear, that value lies between 0 and FSTRCMPI_IDENTICAL) β€” most people would consider that "similar" 🫢

and then there's FSTRCMPI_ERROR, which is always negative, and it means a malloc(3) failure happened. so if you see a negative number, that's not a vibe check fail, that's a memory allocation fail 😭

ngl if you get FSTRCMPI_ERROR just know it's malloc(3)'s fault and not yours, bestie.

🌈 SEE ALSO 🌈

  • fstrcmp(3) β€” fuzzy comparison of two strings
  • fwcscmp(3) β€” fuzzy comparison of two wide-character strings
  • wcscmp(3) β€” compare two wide-character strings

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 a whole lineage, an ancestry dot com moment fr fr 🧬

Copyright (C) 1988-2009 Free Software Foundation


and that's the whole page bestie!! this one came to you straight out of the Library Functions Manual, and it's the fwcscmpi page, fstrcmp version 0.7, copyright 2009 Peter Miller energy all the way through. go compare some wide strings, you main character πŸ‘‘πŸ’–