pcsc-lite  1.8.20
wintypes.h
Go to the documentation of this file.
1 /*
2  * MUSCLE SmartCard Development ( http://pcsclite.alioth.debian.org/pcsclite.html )
3  *
4  * Copyright (C) 1999
5  * David Corcoran <corcoran@musclecard.com>
6  * Copyright (C) 2002-2011
7  * Ludovic Rousseau <ludovic.rousseau@free.fr>
8  *
9 Redistribution and use in source and binary forms, with or without
10 modification, are permitted provided that the following conditions
11 are met:
12 
13 1. Redistributions of source code must retain the above copyright
14  notice, this list of conditions and the following disclaimer.
15 2. Redistributions in binary form must reproduce the above copyright
16  notice, this list of conditions and the following disclaimer in the
17  documentation and/or other materials provided with the distribution.
18 3. The name of the author may not be used to endorse or promote products
19  derived from this software without specific prior written permission.
20 
21 THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
22 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
23 OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
24 IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
25 INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
26 NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
30 THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
32 
38 #ifndef __wintypes_h__
39 #define __wintypes_h__
40 
41 #ifdef __cplusplus
42 extern "C"
43 {
44 #endif
45 
46 #ifdef __APPLE__
47 
48 #include <stdint.h>
49 
50 #ifndef BYTE
51  typedef uint8_t BYTE;
52 #endif
53  typedef uint8_t UCHAR;
54  typedef UCHAR *PUCHAR;
55  typedef uint16_t USHORT;
56 
57 #ifndef __COREFOUNDATION_CFPLUGINCOM__
58  typedef uint32_t ULONG;
59  typedef void *LPVOID;
60  typedef int16_t BOOL;
61 #endif
62 
63  typedef ULONG *PULONG;
64  typedef const void *LPCVOID;
65  typedef uint32_t DWORD;
66  typedef DWORD *PDWORD;
67  typedef uint16_t WORD;
68  typedef int32_t LONG;
69  typedef const char *LPCSTR;
70  typedef const BYTE *LPCBYTE;
71  typedef BYTE *LPBYTE;
72  typedef DWORD *LPDWORD;
73  typedef char *LPSTR;
74 
75 #else
76 
77 #ifndef BYTE
78  typedef unsigned char BYTE;
79 #endif
80  typedef unsigned char UCHAR;
81  typedef UCHAR *PUCHAR;
82  typedef unsigned short USHORT;
83 
84 #ifndef __COREFOUNDATION_CFPLUGINCOM__
85  typedef unsigned long ULONG;
86  typedef void *LPVOID;
87 #endif
88 
89  typedef const void *LPCVOID;
90  typedef unsigned long DWORD;
91  typedef DWORD *PDWORD;
92  typedef long LONG;
93  typedef const char *LPCSTR;
94  typedef const BYTE *LPCBYTE;
95  typedef BYTE *LPBYTE;
96  typedef DWORD *LPDWORD;
97  typedef char *LPSTR;
98 
99  /* these types were deprecated but still used by old drivers and
100  * applications. So just declare and use them. */
101  typedef LPSTR LPTSTR;
102  typedef LPCSTR LPCTSTR;
103 
104  /* types unused by pcsc-lite */
105  typedef short BOOL;
106  typedef unsigned short WORD;
107  typedef ULONG *PULONG;
108 
109 #endif
110 
111 #ifdef __cplusplus
112 }
113 #endif
114 
115 #endif