1 /* Initialize a RS codec
2  *
3  * Copyright 2002 Phil Karn, KA9Q
4  * May be used under the terms of the GNU Lesser General Public License (LGPL)
5  */
6 #include <stdlib.h>
7 
8 #include "int.h"
9 #include "rs-common.h"
10 
free_rs_int(void * p)11 void free_rs_int(void *p){
12   struct rs *rs = (struct rs *)p;
13 
14   free(rs->alpha_to);
15   free(rs->index_of);
16   free(rs->genpoly);
17   free(rs);
18 }
19 
20 /* Initialize a Reed-Solomon codec
21  * symsize = symbol size, bits
22  * gfpoly = Field generator polynomial coefficients
23  * fcr = first root of RS code generator polynomial, index form
24  * prim = primitive element to generate polynomial roots
25  * nroots = RS code generator polynomial degree (number of roots)
26  * pad = padding bytes at front of shortened block
27  */
init_rs_int(int symsize,int gfpoly,int fcr,int prim,int nroots,int pad)28 void *init_rs_int(int symsize,int gfpoly,int fcr,int prim,
29 	int nroots,int pad){
30   struct rs *rs;
31 
32 #include "init_rs.h"
33 
34   return rs;
35 }
36