vrb_move(3)
β¨ 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~0for unlimited (all of buffer). Yes bestie,~0means "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 thetargetor thesource. 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
- nixos 26.05: vrb 0.5.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms