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

πŸ’– fwcscmp(3) πŸ’–

okay bestie, welcome to the fwcscmp(3) page from the Library Functions Manual ✨ we're about to get into fuzzy wide-character string comparison and it's giving main character energy, no cap. let's go πŸ’…


✨ NAME ✨

fwcscmp β€” fuzzy comparison of two wide-character strings πŸ¦‹


🌸 SYNOPSIS 🌸

#include <fstrcmp.h>
#define FSTRCMP_IDENTICAL
#define FSTRCMP_THRESHOLD
#define FSTRCMP_ERROR
double fwcscmp(const wchar_t *string1, const wchar_t *string2);

πŸŽ€ DESCRIPTION πŸŽ€

so like, fwcscmp() compares the two wide-character strings, string1 and string2. that's the whole vibe. it's a fuzzy comparison, not a strict equality thing, so it's lowkey obsessed with how similar they are rather than just "same or not same" πŸ’–


⭐ RETURN VALUE ⭐

the fwcscmp function returns a floating point value between 0.0 and FSTRCMP_IDENTICAL. here's the tea:

  • a value of 0.0 means the two wide-character strings are utterly un-alike πŸ’€
  • a value of FSTRCMP_IDENTICAL means the two wide-character strings are identical πŸ‘‘
  • a value of more than FSTRCMP_THRESHOLD (and just so you know, FSTRCMP_THRESHOLD lies between 0.0 and FSTRCMP_IDENTICAL) would be considered "similar" by most people 🫢

and if you get a value of FSTRCMP_ERROR (which is always negative), that indicates a malloc(3) failure 😭


🌈 SEE ALSO 🌈

  • fstrcmp(3) β€” fuzzy comparison of two strings
  • fwcscmpi(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. the GNU Gettext comparison functions were, in turn, derived from GNU Diff 2.7.

Copyright (C) 1988-2009 Free Software Foundation


and that's a wrap on fwcscmp(3) πŸ’– this was the Library Functions Manual page for fwcscmp(3), fstrcmp version 0.7, copyright 2009 Peter Miller β€” periodt. slay ✨πŸ’