.TH RQ_ENCODE 3 2022-07-07 "LCRQ" "Librecast Programmer's Manual" .SH NAME rq_encode \- encode data with RaptorQ .SH SYNOPSIS .nf .B #include .PP .BI "int rq_encode(rq_t *" rq ", void *" data ", const size_t " len ");" .fi .PP Compile and link with \fI\-llcrq\fP. .SH DESCRIPTION This function is used to prepare data for the generation of encoding (original or repair) symbols. .PP Calls to API functions that generate symbols, such as .B rq_symbol\fP(3), .B rq_symbol_random\fP(3) and must be preceded with a call to .B rq_encode() . .PP .B rq_encode must be called with a pointer to valid rq_t context, .I rq and a pointer to .I data to be encoded of length .I len bytes. .PP The object pointed to by .I data will be used to generate RaptorQ intermediate symbols as per RFC6330. These are referenced by the rq context, and will be free()d when .B rq_free\fP(3) is called, along with the context itself. .PP .SH RETURN VALUE On success, 0 is returned. If encoding fails, the function returns -1. .SH SEE ALSO .BR rq_init (3), .BR rq_free (3), .BR rq_decode (3), .BR rq_symbol (3), .BR lcrq (7)