RQ_DECODE(3)

πŸ“¦
version 0.3.1 Β· 2 versions
  • 0.3.1 Β· debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 0.0.1 Β· debian bookworm
, in debian trixie, nixos 26.05, nixpkgs unstable, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ RQ_DECODE(3) ✨

okay bestie, welcome to the Librecast Programmer's Manual πŸ’– you're about to learn how to decode a RaptorQ block and honestly? iconic behavior.


🌸 NAME 🌸

rq_decode β€” decode RaptorQ block πŸ¦‹


πŸŽ€ SYNOPSIS πŸŽ€

#include <lcrq.h>

int rq_decode(rq_t *rq, uint8_t *dec, uint8_t *enc, uint32_t ESI[], uint32_t nesi);

Compile and link with -llcrq. yes queen, that's the whole vibe πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so this function decodes a RaptorQ block, using a variation of the method described in 5.4.2 of RFC6330. it's giving "I read the spec so you don't have to" energy, fr fr.

  • rq β€” must be a pointer to a valid rq_t context. like, an actual real one. not a fake one. 🫢
  • dec β€” a pointer to a buffer of at least T x K bytes. the decoded data gets written here. this is the glow-up destination, the main character buffer πŸ‘‘
  • enc β€” a pointer to the encoded block.
  • ESI[] β€” the ESI index. it's an array of ESIs, and they need to be in the same order as the encoding symbols in enc. order matters bestie, do not shuffle πŸ™ˆ
  • nesi β€” The Loch Ness Monster. or the number of decoding symbols. preferably the latter. 😭 (this manpage is hilarious, I don't make the rules)

πŸ”₯ RETURN VALUE πŸ”₯

On success, 0 is returned. If decoding fails, the function returns -1. that's it, that's the whole drama πŸ’€


⭐ EXAMPLE ⭐

/* symbols are received into enc, with their respective ESIs written to ESI
 * OH is the number of extra (overhead) symbols in addition to the
 * required K' (KP) symbols.
 * Now we can decode the object into the pre-allocated buffer dec.
 */
for (uint8_t sbn = 0; sbn < rq_Z(rq); sbn++) {
     rq_decode(rq, dec, enc[sbn], ESI[sbn], KP + OH);
}

look at that loop go. slay. ✨


🌈 SEE ALSO 🌈


LCRQ Β· 2022-07-07 Β· RQ_DECODE(3)

and that's the page bestie πŸ’– this was the Librecast Programmer's Manual, dated 2022-07-07, from the LCRQ source, and you absolutely ate. go decode something. periodt. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from