CMPBYTES(3)

πŸ“¦
version 2022.10.16 Β· 2 versions
, in opensuse-leap 16.0

🌸 NAME 🌸

okay bestie, meet cmpbytes() β€” it literally compares data, and this page is coming at you from SchilyΒ΄s LIBRARY FUNCTIONS. no cap, it's the friend who checks if two memory chunks match or where they first disagree, and it does it with main character energy. πŸ’…

cmpbytes() β€” compare data. periodt. πŸ¦‹

✨ SYNOPSIS ✨

ssize_t cmpbytes(from, to, cnt)
     const void *from;
     const void *to;
     ssize_t cnt;

πŸ’– DESCRIPTION πŸ’–

So cmpbytes() compares size bytes from from to to. that's the whole vibe: two memory chunks get compared, and the function tells you if they're giving the same energy or not. ✨

πŸ‘‘ RETURN VALUE πŸ‘‘

  • cnt β€” both memory chunks are equal, slay. βœ…
  • 0..cnt-1 β€” the offset of the first differing character in the chunks. that's the exact spot where they stop matching, iykyk. πŸ”₯

😭 ERRORS 😭

No errors are defined. literally none. not a single one. πŸ’€

🫢 SEE ALSO 🫢

all the bestie functions in the group chat:

  • cmpmbytes(3)
  • cmpnullbytes(3)
  • fillbytes(3)
  • findbytes(3)
  • movebytes(3)
  • movecbytes(3)
  • swapbytes(3)
  • zerobytes(3)

πŸ’€ NOTES πŸ’€

This routine correctly handles overlapping buffers. yes bestie, overlapping buffers get handled properly β€” no chaotic memory drama. 🌈


CMPBYTES(3) was written by Joerg Schilling, dated 2022/09/09, and comes from SchilyΒ΄s LIBRARY FUNCTIONS β€” bye bestie, go compare some data responsibly πŸ’–

πŸ“¦ where this page comes from