aboutsummaryrefslogtreecommitdiff
path: root/src/pj_list.c
blob: 9fde000f6b4502e62dde7d5a2466e25d40c264a7 (plain)
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/* Projection System: default list of projections
** Use local definition of PJ_LIST_H for subset.
*/

#define USE_PJ_LIST_H 1
#include "projects.h"



#define PASTE(a,b) a##b

/* Generate prototypes for projection functions */
#define PROJ_HEAD(id, name) struct PJconsts *pj_##id(struct PJconsts*);
#include "pj_list.h"
#undef PROJ_HEAD

/* Generate prototypes for projection selftest functions */
#define PROJ_HEAD(id, name) int PASTE(pj_##id, _selftest) (void);
#include "pj_list.h"
#undef PROJ_HEAD


/* Generate extern declarations for description strings */
#define PROJ_HEAD(id, name) extern char * const pj_s_##id;
#include "pj_list.h"
#undef PROJ_HEAD


/* Generate the null-terminated list of projection functions with associated mnemonics and descriptions */
#define PROJ_HEAD(id, name) {#id, pj_##id, &pj_s_##id},
struct PJ_LIST pj_list[] = {
#include "pj_list.h"
		{0,     0,  0},
	};
#undef PROJ_HEAD


/* Generate the null-terminated list of projection selftest functions with associated mnemonics */
#define PROJ_HEAD(id, name) {#id, PASTE(pj_##id, _selftest)},
struct PJ_SELFTEST_LIST pj_selftest_list[] = {
#include "pj_list.h"
		{0,     0},
	};
#undef PROJ_HEAD
#undef PASTE


struct PJ_LIST  *pj_get_list_ref (void) {
    return pj_list;
}


struct PJ_SELFTEST_LIST  *pj_get_selftest_list_ref (void) {
    return pj_selftest_list;
}