vrb_get_min(3)

πŸ“¦ version 0.5.1, in nixos 26.05

πŸ’… vrb_get_min(3) β€” get minimum data from a VRB ✨

okay so welcome to the vrb_get_min page bestie!! this one lives in the VRB Programmer's Manual and honestly it's giving "all or nothing" main character energy πŸŽ€

Library: -lvrb πŸ¦‹


✨ SYNOPSIS ✨

#include <vrb.h>

size_t vrb_get_min(vrb_p vrb, char *target, size_t minsize, size_t
maxsize);

🌸 DESCRIPTION 🌸

So like, vrb_get_min grabs data out of a virtual ring buffer and copies it into the space the caller provided β€” but only if the minimum amount you asked for can actually be copied. If there's less data available than that minimum, then nope, zero data gets copied. Not a single byte. it's giving "if you can't commit, don't show up at all" πŸ˜­πŸ’€


πŸ‘‘ ARGUMENTS πŸ‘‘

  • vrb_p vrb β€” this is the virtual ring buffer we're working with, like, which one. 🫢
  • char *target β€” the location where the data gets copied to. dump it here bestie πŸ’–
  • size_t minsize β€” the minimum length of data that has to be available for the copy to happen at all. no minimum, no deal ⭐
  • size_t maxsize β€” the maximum length of data you can get out of the virtual ring buffer. the ceiling, the limit, the vibe check πŸ’…

πŸ”₯ RETURN VALUE πŸ”₯

size_t

You get back the actual length of data that was copied β€” and it can be any value from the minimum size to the maximum size, or 0. so like, it's a range, it's flexible, it's whatever the buffer decides to give you 🌈


πŸ’€ ERRORS πŸ’€

If an error comes back, then errno will be set to one of these:

  • EINVAL β€” either an invalid virtual ring buffer pointer was specified, or your minimum request exceeds the buffer capacity so it can literally never be satisfied. like, not now, not ever. so sorry bb πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

vrb(3), vrb_capacity(3), vrb_data_len(3), vrb_data_ptr(3), vrb_destroy(3), vrb_get(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)

go read all of them, i'll wait, it's a whole lore drop fr fr πŸ“šπŸ’œ


and that's the page!! this absolute icon of a manpage is from vrb, and it's dated 2002-09-30 πŸŽ€ slay, bye bestie!! πŸ’–βœ¨

πŸ“¦ where this page comes from