vrb_data_len(3)

πŸ“¦ version 0.5.1, in nixos 26.05

πŸ’… vrb_data_len(3) β€” from the VRB Programmer's Manual, bestie

Okay so real quick, before we even start: this is vrb_data_len(3), straight out of the VRB Programmer's Manual, and it's genuinely one of the chillest little functions in the whole set. It answers exactly one question and it answers it flawlessly. Let's get into it πŸŽ€


✨ NAME ✨

vrb_data_len β€” returns the length of data. That's it. That's the whole gig. She's an icon, she's a legend, she's a one-liner πŸ‘‘

πŸ“š LIBRARY πŸ“š

-lvrb

(link against it, bestie, or none of this works πŸ’€)

🌸 SYNOPSIS 🌸

#include <vrb.h>

size_t vrb_data_len(vrb_p vrb);

πŸ¦‹ DESCRIPTION πŸ¦‹

So vrb_data_len returns the total length of data presently sitting in the given virtual ring buffer. Like, right now, at this exact moment, how much stuff is in there. That's what she does and she does it flawlessly πŸ’–

🧚 ARGUMENTS 🧚

  • vrb_p vrb β€” specifies the virtual ring buffer you want the data length of. Super straightforward.
⚠️ okay but listen β€” if you hand her a NULL or invalid pointer, the results are unpredictable and, quote unquote, "likely to be disasterous." Not me spelling it like that 😭 but also not me testing it fr. Do NOT do this. This is the vibes-are-off path. Pass a real pointer, bestie, please πŸ™ˆ

⭐ RETURN VALUE ⭐

  • size_t β€” the total data length of the virtual ring buffer gets returned to you, no cap. That's the whole payload 🫢

🌈 SEE ALSO 🌈

The whole friend group, obviously. Go say hi:

vrb(3), vrb_capacity(3), vrb_data_ptr(3), vrb_destroy(3), vrb_get(3), vrb_get_min(3), vrb_give(3), vrb_init(3), vrb_init_opt(3), vrb_is_empty(3), vrb_is_full(3), vrb_is_not_empty(3), vrb_is_not_full(3), vrb_move(3), vrb_new(3), vrb_new_opt(3), vrb_put(3), vrb_put_all(3), vrb_read(3), vrb_read_min(3), vrb_resize(3), vrb_space_len(3), vrb_space_ptr(3), vrb_take(3), vrb_uninit(3), vrb_write(3), vrb_write_min(3)


✨ that's the whole page, babe ✨ this gem is from the vrb manual, dated 2002-09-30, and honestly? she ate. go check your buffer length, love u, bye πŸ’œπŸŽ€

πŸ“¦ where this page comes from