forked from daniestevez/libfec
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathexercise.h
39 lines (32 loc) · 1.29 KB
/
exercise.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/* exercise.h
* Copyright 2019, Fedinand Blomqvist
* May be used under the terms of the GNU Lesser General Public License (LGPL)
*/
#ifndef _FEC_EXERCISE_H_
#define _FEC_EXERCISE_H_
#include "fec.h"
#define VERBOSE_NO 0
#define VERBOSE_SUMMARY 1
#define VERBOSE_VERY 2
/* Convenience macros for printing arrays of data. They are used by
* exercise_rs.h and exercise_rs_bc.h, and are unsafe to use otherwise since
* they assume that the variable i is declared and that modifying it is not
* having any adverse effect.
*/
#define print_vec(desc, vec, len, fmt) \
do {\
printf((desc)); for(i=0;i<(len);i++){ printf((fmt), (vec)[i]); } printf("\n");\
} while(0)
#define print_vec_xor(desc, a, b, len, fmt) \
do {\
printf((desc)); for(i=0;i<(len);i++){ printf((fmt), (a)[i] ^ (b)[i]); } printf("\n");\
} while(0)
int exercise_rs_8(int pad, int trials, int verbose);
int exercise_rs_ccsds(int pad, int trials, int verbose);
int exercise_rs_char(void* p, int trials, int verbose);
int exercise_rs_int(void* p, int trials, int verbose);
int exercise_rs_bc_8(int pad, int trials, int verbose);
int exercise_rs_bc_ccsds(int pad, int trials, int verbose);
int exercise_rs_bc_char(void *p, int trials, int verbose);
int exercise_rs_bc_int(void *p, int trials, int verbose);
#endif /* _FEC_EXERCISE_H_ */