diff options
author | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
---|---|---|
committer | David Walter Seikel | 2013-01-13 18:54:10 +1000 |
commit | 959831f4ef5a3e797f576c3de08cd65032c997ad (patch) | |
tree | e7351908be5995f0b325b2ebeaa02d5a34b82583 /libraries/irrlicht-1.8/source/Irrlicht/lzma/Types.h | |
parent | Add info about changes to Irrlicht. (diff) | |
download | SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.zip SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.gz SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.bz2 SledjHamr-959831f4ef5a3e797f576c3de08cd65032c997ad.tar.xz |
Remove damned ancient DOS line endings from Irrlicht. Hopefully I did not go overboard.
Diffstat (limited to 'libraries/irrlicht-1.8/source/Irrlicht/lzma/Types.h')
-rw-r--r-- | libraries/irrlicht-1.8/source/Irrlicht/lzma/Types.h | 508 |
1 files changed, 254 insertions, 254 deletions
diff --git a/libraries/irrlicht-1.8/source/Irrlicht/lzma/Types.h b/libraries/irrlicht-1.8/source/Irrlicht/lzma/Types.h index f193ce2..7732c24 100644 --- a/libraries/irrlicht-1.8/source/Irrlicht/lzma/Types.h +++ b/libraries/irrlicht-1.8/source/Irrlicht/lzma/Types.h | |||
@@ -1,254 +1,254 @@ | |||
1 | /* Types.h -- Basic types | 1 | /* Types.h -- Basic types |
2 | 2010-10-09 : Igor Pavlov : Public domain */ | 2 | 2010-10-09 : Igor Pavlov : Public domain */ |
3 | 3 | ||
4 | #ifndef __7Z_TYPES_H | 4 | #ifndef __7Z_TYPES_H |
5 | #define __7Z_TYPES_H | 5 | #define __7Z_TYPES_H |
6 | 6 | ||
7 | #include <stddef.h> | 7 | #include <stddef.h> |
8 | 8 | ||
9 | #ifdef _WIN32 | 9 | #ifdef _WIN32 |
10 | #include <windows.h> | 10 | #include <windows.h> |
11 | #endif | 11 | #endif |
12 | 12 | ||
13 | #ifndef EXTERN_C_BEGIN | 13 | #ifndef EXTERN_C_BEGIN |
14 | #ifdef __cplusplus | 14 | #ifdef __cplusplus |
15 | #define EXTERN_C_BEGIN extern "C" { | 15 | #define EXTERN_C_BEGIN extern "C" { |
16 | #define EXTERN_C_END } | 16 | #define EXTERN_C_END } |
17 | #else | 17 | #else |
18 | #define EXTERN_C_BEGIN | 18 | #define EXTERN_C_BEGIN |
19 | #define EXTERN_C_END | 19 | #define EXTERN_C_END |
20 | #endif | 20 | #endif |
21 | #endif | 21 | #endif |
22 | 22 | ||
23 | EXTERN_C_BEGIN | 23 | EXTERN_C_BEGIN |
24 | 24 | ||
25 | #define SZ_OK 0 | 25 | #define SZ_OK 0 |
26 | 26 | ||
27 | #define SZ_ERROR_DATA 1 | 27 | #define SZ_ERROR_DATA 1 |
28 | #define SZ_ERROR_MEM 2 | 28 | #define SZ_ERROR_MEM 2 |
29 | #define SZ_ERROR_CRC 3 | 29 | #define SZ_ERROR_CRC 3 |
30 | #define SZ_ERROR_UNSUPPORTED 4 | 30 | #define SZ_ERROR_UNSUPPORTED 4 |
31 | #define SZ_ERROR_PARAM 5 | 31 | #define SZ_ERROR_PARAM 5 |
32 | #define SZ_ERROR_INPUT_EOF 6 | 32 | #define SZ_ERROR_INPUT_EOF 6 |
33 | #define SZ_ERROR_OUTPUT_EOF 7 | 33 | #define SZ_ERROR_OUTPUT_EOF 7 |
34 | #define SZ_ERROR_READ 8 | 34 | #define SZ_ERROR_READ 8 |
35 | #define SZ_ERROR_WRITE 9 | 35 | #define SZ_ERROR_WRITE 9 |
36 | #define SZ_ERROR_PROGRESS 10 | 36 | #define SZ_ERROR_PROGRESS 10 |
37 | #define SZ_ERROR_FAIL 11 | 37 | #define SZ_ERROR_FAIL 11 |
38 | #define SZ_ERROR_THREAD 12 | 38 | #define SZ_ERROR_THREAD 12 |
39 | 39 | ||
40 | #define SZ_ERROR_ARCHIVE 16 | 40 | #define SZ_ERROR_ARCHIVE 16 |
41 | #define SZ_ERROR_NO_ARCHIVE 17 | 41 | #define SZ_ERROR_NO_ARCHIVE 17 |
42 | 42 | ||
43 | typedef int SRes; | 43 | typedef int SRes; |
44 | 44 | ||
45 | #ifdef _WIN32 | 45 | #ifdef _WIN32 |
46 | typedef DWORD WRes; | 46 | typedef DWORD WRes; |
47 | #else | 47 | #else |
48 | typedef int WRes; | 48 | typedef int WRes; |
49 | #endif | 49 | #endif |
50 | 50 | ||
51 | #ifndef RINOK | 51 | #ifndef RINOK |
52 | #define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } | 52 | #define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } |
53 | #endif | 53 | #endif |
54 | 54 | ||
55 | typedef unsigned char Byte; | 55 | typedef unsigned char Byte; |
56 | typedef short Int16; | 56 | typedef short Int16; |
57 | typedef unsigned short UInt16; | 57 | typedef unsigned short UInt16; |
58 | 58 | ||
59 | #ifdef _LZMA_UINT32_IS_ULONG | 59 | #ifdef _LZMA_UINT32_IS_ULONG |
60 | typedef long Int32; | 60 | typedef long Int32; |
61 | typedef unsigned long UInt32; | 61 | typedef unsigned long UInt32; |
62 | #else | 62 | #else |
63 | typedef int Int32; | 63 | typedef int Int32; |
64 | typedef unsigned int UInt32; | 64 | typedef unsigned int UInt32; |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | #ifdef _SZ_NO_INT_64 | 67 | #ifdef _SZ_NO_INT_64 |
68 | 68 | ||
69 | /* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers. | 69 | /* define _SZ_NO_INT_64, if your compiler doesn't support 64-bit integers. |
70 | NOTES: Some code will work incorrectly in that case! */ | 70 | NOTES: Some code will work incorrectly in that case! */ |
71 | 71 | ||
72 | typedef long Int64; | 72 | typedef long Int64; |
73 | typedef unsigned long UInt64; | 73 | typedef unsigned long UInt64; |
74 | 74 | ||
75 | #else | 75 | #else |
76 | 76 | ||
77 | #if defined(_MSC_VER) || defined(__BORLANDC__) | 77 | #if defined(_MSC_VER) || defined(__BORLANDC__) |
78 | typedef __int64 Int64; | 78 | typedef __int64 Int64; |
79 | typedef unsigned __int64 UInt64; | 79 | typedef unsigned __int64 UInt64; |
80 | #define UINT64_CONST(n) n | 80 | #define UINT64_CONST(n) n |
81 | #else | 81 | #else |
82 | typedef long long int Int64; | 82 | typedef long long int Int64; |
83 | typedef unsigned long long int UInt64; | 83 | typedef unsigned long long int UInt64; |
84 | #define UINT64_CONST(n) n ## ULL | 84 | #define UINT64_CONST(n) n ## ULL |
85 | #endif | 85 | #endif |
86 | 86 | ||
87 | #endif | 87 | #endif |
88 | 88 | ||
89 | #ifdef _LZMA_NO_SYSTEM_SIZE_T | 89 | #ifdef _LZMA_NO_SYSTEM_SIZE_T |
90 | typedef UInt32 SizeT; | 90 | typedef UInt32 SizeT; |
91 | #else | 91 | #else |
92 | typedef size_t SizeT; | 92 | typedef size_t SizeT; |
93 | #endif | 93 | #endif |
94 | 94 | ||
95 | typedef int Bool; | 95 | typedef int Bool; |
96 | #define True 1 | 96 | #define True 1 |
97 | #define False 0 | 97 | #define False 0 |
98 | 98 | ||
99 | 99 | ||
100 | #ifdef _WIN32 | 100 | #ifdef _WIN32 |
101 | #define MY_STD_CALL __stdcall | 101 | #define MY_STD_CALL __stdcall |
102 | #else | 102 | #else |
103 | #define MY_STD_CALL | 103 | #define MY_STD_CALL |
104 | #endif | 104 | #endif |
105 | 105 | ||
106 | #ifdef _MSC_VER | 106 | #ifdef _MSC_VER |
107 | 107 | ||
108 | #if _MSC_VER >= 1300 | 108 | #if _MSC_VER >= 1300 |
109 | #define MY_NO_INLINE __declspec(noinline) | 109 | #define MY_NO_INLINE __declspec(noinline) |
110 | #else | 110 | #else |
111 | #define MY_NO_INLINE | 111 | #define MY_NO_INLINE |
112 | #endif | 112 | #endif |
113 | 113 | ||
114 | #define MY_CDECL __cdecl | 114 | #define MY_CDECL __cdecl |
115 | #define MY_FAST_CALL __fastcall | 115 | #define MY_FAST_CALL __fastcall |
116 | 116 | ||
117 | #else | 117 | #else |
118 | 118 | ||
119 | #define MY_CDECL | 119 | #define MY_CDECL |
120 | #define MY_FAST_CALL | 120 | #define MY_FAST_CALL |
121 | 121 | ||
122 | #endif | 122 | #endif |
123 | 123 | ||
124 | 124 | ||
125 | /* The following interfaces use first parameter as pointer to structure */ | 125 | /* The following interfaces use first parameter as pointer to structure */ |
126 | 126 | ||
127 | typedef struct | 127 | typedef struct |
128 | { | 128 | { |
129 | Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */ | 129 | Byte (*Read)(void *p); /* reads one byte, returns 0 in case of EOF or error */ |
130 | } IByteIn; | 130 | } IByteIn; |
131 | 131 | ||
132 | typedef struct | 132 | typedef struct |
133 | { | 133 | { |
134 | void (*Write)(void *p, Byte b); | 134 | void (*Write)(void *p, Byte b); |
135 | } IByteOut; | 135 | } IByteOut; |
136 | 136 | ||
137 | typedef struct | 137 | typedef struct |
138 | { | 138 | { |
139 | SRes (*Read)(void *p, void *buf, size_t *size); | 139 | SRes (*Read)(void *p, void *buf, size_t *size); |
140 | /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. | 140 | /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. |
141 | (output(*size) < input(*size)) is allowed */ | 141 | (output(*size) < input(*size)) is allowed */ |
142 | } ISeqInStream; | 142 | } ISeqInStream; |
143 | 143 | ||
144 | /* it can return SZ_ERROR_INPUT_EOF */ | 144 | /* it can return SZ_ERROR_INPUT_EOF */ |
145 | SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size); | 145 | SRes SeqInStream_Read(ISeqInStream *stream, void *buf, size_t size); |
146 | SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType); | 146 | SRes SeqInStream_Read2(ISeqInStream *stream, void *buf, size_t size, SRes errorType); |
147 | SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf); | 147 | SRes SeqInStream_ReadByte(ISeqInStream *stream, Byte *buf); |
148 | 148 | ||
149 | typedef struct | 149 | typedef struct |
150 | { | 150 | { |
151 | size_t (*Write)(void *p, const void *buf, size_t size); | 151 | size_t (*Write)(void *p, const void *buf, size_t size); |
152 | /* Returns: result - the number of actually written bytes. | 152 | /* Returns: result - the number of actually written bytes. |
153 | (result < size) means error */ | 153 | (result < size) means error */ |
154 | } ISeqOutStream; | 154 | } ISeqOutStream; |
155 | 155 | ||
156 | typedef enum | 156 | typedef enum |
157 | { | 157 | { |
158 | SZ_SEEK_SET = 0, | 158 | SZ_SEEK_SET = 0, |
159 | SZ_SEEK_CUR = 1, | 159 | SZ_SEEK_CUR = 1, |
160 | SZ_SEEK_END = 2 | 160 | SZ_SEEK_END = 2 |
161 | } ESzSeek; | 161 | } ESzSeek; |
162 | 162 | ||
163 | typedef struct | 163 | typedef struct |
164 | { | 164 | { |
165 | SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */ | 165 | SRes (*Read)(void *p, void *buf, size_t *size); /* same as ISeqInStream::Read */ |
166 | SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); | 166 | SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); |
167 | } ISeekInStream; | 167 | } ISeekInStream; |
168 | 168 | ||
169 | typedef struct | 169 | typedef struct |
170 | { | 170 | { |
171 | SRes (*Look)(void *p, const void **buf, size_t *size); | 171 | SRes (*Look)(void *p, const void **buf, size_t *size); |
172 | /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. | 172 | /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. |
173 | (output(*size) > input(*size)) is not allowed | 173 | (output(*size) > input(*size)) is not allowed |
174 | (output(*size) < input(*size)) is allowed */ | 174 | (output(*size) < input(*size)) is allowed */ |
175 | SRes (*Skip)(void *p, size_t offset); | 175 | SRes (*Skip)(void *p, size_t offset); |
176 | /* offset must be <= output(*size) of Look */ | 176 | /* offset must be <= output(*size) of Look */ |
177 | 177 | ||
178 | SRes (*Read)(void *p, void *buf, size_t *size); | 178 | SRes (*Read)(void *p, void *buf, size_t *size); |
179 | /* reads directly (without buffer). It's same as ISeqInStream::Read */ | 179 | /* reads directly (without buffer). It's same as ISeqInStream::Read */ |
180 | SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); | 180 | SRes (*Seek)(void *p, Int64 *pos, ESzSeek origin); |
181 | } ILookInStream; | 181 | } ILookInStream; |
182 | 182 | ||
183 | SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size); | 183 | SRes LookInStream_LookRead(ILookInStream *stream, void *buf, size_t *size); |
184 | SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset); | 184 | SRes LookInStream_SeekTo(ILookInStream *stream, UInt64 offset); |
185 | 185 | ||
186 | /* reads via ILookInStream::Read */ | 186 | /* reads via ILookInStream::Read */ |
187 | SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType); | 187 | SRes LookInStream_Read2(ILookInStream *stream, void *buf, size_t size, SRes errorType); |
188 | SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size); | 188 | SRes LookInStream_Read(ILookInStream *stream, void *buf, size_t size); |
189 | 189 | ||
190 | #define LookToRead_BUF_SIZE (1 << 14) | 190 | #define LookToRead_BUF_SIZE (1 << 14) |
191 | 191 | ||
192 | typedef struct | 192 | typedef struct |
193 | { | 193 | { |
194 | ILookInStream s; | 194 | ILookInStream s; |
195 | ISeekInStream *realStream; | 195 | ISeekInStream *realStream; |
196 | size_t pos; | 196 | size_t pos; |
197 | size_t size; | 197 | size_t size; |
198 | Byte buf[LookToRead_BUF_SIZE]; | 198 | Byte buf[LookToRead_BUF_SIZE]; |
199 | } CLookToRead; | 199 | } CLookToRead; |
200 | 200 | ||
201 | void LookToRead_CreateVTable(CLookToRead *p, int lookahead); | 201 | void LookToRead_CreateVTable(CLookToRead *p, int lookahead); |
202 | void LookToRead_Init(CLookToRead *p); | 202 | void LookToRead_Init(CLookToRead *p); |
203 | 203 | ||
204 | typedef struct | 204 | typedef struct |
205 | { | 205 | { |
206 | ISeqInStream s; | 206 | ISeqInStream s; |
207 | ILookInStream *realStream; | 207 | ILookInStream *realStream; |
208 | } CSecToLook; | 208 | } CSecToLook; |
209 | 209 | ||
210 | void SecToLook_CreateVTable(CSecToLook *p); | 210 | void SecToLook_CreateVTable(CSecToLook *p); |
211 | 211 | ||
212 | typedef struct | 212 | typedef struct |
213 | { | 213 | { |
214 | ISeqInStream s; | 214 | ISeqInStream s; |
215 | ILookInStream *realStream; | 215 | ILookInStream *realStream; |
216 | } CSecToRead; | 216 | } CSecToRead; |
217 | 217 | ||
218 | void SecToRead_CreateVTable(CSecToRead *p); | 218 | void SecToRead_CreateVTable(CSecToRead *p); |
219 | 219 | ||
220 | typedef struct | 220 | typedef struct |
221 | { | 221 | { |
222 | SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); | 222 | SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); |
223 | /* Returns: result. (result != SZ_OK) means break. | 223 | /* Returns: result. (result != SZ_OK) means break. |
224 | Value (UInt64)(Int64)-1 for size means unknown value. */ | 224 | Value (UInt64)(Int64)-1 for size means unknown value. */ |
225 | } ICompressProgress; | 225 | } ICompressProgress; |
226 | 226 | ||
227 | typedef struct | 227 | typedef struct |
228 | { | 228 | { |
229 | void *(*Alloc)(void *p, size_t size); | 229 | void *(*Alloc)(void *p, size_t size); |
230 | void (*Free)(void *p, void *address); /* address can be 0 */ | 230 | void (*Free)(void *p, void *address); /* address can be 0 */ |
231 | } ISzAlloc; | 231 | } ISzAlloc; |
232 | 232 | ||
233 | #define IAlloc_Alloc(p, size) (p)->Alloc((p), size) | 233 | #define IAlloc_Alloc(p, size) (p)->Alloc((p), size) |
234 | #define IAlloc_Free(p, a) (p)->Free((p), a) | 234 | #define IAlloc_Free(p, a) (p)->Free((p), a) |
235 | 235 | ||
236 | #ifdef _WIN32 | 236 | #ifdef _WIN32 |
237 | 237 | ||
238 | #define CHAR_PATH_SEPARATOR '\\' | 238 | #define CHAR_PATH_SEPARATOR '\\' |
239 | #define WCHAR_PATH_SEPARATOR L'\\' | 239 | #define WCHAR_PATH_SEPARATOR L'\\' |
240 | #define STRING_PATH_SEPARATOR "\\" | 240 | #define STRING_PATH_SEPARATOR "\\" |
241 | #define WSTRING_PATH_SEPARATOR L"\\" | 241 | #define WSTRING_PATH_SEPARATOR L"\\" |
242 | 242 | ||
243 | #else | 243 | #else |
244 | 244 | ||
245 | #define CHAR_PATH_SEPARATOR '/' | 245 | #define CHAR_PATH_SEPARATOR '/' |
246 | #define WCHAR_PATH_SEPARATOR L'/' | 246 | #define WCHAR_PATH_SEPARATOR L'/' |
247 | #define STRING_PATH_SEPARATOR "/" | 247 | #define STRING_PATH_SEPARATOR "/" |
248 | #define WSTRING_PATH_SEPARATOR L"/" | 248 | #define WSTRING_PATH_SEPARATOR L"/" |
249 | 249 | ||
250 | #endif | 250 | #endif |
251 | 251 | ||
252 | EXTERN_C_END | 252 | EXTERN_C_END |
253 | 253 | ||
254 | #endif | 254 | #endif |