stralloc_diffs(3)
π NAME π
okay so bestie, gather round: stralloc_diffs β check if string is prefix of stralloc. that's the whole vibe. we're comparing things. slay.
this one lives in the stralloc_diffs(3) page from the Library Functions Manual, so you already know it's gonna be a cute little string-comparison situation. π
β¨ SYNTAX β¨
#include <libowfat/stralloc.h>
int stralloc_diffs(stralloc* a,const char* b);
two args, one int coming back at you. no cap. π
π¦ DESCRIPTION π¦
stralloc_diffs returns negative, 0, or positive, depending on whether the \0-terminated string in a, without the terminating \0, is lexicographically smaller than, equal to, or greater than the string stored in a.
yes, quoting the page exactly here π«Ά β that last bit says a, and we are simply passing the message along, no edits, no notes.
so basically: negative / zero / positive, and which one you get tells you whether the first thing is smaller than, equal to, or bigger than the other thing, lexicographically. it's giving comparison energy. it's giving "i will not elaborate further." πΈ
π RETURN VALUE π
<0ifa<b0ifa==b>0ifa>b
three outcomes, one int, we love a low-stakes king. β
π₯ SEE ALSO π₯
go read those too, bestie, the whole friend group is iconic. π
and that's the page!! it's from the stralloc_diffs(3) corner of the Library Functions Manual, and yeah β the footer is just stralloc_diffs(3) again, the page said its own name twice like a main character. periodt. πβ¨π
π¦ 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