stralloc_diffs(3)

πŸ“¦
version 0.34 Β· 2 versions
  • 0.34 Β· alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.30 Β· fedora 43, fedora 44, ubuntu jammy
, in alpine 3.24, debian bookworm, debian trixie, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– NAME πŸ’–

okay so bestie, <pink>stralloc_diffs</pink> β€” it's literally a compare-two-strallocs situation. that's the whole job. she compares, she vibes, she tells you who's bigger. πŸ¦‹


✨ SYNTAX ✨

#include <libowfat/stralloc.h>

int stralloc_diff(const stralloc* a,const stralloc* b);
yes the page is called stralloc_diffs and the function is called stralloc_diff. no i will not be explaining that. it's giving legacy naming, and we respect her πŸ’…

🌸 DESCRIPTION 🌸

so stralloc_diff hands you back a negative number, a 0, or a positive number β€” and which one you get depends entirely on the vibe check between a and b:

  • negative β†’ a is lexicographically smaller than the string b
  • 0 β†’ they're equal, twins, matching, periodt
  • positive β†’ a is lexicographically greater than the string b

lexicographic comparison, if you're new here, is the "dictionary order" thing β€” but for bytes. it's not deep, it's not mysterious, it's just a ranking. πŸ‘‘


πŸŽ€ RETURN VALUE πŸŽ€

okay here's the whole tea, in one line:

  • <0 if a<b
  • 0 if a==b
  • >0 if a>b

that's it. that's the entire return contract. no in-between, no drama, no "it depends" β€” just less-than, equal, greater-than. iconic behaviour honestly. ✨


πŸ‘‘ SEE ALSO πŸ‘‘


and that's the whole page, bestie!! 🫢 this was stralloc_diffs(3) from the Library Functions Manual, section 3 β€” literally just the one footer line, stralloc_diffs(3), no version, no date, no extra credits, so we're keeping it cute and keeping it exact. go forth and compare your strallocs responsibly. mwah πŸ’–πŸ’