vf_get_next_object(3)

πŸ“¦ version 1.13, in debian bookworm, ubuntu jammy, ubuntu noble

✨ vf_get_next_object β€” the girlies' guide to scrolling thru ur vobjects ✨

okay so bestie, welcome to vf_get_next_object(3), a lil function from the Library Functions Manual πŸ’– it lives in the header vf_iface.h, it's giving vformat energy, and honestly? she's the "next one please" button of the whole vobject situation. periodt.


🌸 NAME 🌸

vf_get_next_object - vf_get_next_object()

no cap, that's the whole name section. iconic of her tbh. πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <../vformat/vf_iface.h>

extern bool_t vf_get_next_object(VF_OBJECT_T **pp_object);

look at her. one include, one function, zero drama. 🌈


πŸŽ€ PARAMETERS πŸŽ€

  • VF_OBJECT_T **pp_object β€” a ptr to a pointer to the current object. yeah, double pointer, she's fancy like that πŸ’… lowkey it's a pointer-to-pointer so the function can move ur pointer for u, bestie.

πŸ’– DESCRIPTION πŸ’–

so the whole vibe here is: find the "next" vobject ✨ typically u call this right after a call to vf_read_file(), bc that function might have read a whole list of objects out of a file. like, a whole roster. a whole friend group. and u gotta walk thru them one by one.

here's the canonical lil loop, exactly how the page shows it:

if (vf_read_file(&p_object, p_filename)) { do {  ...  } while
(vf_get_next_object(&p_object)) ; }

so u read the file, u do ur lil thing in the do { ... } block, and then u ask "is there a next one bestie?" and if she says yes u go around again. πŸ”

and the important part, the value of *pp_object gets updated by the call if it returns TRUE. so she's not just answering ur question, she's actually moving u forward. main character behaviour fr fr. πŸ‘‘


⭐ RETURNS ⭐

TRUE iff found (ie. there is a "next" object). πŸ’―

like, that's it. no fancy error codes, no drama, just a yes or a no. if it's TRUE, there's another object waiting for u and ur pointer just got updated. if not... that's the end of the list, babe, go touch grass 🌸


🌈 SEE ALSO 🌈

the whole girl squad, in order, every single one, no skipping, i don't make the rules:


ok and one last thing bestie β€” this whole page was generated by c2man from vf_iface.h, and the date on it is 30 April 2003. so yeah, she's been slaying since 2003, vintage queen πŸ‘‘βœ¨ ty for coming to my ted talk, mwah πŸ«ΆπŸ’–
πŸ“¦ where this page comes from