svn-gvsig-desktop / tags / v1_2_Build_1208 / libraries / libjni-ecw / include / NCSTypes.h @ 33914
History | View | Annotate | Download (7.16 KB)
1 |
/********************************************************
|
---|---|
2 |
** Copyright 1999 Earth Resource Mapping Ltd.
|
3 |
** This document contains proprietary source code of
|
4 |
** Earth Resource Mapping Ltd, and can only be used under
|
5 |
** one of the three licenses as described in the
|
6 |
** license.txt file supplied with this distribution.
|
7 |
** See separate license.txt file for license details
|
8 |
** and conditions.
|
9 |
**
|
10 |
** This software is covered by US patent #6,442,298,
|
11 |
** #6,102,897 and #6,633,688. Rights to use these patents
|
12 |
** is included in the license agreements.
|
13 |
**
|
14 |
** FILE: NCSTypes.h
|
15 |
** CREATED: Thu Feb 25 09:19:00 WST 1999
|
16 |
** AUTHOR: Simon Cope
|
17 |
** PURPOSE: General NCS typedefs
|
18 |
** EDITS:
|
19 |
** [01] sjc 30Apr00 Merged Mac SDK port
|
20 |
** [02] ny 03Nov00 Mac port changes
|
21 |
** [03] tfl 02Jul04 Moved NCSEcwCellType enum declaration from NCSEcwClient to here
|
22 |
*******************************************************/
|
23 |
|
24 |
#ifndef NCSTYPES_H
|
25 |
#define NCSTYPES_H
|
26 |
|
27 |
#define LINUX
|
28 |
#define POSIX
|
29 |
|
30 |
/* Platform determination stuff.
|
31 |
Should be moved to a better "central" location.
|
32 |
*/
|
33 |
#ifdef macintosh
|
34 |
//#define MACINTOSH
|
35 |
//#include "SimpleWinTypes.h" // include mac types
|
36 |
#ifndef MACINTOSH
|
37 |
# undef WIN32
|
38 |
# define MACINTOSH
|
39 |
# define _MAC
|
40 |
# undef _DEBUG_NEVER
|
41 |
# define uint2 unsigned short |
42 |
# define uint unsigned long |
43 |
#endif
|
44 |
|
45 |
#elif defined __PALMOS_TRAP__
|
46 |
|
47 |
#define PALM
|
48 |
|
49 |
#elif defined sun
|
50 |
|
51 |
#ifndef SOLARIS
|
52 |
#define SOLARIS
|
53 |
#endif // SOLARIS |
54 |
|
55 |
#endif
|
56 |
|
57 |
#ifdef __cplusplus
|
58 |
extern "C" { |
59 |
#endif
|
60 |
|
61 |
#ifndef ERSTYPES_H
|
62 |
|
63 |
/*
|
64 |
** Includes
|
65 |
*/
|
66 |
#ifdef MACINTOSH
|
67 |
#include <Types.h> |
68 |
#elif !defined(_WIN32_WCE) //Pocket PC 2002 |
69 |
#include <sys/types.h> |
70 |
#endif
|
71 |
|
72 |
#if (defined(WIN32) || defined(_WIN32_WCE)) //Pocket PC 2002 |
73 |
#include <windows.h> |
74 |
#include <stdarg.h> |
75 |
#include <windef.h> |
76 |
#include <winbase.h> |
77 |
|
78 |
#if (_WIN32_WCE > 300) //Pocket PC 2002 |
79 |
#include <stddef.h> |
80 |
#endif
|
81 |
|
82 |
#elif defined(MACINTOSH)
|
83 |
#include <MacWindows.h> |
84 |
#include <stdarg.h> |
85 |
#include <stddef.h> |
86 |
#include <MacTypes.h> |
87 |
#include <Math64.h> |
88 |
#include <time.h> |
89 |
#elif defined POSIX
|
90 |
#include <stdarg.h> |
91 |
#endif /* WIN32 */ |
92 |
|
93 |
#ifdef HPUX
|
94 |
//#include <sys/types.h>
|
95 |
#endif
|
96 |
|
97 |
/*
|
98 |
* #defines
|
99 |
*/
|
100 |
#ifdef WIN32
|
101 |
#elif defined MACINTOSH
|
102 |
|
103 |
#ifndef FALSE
|
104 |
#define FALSE 0 |
105 |
#endif
|
106 |
#ifndef TRUE
|
107 |
#define TRUE 1 |
108 |
#endif
|
109 |
|
110 |
#elif defined PALM
|
111 |
#endif
|
112 |
/*
|
113 |
** Typedefs
|
114 |
*/
|
115 |
|
116 |
/*
|
117 |
** General data sizes
|
118 |
*/
|
119 |
#if (defined(WIN32) || defined(_WIN32_WCE)) //pocket pc 2002 |
120 |
typedef signed char INT8; /* 8 bit signed integer */ |
121 |
typedef unsigned char UINT8; /* 8 bit unsigned integer */ |
122 |
typedef signed short INT16; /* 16 bit signed integer */ |
123 |
typedef unsigned short UINT16; /* 16 bit unsigned integer */ |
124 |
#ifndef _BASETSD_H_
|
125 |
typedef signed int INT32; /* 32 bit signed integer */ |
126 |
typedef unsigned int UINT32; /* 32 bit unsigned integer */ |
127 |
typedef LONGLONG INT64; /* 64 bit signed integer */ |
128 |
typedef DWORDLONG UINT64; /* 64 bit unsigned integer */ |
129 |
typedef UINT8 BOOLEAN; /* for use as a True/False or On/Off type */ |
130 |
#endif
|
131 |
|
132 |
#else /* WIN32 */ |
133 |
|
134 |
#ifdef MACINTOSH
|
135 |
|
136 |
#if TARGET_API_MAC_CARBON
|
137 |
#define MAC_PREEMPTIVE
|
138 |
#endif // TARGET_API_MAC_CARBON |
139 |
|
140 |
// Define Data Types for the Macintosh
|
141 |
typedef signed char INT8; /* 8 bit signed integer */ |
142 |
typedef unsigned char UINT8; /* 8 bit unsigned integer */ |
143 |
typedef signed short INT16; /* 16 bit signed integer */ |
144 |
typedef unsigned short UINT16; /* 16 bit unsigned integer */ |
145 |
typedef signed long INT32; /* 32 bit signed integer */ |
146 |
typedef unsigned long UINT32; /* 32 bit unsigned integer */ |
147 |
typedef long long INT64; /* 64 bit signed integer */ |
148 |
typedef unsigned long long UINT64; /* 64 bit unsigned integer */ |
149 |
typedef int BOOLEAN; /* boolean */ |
150 |
|
151 |
typedef void *HANDLE; |
152 |
#define DWORD UINT32
|
153 |
#define BYTE UINT8
|
154 |
|
155 |
#else /* MACINTOSH */ |
156 |
|
157 |
#ifdef POSIX
|
158 |
|
159 |
typedef signed char INT8; /* 8 bit signed integer */ |
160 |
typedef unsigned char UINT8; /* 8 bit unsigned integer */ |
161 |
typedef signed short INT16; /* 16 bit signed integer */ |
162 |
typedef unsigned short UINT16; /* 16 bit unsigned integer */ |
163 |
#ifndef _BASETSD_H_
|
164 |
typedef signed int INT32; /* 32 bit signed integer */ |
165 |
typedef unsigned int UINT32; /* 32 bit unsigned integer */ |
166 |
#endif
|
167 |
|
168 |
#if defined(SOLARIS)
|
169 |
typedef longlong_t INT64; /* 64 bit signed integer */ |
170 |
typedef u_longlong_t UINT64; /* 64 bit unsigned integer */ |
171 |
#elif defined(LINUX)
|
172 |
|
173 |
typedef int64_t INT64;
|
174 |
typedef u_int64_t UINT64;
|
175 |
|
176 |
#elif defined(MACOSX)
|
177 |
|
178 |
typedef unsigned long long UINT64; |
179 |
typedef signed long long INT64; |
180 |
typedef char BOOLEAN; |
181 |
//typedef int boolean;
|
182 |
#define DWORD UINT32
|
183 |
#define BYTE UINT8
|
184 |
#ifndef NULL |
185 |
# define NULL 0 |
186 |
#endif
|
187 |
|
188 |
#elif defined(HPUX)
|
189 |
|
190 |
#if !defined(_BASETSD_H_)
|
191 |
//&& !defined(_DLFCN_H)
|
192 |
typedef int64_t INT64;
|
193 |
//typedef uint64_t UINT64;
|
194 |
#include <dlfcn.h> // include this globally to get the correct definition of UINT64 |
195 |
#endif
|
196 |
|
197 |
#endif
|
198 |
|
199 |
#if !(defined(_BASETSD_H_)||defined(_UTILITY_H)) && !(defined(MACOSX))
|
200 |
typedef int BOOLEAN; /* for use as a True/False or On/Off type */ |
201 |
#endif
|
202 |
|
203 |
#else /* SOLARIS */ |
204 |
#ifdef IRIX
|
205 |
|
206 |
typedef signed char INT8; /* 8 bit signed integer */ |
207 |
typedef unsigned char UINT8; /* 8 bit unsigned integer */ |
208 |
typedef signed short INT16; /* 16 bit signed integer */ |
209 |
typedef unsigned short UINT16; /* 16 bit unsigned integer */ |
210 |
#ifndef _BASETSD_H_
|
211 |
typedef signed int INT32; /* 32 bit signed integer */ |
212 |
typedef unsigned int UINT32; /* 32 bit unsigned integer */ |
213 |
#endif
|
214 |
typedef __int64_t INT64; /* 64 bit signed integer */ |
215 |
typedef __uint64_t UINT64; /* 64 bit unsigned integer */ |
216 |
#ifndef _BASETSD_H_
|
217 |
typedef UINT8 BOOLEAN; /* for use as a True/False or On/Off type */ |
218 |
#endif
|
219 |
|
220 |
|
221 |
#else /* IRIX */ |
222 |
|
223 |
#error unknown machine type will require custom 64 bit variables |
224 |
|
225 |
#endif /* IRIX */ |
226 |
#endif /* SOLARIS */ |
227 |
#endif /* MACINTOSH */ |
228 |
#endif /* WIN32 */ |
229 |
|
230 |
typedef float IEEE4; /* 4 byte IEEE floating point */ |
231 |
typedef double IEEE8; /* 8 byte IEEE floating point */ |
232 |
typedef time_t DATETIME; /* Datestamp */ |
233 |
|
234 |
#endif /* #ifndef ERSTYPES_H */ |
235 |
|
236 |
/*
|
237 |
** NCS Specific typedefs
|
238 |
*/
|
239 |
typedef UINT32 NCSBlockId; /* Unique (per file) Block ID */ |
240 |
typedef UINT64 NCSClientUID; /* Unique client ID (per server) */ |
241 |
typedef UINT64 NCSSequenceNr; /* Packet sequence number */ |
242 |
typedef INT64 NCSTimeStampMs; /* msec timestamp - wraps every 2^64 ms (10^6 years) */ |
243 |
typedef INT64 NCSTimeStampUs; /* usec timestamp - wraps every 2^64 us (10^3 years) */ |
244 |
|
245 |
/*
|
246 |
** NCS Color typedefs : Note that these are compatible with win32 api calls for COLORREF
|
247 |
*/
|
248 |
typedef UINT32 NCSColor;
|
249 |
|
250 |
#define NCSColorRGB(r,g,b) ((NCSColor)(((UINT8)(r)|((UINT16)((UINT8)(g))<<8))|(((UINT32)(UINT8)(b))<<16))) |
251 |
#define NCSColorRGBA(r,g,b,a) ((NCSColor)(((UINT8)(r)|((UINT16)((UINT8)(g))<<8))|(((UINT32)(UINT8)(b))<<16))|(((UINT32)(UINT8)(a))<<24)) |
252 |
#define NCSColorGetRValue(nColor) ((UINT8)(nColor))
|
253 |
#define NCSColorGetGValue(nColor) ((UINT8)(((UINT16)(nColor)) >> 8)) |
254 |
#define NCSColorGetBValue(nColor) ((UINT8)((nColor)>>16)) |
255 |
#define NCSColorGetAValue(nColor) ((UINT8)((nColor)>>24)) |
256 |
|
257 |
/*
|
258 |
** Enum type for different kinds of cell sample [03]
|
259 |
*/
|
260 |
typedef enum { |
261 |
NCSCT_UINT8 = 0,
|
262 |
NCSCT_UINT16 = 1,
|
263 |
NCSCT_UINT32 = 2,
|
264 |
NCSCT_UINT64 = 3,
|
265 |
NCSCT_INT8 = 4,
|
266 |
NCSCT_INT16 = 5,
|
267 |
NCSCT_INT32 = 6,
|
268 |
NCSCT_INT64 = 7,
|
269 |
NCSCT_IEEE4 = 8,
|
270 |
NCSCT_IEEE8 = 9
|
271 |
} NCSEcwCellType; |
272 |
|
273 |
/* * * * * * * * * * * * * * * * * * * */
|
274 |
|
275 |
#ifdef __cplusplus
|
276 |
} |
277 |
#endif
|
278 |
|
279 |
#endif /* #ifndef NCSTYPES_H */ |