NET_CompareAddresses(3)

πŸ“¦
version 3.2.0 Β· 2 versions
, in fedora 43, fedora 44

πŸ’– NET_CompareAddresses(3) πŸ’–

okay bestie, welcome to the NET_CompareAddresses page β€” it's a section 3 joint from the SDL_net3 functions lineup, and honestly? it's a little bop. πŸŽ€


✨ NAME ✨

NET_CompareAddresses β€” compare two NET_Address objects, no cap. πŸ’…


✨ SYNOPSIS ✨

#include <SDL3_net/SDL_net.h>

int NET_CompareAddresses(const NET_Address *a, const NET_Address *b);

✨ DESCRIPTION ✨

so what does this icon actually do? it compares two addresses, periodt. and the value it hands back is literally built to be useful for qsort (or SDL_qsort). πŸ¦‹

like, that's the whole vibe β€” it's your sort-friendly little comparison function. 🌸


✨ FUNCTION PARAMETERS ✨

  • a β€” the first address you're comparing. one half of the showdown. πŸ’œ
  • b β€” the second address you're comparing. the other half. 🫢

✨ RETURN VALUE ✨

  • a value less than zero if a is "less than" b
  • a value greater than zero if a is "greater than" b
  • zero if they're equal πŸ’€βœ¨

that's it, that's the tea. classic three-way compare, the way qsort likes it. πŸ”₯


✨ THREAD SAFETY ✨

good news bestie: it is safe to call this function from any thread. no stress, no drama, go off. πŸ‘‘


✨ AVAILABILITY ✨

this function has been available since SDL_net 3.0.0. it's been here, it's been iconic. ⭐


reminder: this is NET_CompareAddresses(3), from the SDL_net manual β€” documented at version SDL_net 3.2.0. mwah, go sort something pretty πŸ’–πŸŒˆπŸ’…
πŸ“¦ where this page comes from