iarray_get(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

✨ iarray_get(3) ✨

okay bestie, welcome to the Library Functions Manual πŸ’– this one's short and sweet, no cap.


🌸 NAME 🌸

iarray_get β€” get pointer to nth element in iarray 🎯


πŸŽ€ SYNTAX πŸŽ€

#include <libowfat/iarray.h>

void* iarray_get(iarray* x, size_t pos);

and like, in real life you'd actually call it like this:

iarray x;
size_t pos;
t* p = iarray_get(&x,pos);

πŸ¦‹ DESCRIPTION πŸ¦‹

so iarray_get is basically iarray_allocate's chill cousin πŸ’… same energy, but with one big difference: it only works if the element has previously been allocated. it's not out here creating anything for you, okay?

and if the element in the iarray isn't there? it doesn't get weird about it β€” it just fails instead of messing with the iarray. no surprise side quests, no changing your data behind your back πŸ™ˆ

which also means it guarantees there will be no locks πŸ”“ so this function returns in deterministic time. consistent queen behavior, we love to see it πŸ‘‘


⭐ RETURN VALUE ⭐

  • returns a pointer to the requested element 🫢
  • if there's no such element in the array, it returns NULL 😭

πŸ’œ SEE ALSO πŸ’œ


and that's the whole thing, bestie β€” short page, big brain 🧠✨ go read the friends up there in SEE ALSO if you wanna actually build an iarray, because this one only reads what's already there. iykyk πŸ’…

sending you off with love from the <b>Library Functions Manual</b> πŸŽ€ this is iarray_get(3), signing out πŸŒˆπŸ¦‹