Houston, we have a trunk.
[debian/gnuradio] / gnuradio-core / src / lib / reed-solomon / gen_ccsds.c
1 /* Generate tables for CCSDS code
2  * Copyright 2002 Phil Karn, KA9Q
3  * May be used under the terms of the GNU General Public License (GPL)
4  */
5 #include <stdio.h>
6 #include "char.h"
7
8 int main(){
9   struct rs *rs;
10   int i;
11
12   rs = init_rs_char(8,0x187,112,11,32); /* CCSDS standard */
13   printf("unsigned char CCSDS_alpha_to[] = {");
14   for(i=0;i<256;i++){
15     if((i % 16) == 0)
16       printf("\n");
17     printf("0x%02x,",rs->alpha_to[i]);
18   }
19   printf("\n};\n\nunsigned char CCSDS_index_of[] = {");
20   for(i=0;i<256;i++){
21     if((i % 16) == 0)
22       printf("\n");
23     printf("%3d,",rs->index_of[i]);
24   }
25   printf("\n};\n\nunsigned char CCSDS_poly[] = {");
26   for(i=0;i<33;i++){
27     if((i % 16) == 0)
28       printf("\n");
29
30     printf("%3d,",rs->genpoly[i]);
31   }
32   printf("\n};\n");
33   exit(0);
34 }