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

✨ NAME ✨

hey bestie, welcome to fmemcmp(3) from the Library Functions Manual πŸ’–

fmemcmp β€” fuzzy comparison of two memory areas. it's literally the fuzzy-match bestie for raw memory. no cap. πŸ¦‹

πŸŽ€ SYNOPSIS πŸŽ€

#include <fstrcmp.h>
#define FSTRCMP_IDENTICAL
#define FSTRCMP_THRESHOLD
#define FSTRCMP_ERROR
double fmemcmp(const void *data1, size_t size1, const void *data2,
     size_t size2);

🌸 DESCRIPTION 🌸

okay so fmemcmp() compares the two memory areas: the size1 bytes pointed to by data1, and the size2 bytes pointed to by data2. that's the whole job. it's giving "are these two chunks of memory alike or not?" πŸ’…

πŸ”₯ RETURN VALUE πŸ”₯

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

  • 0.0 means the memory areas are utterly un-alike. not even a little bit. πŸ’€
  • FSTRCMP_IDENTICAL means the memory areas are identical. twins. periodt. πŸ‘‘
  • a value of more than FSTRCMP_THRESHOLD (it lies between 0.0 and FSTRCMP_IDENTICAL) would be considered "similar" by most people. so if you're over the threshold, the girlies are calling it similar. 🫢
  • FSTRCMP_ERROR (always negative) indicates a malloc(3) failure. 😭

🌈 SEE ALSO 🌈

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


mwah πŸ’‹ that's a wrap on fmemcmp(3) from fstrcmp version 0.7, copyright 2009 Peter Miller (and the 1988-2009 Free Software Foundation era, too). stay fuzzy, bestie! πŸŽ€βœ¨