applied Rainer Kellers fix 'Header missing, define name typo'
[librfid] / include / librfid / rfid.h
1 #ifndef _RFID_H
2 #define _RFID_H
3
4 #include <stddef.h>
5 #include <sys/types.h>
6 #include <stdio.h>
7
8 #ifdef  __MINGW32__
9 #define ENOTSUP         100
10 #define ETIMEDOUT       101
11 typedef unsigned char u_int8_t;
12 typedef unsigned short u_int16_t;
13 typedef unsigned long u_int32_t;
14 typedef unsigned long long u_int64_t;
15 #endif/*__MINGW32__*/
16
17 #ifdef  __LIBRFID__
18
19 #include <librfid/rfid_system.h>
20
21 #ifdef DEBUG_LIBRFID
22
23 #ifdef LIBRFID_FIRMWARE
24 extern void debugp(const char *format, ...);
25 extern const char *hexdump(const void *data, unsigned int len);
26 #define rfid_hexdump(x, y) hexdump(x, y)
27 #define DEBUGP(x, args ...) debugp("%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
28 #define DEBUGPC(x, args ...) debugp(x, ## args)
29 #else /* LIBRFID_FIRMWARE */
30 extern const char *rfid_hexdump(const void *data, unsigned int len);
31 #define DEBUGP(x, args ...) fprintf(stderr, "%s(%d):%s: " x, __FILE__, __LINE__, __FUNCTION__, ## args)
32 #define DEBUGPC(x, args ...) fprintf(stderr, x, ## args)
33 #endif /* LIBRFID_FIRMWARE */
34
35 #include <stdio.h>
36
37 #else /* DEBUG */
38 extern const char *rfid_hexdump(const void *data, unsigned int len);
39
40 #define DEBUGP(x, args ...)
41 #define DEBUGPC(x, args ...)
42
43 #endif /* DEBUG */
44
45
46 #ifndef ARRAY_SIZE
47 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
48 #endif
49
50 #endif /* __LIBRFID__ */
51
52 int rfid_init();
53
54 enum rfid_opt_level {
55         RFID_LEVEL_ASIC,
56         RFID_LEVEL_READER,
57         RFID_LEVEL_LAYER2,
58         RFID_LEVEL_LAYER3,
59 };
60
61 enum rfid_frametype {
62         RFID_14443A_FRAME_REGULAR,
63         RFID_14443B_FRAME_REGULAR,
64         RFID_MIFARE_FRAME,
65 };
66
67 #endif /* _RFID_H */