RQ_INIT(3)
π NAME π
rq_init, rq_free β bestie, these are the ones that make a RaptorQ context and then let it go π
β¨ SYNOPSIS β¨
#include <lcrq.h>
rq_t *rq_init(const uint64_t F, const uint16_t T);
void rq_free(rq_t *rq);
Compile and link with -llcrq, okurrr? π«Ά
πΈ DESCRIPTION πΈ
rq_init() spins up a brand new RaptorQ context and gets the whole environment set up. Like, it's giving main character energy for your encode session. π
Here's what you're handing it:
Fβ the size of the object you wanna encode. This has to be a positive integer, and it maxes out at946270874880. No cap, that's the ceiling. π«Tβ the symbol size. Usually this is literally just the size of the packet payload you're planning to send. And listen: this one must be a multiple of the Alignment parameter, which is4. Periodt. Don't argue with me on this one. π
When you're done-done? Call rq_free(3) β she deserves her rest. π
rq_free() invalidates and frees a RaptorQ context that you made with rq_init(3). Gone. Poof. π¦
π RETURN VALUE π
rq_init() hands you back a pointer to an rq_t handle. Iconic. β¨ But if things go sideways it returns NULL and sets errno to ENOMEM. π
The rq_free() function returns... nothing. No value. It's a void girly. She simply exits. π
π₯ ERRORS π₯
rq_init() can fail with the following error:
ENOMEMβ Out of memory π. Possibly, the application hit theRLIMIT_ASorRLIMIT_DATAlimit described ingetrlimit(2). Like, it ran out of room bestie, it's not that deep.
π§ EXAMPLE π§
π Program source
rq_t *rq;
rq = rq_init(filesize, 1024);
/* your program here */
rq_free(rq); /* free context when done */
See that? Init, do your lil thing, free. Clean. Tidy. Ate. π
π SEE ALSO π
rq_encode(3), rq_decode(3), rq_symbol(3), lcrq(7)
okay that's the whole page, you're literally a RaptorQ girlie now πβ¨
this was brought to you by the Librecast Programmer's Manual, LCRQ edition, dated 2022-07-07 β mwah, slay, bye π
π¦ where this page comes from
- debian bookworm: liblcrq0.0 0.0.1-2 Β· GPL-2.0-only OR GPL-3.0-only
- debian trixie: liblcrq0.0 0.2.3-1 Β· GPL-2.0-only OR GPL-3.0-only
- nixos 26.05: lcrq 0.3.1
- nixpkgs unstable: lcrq 0.4.1
- ubuntu noble: liblcrq0.0 0.1.2-1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu questing: liblcrq0.0 0.2.3-1
- ubuntu resolute: liblcrq0.0 0.3.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- ubuntu stonking: liblcrq0.0 0.3.1-1 Β· GPL-2.0-only OR GPL-3.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms