vrb_move(3)

πŸ“¦ version 0.5.1, in nixos 26.05

✨ vrb_move(3) β€” the "move data into a VRB" one ✨

okay so this page is from the VRB Programmer's Manual, bestie, and it's literally all about vrb_move πŸ’…

πŸŽ€ LIBRARY πŸŽ€

-lvrb β€” that's the lib you link against, don't forget it 🫢

🌸 SYNOPSIS 🌸

#include <vrb.h>

size_t vrb_move(vrb_p target, vrb_p source, size_t size);

πŸ’– DESCRIPTION πŸ’–

vrb_move moves data from one virtual ring buffer into another. That's the whole vibe ✨

How much does it move? The lesser of these three things β€” like it's doing a little vibe check and picking the smallest:

  • the available data in the source
  • the available space in the target
  • the maximum size you specified

So no cap, it will not overflow either side. Iconic behaviour honestly πŸ‘‘

πŸ¦‹ ARGUMENTS πŸ¦‹

  • vrb_p target β€” specifies which virtual ring buffer to put data into. The destination, the main character, the one receiving the data 🎁
  • vrb_p source β€” specifies which virtual ring buffer to get data from. The giver, the source of truth, the one doing the donating πŸ“€
  • size_t size β€” specifies the maximum length to move, or ~0 for unlimited (all of buffer). Yes bestie, ~0 means "no limit, take it all" 😌

⭐ RETURN VALUE ⭐

It returns a size_t. If successful, you get the actual length of data moved back β€” which, remember, might be less than you asked for because of the whole lesser-of-three situation πŸ’«

If an error occurs, ~0 is returned. Big yikes, but at least you know πŸ’€

πŸ”₯ ERRORS πŸ”₯

If an error is returned, then errno will have the following value:

  • EINVAL β€” an invalid virtual ring buffer pointer was specified for either the target or the source. Like, one of them isn't a real VRB. Check your pointers, bestie 😭

🌈 SEE ALSO 🌈

vrb(3), vrb_capacity(3), vrb_data_len(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_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, bestie πŸ§šπŸ’œ

this little icon came from the vrb package, version dated 2002-09-30 β€” yes it's vintage, and yes it still ate πŸ“πŸ‘‘

πŸ“¦ where this page comes from