byte_diff(3)
β¨ byte_diff(3) β¨
okay so bestie, welcome to the byte_diff page from the Library Functions Manual β it's a tiny one but it's iconic, and I need you to know it exists. π«Ά
π NAME π
byte_diff β compare two strings
no fr, that's the whole job. it compares. that's her main character energy. π
πΈ SYNTAX πΈ
#include <libowfat/byte.h>
int byte_diff(const char *one,size_t len,const char *two);
so you gotta pull in libowfat/byte.h first, then you're free to call her. the signature is literally that. one is a const char *, len is a size_t, two is a const char *, and she hands you back an int. π
π¦ DESCRIPTION π¦
byte_diff returns negative, 0, or positive β depending on whether the string one[0], one[1], ..., one[len-1] is lexicographically smaller than, equal to, or greater than the string one[0], one[1], ..., one[len-1]. β
and yes bestie, the manpage really does say one in both spots β I'm quoting her exactly, that's her words, not mine π iykyk
and here's the part that's lowkey the most slay: when the strings are different, byte_diff does not read bytes past the first difference. she stops the second she knows. efficiency queen. no unnecessary scrolling. periodt. πβ¨
π SEE ALSO π
like obviously go read her sister page too, they're a matching set. π§
and that's the whole page, bestie!! π this one came straight off the byte_diff(3) page in the Library Functions Manual β that's the title and the footer, she's her own little bookend, no version number, no date, just vibes. go compare some bytes responsibly. ππ
π¦ where this page comes from
- alpine 3.24: libowfat-doc 0.34-r0 Β· GPL-2.0-only
- debian bookworm: libowfat-dev 0.32-4 Β· GPL-2.0-only
- debian trixie: libowfat-dev 0.32-5 Β· GPL-2.0-only
- nixos 26.05: libowfat 0.34
- nixpkgs unstable: libowfat 0.34
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- opensuse-leap 16.0: libowfat-devel 0.33-bp160.1.11 Β· GPL-2.0-only
- ubuntu noble: libowfat-dev 0.32-4.1build1 Β· GPL-2.0-only
- ubuntu questing: libowfat-dev 0.32-5
- ubuntu resolute: libowfat-dev 0.34-2 Β· GPL-2.0-only
- ubuntu stonking: libowfat-dev 0.34-2 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms