- remove prototypes for already-removed _register() functions from headers
[librfid] / include / librfid / rfid_system.h
1 /* system / environment specific defines */
2
3 /* build for openpcd firmware */
4 #define LIBRFID_FIRMWARE
5
6 /* build without dynamic allocations */
7 //#define LIBRFID_STATIC
8 //
9 #ifdef LIBRFID_FIRMWARE
10 #define LIBRFID_STATIC
11 #endif
12
13 #ifdef __LIBRFID__
14
15 #ifndef LIBRFID_STATIC
16 /* If we're not doing a firmware compile, then we just use the regular
17  * malloc()/free() functions as expected */
18
19 #define malloc_asic_handle(x)   malloc(x)
20 #define free_asic_handle(x)     free(x)
21
22 #define malloc_layer2_handle(x) malloc(x)
23 #define free_layer2_handle(x)   free(x)
24
25 #define malloc_protocol_handle(x)       malloc(x)
26 #define free_protocol_handle(x) free(x)
27
28 #define malloc_rat_handle(x)    malloc(x)
29 #define free_rat_handle(x)      free(x)
30
31 #define malloc_reader_handle(x) malloc(x)
32 #define free_reader_handle(x)   free(x)
33
34 #else
35 /* If we're actually doing a firmware compile, then we use pre-allocated
36  * handles in order to avoid dynamic memory allocation. */
37
38 #define EMPTY_STATEMENT do {} while(0)
39 extern struct rfid_asic_handle rfid_ah;
40 #define malloc_asic_handle(x)   &rfid_ah
41 #define free_asic_handle(x)     EMPTY_STATEMENT
42
43 extern struct rfid_layer2_handle rfid_l2h;
44 #define malloc_layer2_handle(x) &rfid_l2h
45 #define free_layer2_handle(x)   EMPTY_STATEMENT
46
47 extern struct rfid_protocol_handle rfid_ph;
48 #define malloc_protocol_handle(x)       &rfid_ph
49 #define free_protocol_handle(x)         EMPTY_STATEMENT
50
51 extern struct rfid_asic_transport_handle rfid_ath;
52 #define malloc_rat_handle(x)    &rfid_ath
53 #define free_rat_handle(x)      EMPTY_STATEMENT
54
55 extern struct rfid_reader_handle rfid_rh;
56 #define malloc_reader_handle(x) &rfid_rh
57 #define free_reader_handle(x)   EMPTY_STATEMENT
58
59 #endif /* LIBRFID_STATIC */
60
61 #endif /* __LIBRFID__ */