1 | /*
|
---|
2 | defines.h
|
---|
3 |
|
---|
4 | This file is part of the Unix driver for Towitoko smartcard readers
|
---|
5 | Copyright (C) 2000 Carlos Prados <cprados@yahoo.com>
|
---|
6 |
|
---|
7 | This version is modified by doz21 to work in a special manner ;)
|
---|
8 |
|
---|
9 | This library is free software; you can redistribute it and/or
|
---|
10 | modify it under the terms of the GNU Lesser General Public
|
---|
11 | License as published by the Free Software Foundation; either
|
---|
12 | version 2 of the License, or (at your option) any later version.
|
---|
13 |
|
---|
14 | This library is distributed in the hope that it will be useful,
|
---|
15 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
17 | Lesser General Public License for more details.
|
---|
18 |
|
---|
19 | You should have received a copy of the GNU Lesser General Public
|
---|
20 | License along with this library; if not, write to the Free Software
|
---|
21 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
---|
22 | */
|
---|
23 |
|
---|
24 | #ifndef DEFINES_H
|
---|
25 | #define DEFINES_H
|
---|
26 |
|
---|
27 | /*
|
---|
28 | * Get configuration information
|
---|
29 | */
|
---|
30 |
|
---|
31 | // #ifdef HAVE_CONFIG_H
|
---|
32 | #include "config.h"
|
---|
33 | // #endif
|
---|
34 |
|
---|
35 | /*
|
---|
36 | * Boolean constants
|
---|
37 | */
|
---|
38 |
|
---|
39 | #ifndef TRUE
|
---|
40 | #define TRUE 1
|
---|
41 | #endif
|
---|
42 |
|
---|
43 | #ifndef FALSE
|
---|
44 | #define FALSE 0
|
---|
45 | #endif
|
---|
46 |
|
---|
47 | /*
|
---|
48 | * Type definitions
|
---|
49 | */
|
---|
50 |
|
---|
51 | typedef unsigned char BYTE;
|
---|
52 | #ifndef __cplusplus
|
---|
53 | typedef int bool;
|
---|
54 | #endif
|
---|
55 | typedef unsigned short USHORT;
|
---|
56 | typedef unsigned char UCHAR;
|
---|
57 | typedef unsigned char *PUCHAR;
|
---|
58 | typedef char *STR;
|
---|
59 | #ifndef HAVE_PCSC
|
---|
60 | typedef unsigned long ULONG;
|
---|
61 | typedef ULONG RESPONSECODE;
|
---|
62 | typedef ULONG *PULONG;
|
---|
63 | typedef ULONG DWORD;
|
---|
64 | #endif
|
---|
65 | typedef void *PVOID;
|
---|
66 |
|
---|
67 | /*
|
---|
68 | * Utility macros
|
---|
69 | */
|
---|
70 |
|
---|
71 | #ifndef MAX
|
---|
72 | #define MAX(a,b) ((a)>(b)?(a):(b))
|
---|
73 | #endif
|
---|
74 |
|
---|
75 | #ifndef MIN
|
---|
76 | #define MIN(a,b) ((a)<(b)?(a):(b))
|
---|
77 | #endif
|
---|
78 |
|
---|
79 | /* Invert order of bits in a byte: b7->b0, b0->b7 */
|
---|
80 | #ifndef INVERT_BYTE
|
---|
81 | #define INVERT_BYTE(a) ((((a) << 7) & 0x80) | \
|
---|
82 | (((a) << 5) & 0x40) | \
|
---|
83 | (((a) << 3) & 0x20) | \
|
---|
84 | (((a) << 1) & 0x10) | \
|
---|
85 | (((a) >> 1) & 0x08) | \
|
---|
86 | (((a) >> 3) & 0x04) | \
|
---|
87 | (((a) >> 5) & 0x02) | \
|
---|
88 | (((a) >> 7) & 0x01))
|
---|
89 | #endif
|
---|
90 |
|
---|
91 | #endif /* DEFINES_H */
|
---|