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 "char.h" 9 #include "rs-common.h" 10 11 void free_rs_char(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 */ 28 void *init_rs_char(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