Subversion Repositories autosfx

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
1 daniel-mar 1
 
2
/* ZipErr.h
3
* Copyright (C) 1990-1996 Mark Adler, Richard B. Wales, Jean-loup Gailly,
4
* Kai Uwe Rommel, Onno van der Linden and Igor Mandrichenko.
5
* Permission is granted to any individual or institution to use, copy, or
6
* redistribute this software so long as all of the original files are included,
7
* that it is not sold for profit, and that this copyright notice is retained.
8
* This version modified by Chris Vleghert and Eric Engler for BCB/Delphi Zip.
9
 ** distributed under LGPL license ** see license.txt for details
10
 
11
  Copyright (c) 1990-2007 Info-ZIP.  All rights reserved.
12
 
13
  See the accompanying file LICENSE, version 2007-Mar-4 or later
14
  (the contents of which are also included in zip.h) for terms of use.
15
  If, for some reason, all these files are missing, the Info-ZIP license
16
  also may be found at:  ftp://ftp.info-zip.org/pub/infozip/license.html
17
 
18
  parts Copyright (C) 1997 Mike White, Eric W. Engler
19
************************************************************************
20
 Copyright (C) 2009, 2010  by Russell J. Peters, Roger Aelbrecht
21
 
22
   This file is part of TZipMaster Version 1.9.
23
 
24
    TZipMaster is free software: you can redistribute it and/or modify
25
    it under the terms of the GNU Lesser General Public License as published by
26
    the Free Software Foundation, either version 3 of the License, or
27
    (at your option) any later version.
28
 
29
    TZipMaster is distributed in the hope that it will be useful,
30
    but WITHOUT ANY WARRANTY; without even the implied warranty of
31
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
32
    GNU Lesser General Public License for more details.
33
 
34
    You should have received a copy of the GNU Lesser General Public License
35
    along with TZipMaster.  If not, see <http://www.gnu.org/licenses/>.
36
 
37
    contact: problems@delphizip.org (include ZipMaster in the subject).
38
    updates: http://www.delphizip.org
39
    DelphiZip maillist subscribe at http://www.freelists.org/list/delphizip
40
************************************************************************/
41
#ifndef __ZipErr_h
42
#define __ZipErr_h
43
 
44
#define ZEN(n) ((int)(signed char)(n & 0xFF))
45
/*
46
 * ZEN (Zip Error New) is composed as folows:
47
 * a unsigned long (32 bits) Byte4 Byte3 Byte2 Byte1
48
 * Byte 1       Signed; (Old <= dll version 1.502) ZE_ error class (-5 to 18) (-2,17 not used)
49
 *                      Error return values.  The values 0..4 and 12..18 follow the conventions
50
 *                              of PKZIP.   The values 4..10 are all assigned to "insufficient memory"
51
 *                      by PKZIP, so the codes 5, 9 and 10 are used here for other purposes.
52
 *                              also 6, 7, 8 and 17 are not used yet.
53
 *                              Return codes of password fetches (negative = user abort; positive = error)
54
 *                              ZEN_PW_ERROR was 5 but had to make it -5 since ZEN_LOGIC uses 5
55
 *                              ZEN_PW_CANCEL was -1 changed to -3 .. -1 inuse
56
 *                              ZEN_PW_CANCELALL was -2 changed to -4
57
 * Byte 2       Sequence number in the ZEN_ Error class: 1..255
58
 * Byte 3       Error string number in errors[] array
59
 * Byte 4       Not used yet.
60
 */
61
#define ZEN_PW_ERROR      - 5       // = PK_MEM2 : failure (no mem, no tty, ...)
62
#define ZEN_PW_CANCELALL  - 4       // no password, skip any further pwd. request                            
63
#define ZEN_PW_CANCEL     - 3       // No password available (for this entry)                                
64
#define ZEN_PW_ENTERED    0         // got some password string; use/try it
65
/*
66
#define ZEN_MISS          - 1       //
67
#define ZEN_MISS01        0x0001FF  //N Tried to overwrite a dir with a file or vice-versa
68
#define ZEN_MISS02        0x0002FF  // in Win32Zip.c Wild()
69
#define ZEN_MISS03        0x0003FF  // in Win32Zip.c procname()
70
#define ZEN_MISS04        0x0004FF  // in Win32Zip.c procname()
71
#define ZEN_MISS05        0x0005FF  // in Win32Zip.c procname()
72
//*/
73
/*
74
#define ZEN_OK            0         // Success                                              
75
 
76
#define ZEN_EOF           2         // Unexpected end of zip file                                    
77
#define ZEN_EOF01         0x020102  // in DllZip.c zipmain()                        
78
#define ZEN_EOF02         0x020202  // in ZipFile.c AfterError1()                    
79
#define ZEN_EOF03         0x020302  // in ZipFile.c readzipfile()                    
80
#define ZEN_EOF04         0x020402  // in ZipFile.c zipcopy()                        
81
#define ZEN_EOF05         0x020502  // in ZipFile.c zipcopy()                        
82
 
83
#define ZEN_FORM          3         // Zip file structure error                              
84
#define ZEN_FORM01        0x030103  // in ZipFile.c readzipfile()
85
#define ZEN_FORM02        0x030203  // in ZipFile.c readzipfile()
86
#define ZEN_FORM03        0x030303  // in ZipFile.c readzipfile()
87
#define ZEN_FORM04        0x030403  // in ZipFile.c readzipfile()
88
#define ZEN_FORM05        0x030503  // in ZipFile.c readzipfile()
89
#define ZEN_FORM06        0x030603  // in ZipFile.c readzipfile()
90
#define ZEN_FORM07        0x030703  // in ZipFile.c readzipfile()
91
#define ZEN_FORM08        0x030803  // in ZipFile.c readzipfile()
92
#define ZEN_FORM09        0x030903  // in ZipFile.c readzipfile()
93
#define ZEN_FORM10        0x030A03  // in ZipFile.c readzipfile()
94
#define ZEN_FORM11        0x030B03  // in ZipFile.c readzipfile()
95
#define ZEN_FORM12        0x030C03  // in ZipFile.c readzipfile()
96
#define ZEN_FORM13        0x030D03  // in ZipFile.c readzipfile()
97
/ *
98
#define ZEN_MEM           4         // Out of memory                                        
99
#define ZEN_MEM01         0x040104  // in crctab.c make_crc_table()                  
100
#define ZEN_MEM02         0x040204  // in deflate.c lm_init()                        
101
#define ZEN_MEM03         0x040304  // in deflate.c lm_init()                        
102
#define ZEN_MEM04         0x040404  // in DllMain.c ZipDllExec()                    
103
#define ZEN_MEM05         0x040504  // in ZipDll.c GetFilters()                      
104
#define ZEN_MEM06         0x040604  // ZIPDLL was not passed a password              
105
#define ZEN_MEM07         0x040704  // in ZipDll.c zipmain()                        
106
#define ZEN_MEM08         0x040804  //N Zipfile name alloc error                    
107
#define ZEN_MEM09         0x040904  //N Ziptemp path alloc error                    
108
#define ZEN_MEM10         0x040A04  //N Temppath alloc error 2                      
109
#define ZEN_MEM11         0x040B04  // in ZipDll.c zipmain()                        
110
#define ZEN_MEM12         0x040C04  // in ZipDll.c zipmain()                        
111
#define ZEN_MEM13         0x040D04  // in FileIO.c check_dup()                      
112
#define ZEN_MEM14         0x040E04  // in FileIO.c newname()                        
113
#define ZEN_MEM15         0x040F04  // in FileIO.c newname()                        
114
#define ZEN_MEM16         0x041004  // in FileIO.c newname()                        
115
#define ZEN_MEM17         0x041104  // in FileIO.c fcopy()                          
116
#define ZEN_MEM18         0x041204  // in Zipup.c zipup()                            
117
#define ZEN_MEM19         0x041304  // in Win32Zip.c Wild()                          
118
#define ZEN_MEM20         0x041404  // in Win32Zip.c Wild()                          
119
#define ZEN_MEM21         0x041504  // in Win32Zip.c Wild()                          
120
#define ZEN_MEM22         0x041604  // in Win32Zip.c procname()                      
121
#define ZEN_MEM23         0x041704  // in Win32Zip.c procname()                      
122
#define ZEN_MEM24         0x041804  // in ZipFile.c extra data 64
123
 
124
//#define ZEN_MEM24                     0x041804        // in Win32Zip.c set_extra_field()              
125
#define ZEN_MEM25   0x041904        // in ZipFile.c AfterError1()                    
126
#define ZEN_MEM26   0x041A04        // in ZipFile.c readzipfile()                    
127
#define ZEN_MEM27   0x041B04        // in ZipFile.c readzipfile()                    
128
#define ZEN_MEM28   0x041C04        // in ZipFile.c readzipfile()                    
129
#define ZEN_MEM29   0x041D04        // in ZipFile.c readzipfile()                    
130
#define ZEN_MEM30   0x041E04        // in ZipFile.c readzipfile()                    
131
#define ZEN_MEM31   0x041F04        // in ZipFile.c readzipfile()                    
132
#define ZEN_MEM32   0x042004        // in ZipFile.c readzipfile()                    
133
#define ZEN_MEM33   0x042104        // in ZipFile.c trash()                          
134
#define ZEN_MEM34   0x042204        // in Win32Zip.c processname()                  
135
#define ZEN_MEM35   0x042304        // in DllZip.c password command line alloc error
136
#define ZEN_MEM36   0x042404        // in DllMain.c CurrentDir alloc error  
137
#define ZEN_MEM37   0x042504        // in DLLZip.c ZipComment realloc error
138
#define ZEN_MEM38   0x042604        // in FileIO.c      
139
#define ZEN_MEM39   0x042704        // in ZipUp.c zipup() alloc extradata  
140
#define ZEN_MEM40   0x042804        // in ZipUp.c zipup() alloc extrastruct  
141
#define ZEN_MEM41   0x042904        // in ZipUp.c zipup() alloc z->ext  
142
#define ZEN_MEM42   0x042A04        // in ZipUp.c zipup() alloc z->cextra  
143
#define ZEN_MEM43   0x042B04        // in FileIO.c replace
144
#define ZEN_MEM44   0x042C04        // in FileIO.c destroy
145
#define ZEN_MEM45   0x042D04        // in FileIO.c newname()    
146
#define ZEN_MEM46   0x042E04        // in FileIO.c newname()    
147
#define ZEN_MEM47   0x042F04        // in DllZip.c ZipSelect    
148
* /
149
#define ZEN_LOGIC   5               // Internal logic error                  
150
#define ZEN_LOGIC01 0x050105        //      in bits.c copy_block()          
151
#define ZEN_LOGIC02 0x050205        //      in bits.c memcompress()          
152
#define ZEN_LOGIC03 0x050305        // in deflate.c lm_init()                
153
#define ZEN_LOGIC04 0x050405        // in DllZip.c error()                  
154
#define ZEN_LOGIC05 0x050505        // in FileIO.c newname()                
155
#define ZEN_LOGIC06 0x050605        // in Zipup.c zipup()                    
156
#define ZEN_LOGIC07 0x050705        // in Tress.c flush_block()              
157
#define ZEN_LOGIC08 0x050805        // in FileIO.c newname()                
158
#define ZEN_LOGIC09 0x050905        // in ZipUp.c - rewrite local size error
159
#define ZEN_LOGIC10 0x050A05        // in ZipFile.c - rewrite local error
160
/*
161
#define ZEN_SIZE    6
162
#define ZEN_SIZE01  0x060106          // destination too big
163
#define ZEN_SIZE02  0x060206          // source too big
164
#define ZEN_SIZE03  0x060306          // in Zipup.c source file too big
165
#define ZEN_SIZE04  0x060406          // in DllZip.c
166
//#define ZEN_SIZE05  0x060506          // in DllZip.c - too many files
167
//#define ZEN_SIZE06  0x060606          // in DllZip.c - too many files
168
//#define ZEN_SIZE07  0x060706        // in DllZip.c - too big
169
//#define ZEN_SIZE08  0x060806        // in DllZip.c - too big
170
//#define ZEN_SIZE09  0x060906        // in DllZip.c - too big
171
//#define ZEN_SIZE10  0x060A06        // in DllZip.c - too big
172
*
173
#define ZEN_ABORT   0x090109        // user interrupt or termination
174
#define ZEN_ABORT01 0x070209        // in ZGlobals.c              
175
#define ZEN_ABORT02 0x080309        // in ZGlobals.c              
176
#define ZEN_ABORT03 0x090309        // in FileIO.c        
177
#define ZEN_ABORT04 0x090409        // in ZipUp.c
178
#define ZEN_ABORT05 0x090509        // in ZipUp.c
179
#define ZEN_ABORT06 0x090609        // in ZipFile.c readzipfile
180
* /
181
#define ZEN_TEMP    10              // Error using a temp file    
182
#define ZEN_TEMP01  0x0A010A        // in DllZip.c zipmain()      
183
#define ZEN_TEMP02  0x0A020A        // in DllZip.c zipmain()      
184
#define ZEN_TEMP03  0x0A030A        // in FileIO.c replace()      
185
#define ZEN_TEMP04  0x0A040A        // in FileIO.c fcopy()        
186
#define ZEN_TEMP05  0x0A050A        // in Zipup.c zipup()        
187
#define ZEN_TEMP06  0x0A060A        // in Zipup.c zipup()        
188
#define ZEN_TEMP07  0x0A070A        // in ZipFile.c putlocal()    
189
#define ZEN_TEMP08  0x0A080A        // in ZipFile.c putcentral()  
190
#define ZEN_TEMP09  0x0A090A        // in ZipFile.c putend()      
191
#define ZEN_TEMP10  0x0A0A0A        // in ZipFile.c zipcopy()    
192
#define ZEN_TEMP11  0x0A0B0A        // in FileIO.c replace()
193
#define ZEN_TEMP12  0x0A0C0A        // in FileIO.c replace()
194
* /
195
#define ZEN_READ    11              // Read or seek error        
196
#define ZEN_READ01  0x0B010B        // in DllZip.c zipmain()      
197
#define ZEN_READ02  0x0B020B        // in FileIO.c fcopy()        
198
#define ZEN_READ03  0x0B030B        // in Zipup.c zipup()        
199
#define ZEN_READ04  0x0B040B        // in ZipFile.c AfterError1()
200
#define ZEN_READ05  0x0B050B        // in ZipFile.c readzipfile()
201
#define ZEN_READ06  0x0B060B        // in ZipFile.c zipcopy()  
202
#define ZEN_READ07  0x0B070B        // in ZipFile.c zipcopy()  
203
#define ZEN_READ08  0x0B080B        // in FileIO.c filecopy  
204
#define ZEN_READ09  0x0B090B        // in FileIO.c filecopy
205
#define ZEN_READ10  0x0B0A0B        // in ZipUp.c calc crc
206
#define ZEN_READ11  0x0B0B0B        // ZipUp.c changed when crypt
207
#define ZEN_READ12  0x0B0C0B        // ZipUp.c read error
208
* /
209
#define ZEN_NONE    12              // Nothing to do              
210
#define ZEN_NONE01  0x0C010C        // in DllZip.c zipmain()      
211
#define ZEN_NONE02  0x0C020C        // in DllZip.c zipmain()
212
#define ZEN_NONE03  0x0C030C        // in DllZip.c zipmain()
213
* /
214
#define ZEN_NAME    13              // Missing or empty zip file  
215
#define ZEN_NAME01  0x0D010D        // in DllZip.c zipmain()      
216
#define ZEN_NAME02  0x0D020D        //N Zip filename open error  
217
#define ZEN_NAME03  0x0D030D        // in DllZip.c zipmain()
218
//#define ZEN_NAME04  0x0D040D        // in newname - invalid name
219
//#define ZEN_NAME05  0x0D050D        // in Wild - invalid path name
220
//#define ZEN_NAME06  0x0D060D        // in newname - invalid Ansi name
221
* /
222
#define ZEN_WRITE   14              // Error writing to a file    
223
#define ZEN_WRITE01 0x0E010E        // Write error in flush_outbuf
224
#define ZEN_WRITE02 0x0E020E        //      in bits.c copy_block()
225
#define ZEN_WRITE03 0x0E030E        // in DllZip.c zipmain()      
226
#define ZEN_WRITE04 0x0E040E        // in FileIO.c replace()      
227
#define ZEN_WRITE05 0x0E050E        // in Zipup.c zipup()          
228
#define ZEN_WRITE06 0x0E060E        // in Zipup.c zipup()          
229
#define ZEN_WRITE07 0x0E070E        // in FileIO.c replace()      
230
#define ZEN_WRITE08 0x0E080E        // in Zipup.c zipup()      
231
#define ZEN_WRITE09 0x0E090E        // in DllZip.c - truncate failed
232
#define ZEN_WRITE10 0x0E0A0E        // in DllZip.c - truncate failed
233
* /
234
#define ZEN_CREAT   15              // Couldn't open to write      
235
#define ZEN_CREAT01 0x0F010F        // in FileIO.c replace()      
236
#define ZEN_CREAT02 0x0F020F        // in FileIO.c replace()      
237
#define ZEN_CREAT03 0x0F030F        // in FileIO.c replace()      
238
* /
239
#define ZEN_PARMS   16              // Bad command line            
240
#define ZEN_PARMS01 0x100110        // no zip filename received, was -1  
241
#define ZEN_PARMS02 0x100210        // struct size mismatch, was -2      
242
#define ZEN_PARMS03 0x100310        //N Error with Temporary path        
243
#define ZEN_PARMS04 0x100410        //N Error with Delete (2 actions specified  
244
#define ZEN_PARMS05 0x100510        //N Crypt specified while not allowed      
245
#define ZEN_PARMS06 0x100610        //N Error with Freshen (2 actions specified
246
#define ZEN_PARMS07 0x100710        //N Error time option                      
247
#define ZEN_PARMS08 0x100810        //N Error with Update (2 actions specified  
248
#define ZEN_PARMS09 0x100910        //N no such option: %02X hex                
249
#define ZEN_PARMS10 0x100A10        // in ZipDll.c zipmain()                    
250
#define ZEN_PARMS11 0x100B10        //N Error in date parameter                
251
#define ZEN_PARMS12 0x100C10        //N Delete specified with recurse or dispose
252
#define ZEN_PARMS13 0x100D10        //N name in zip file repeated                
253
#define ZEN_PARMS14 0x100E10        // in Zipup.c zipup()                        
254
#define ZEN_PARMS15 0x100F10        // in Win32Zip.c Wild()                      
255
#define ZEN_PARMS16 0x101010        // in Win32Zip.c Wild()                      
256
/*
257
#define ZEN_OPEN    18              // Could not open a specified file to read  
258
#define ZEN_OPEN01  0x120112        // in ZipDll.c zipmain()                    
259
#define ZEN_OPEN02  0x120212        // in ZipUp.c zipup()                        
260
#define ZEN_OPEN03  0x120312        // in ZipUp.c zipup()                        
261
#define ZEN_OPEN04  0x120412        // in DllZip.c zipup() Sharing                
262
#define ZEN_OPEN05  0x120512        // in DllZip.c zipup() Access
263
* /
264
#define ZEN_INVAL   19              // Invalid filename
265
#define ZEN_INVAL01  0x130113        // in Wild - invalid path name
266
#define ZEN_INVAL02  0x130213        // in newname - invalid name (ZEN_NAME04)  
267
#define ZEN_INVAL03  0x130313        // in newname - invalid Ansi name
268
*/
269
#define ERRORLENGTH 40              // Max length of any error message string below, used in ziperr() 
270
 
271
#endif
272
 
273
#ifdef GLOBALSxx
274
#ifndef _ERROR_GLOBALS_
275
#define _ERROR_GLOBALS_
276
 
277
/* Error messages for the ziperr() function in the zip programs */
278
const TCHAR *errors[] =
279
  {
280
    /*  0 */
281
    _T("File not found"),
282
    /*  1 */
283
    _T("password failed"),
284
    /*  2 */
285
    _T("Unexpected end of zip file"),
286
    /*  3 */
287
    _T("Zip file structure invalid"),
288
    /*  4 */
289
    _T("Out of memory"),
290
    /*  5 */
291
    _T("Internal logic error"),
292
    /*  6 */
293
    _T("File > 4Gb"),
294
    /*  7 */
295
    _T("Aborted; Global pointer missing"),
296
    /*  8 */
297
    _T("Aborted; Global pointer not set"),
298
    /*  9 */
299
    _T("Aborted by user"),
300
    /* 10 */
301
    _T("Temporary file failure"),
302
    /* 11 */
303
    _T("Error reading a file"),
304
    /* 12 */
305
    _T("Nothing to do!"),
306
    /* 13 */
307
    _T("Missing or empty zip file"),
308
    /* 14 */
309
    _T("Error writing to a file"),
310
    /* 15 */
311
    _T("Error creating file"),
312
    /* 16 */
313
    _T("Bad zip options specified"),
314
    /* 17 */
315
    _T("password canceled"),
316
    /* 18 */
317
    _T("File not found or no read permission"),
318
    /* 19 */
319
    _T("Invalid charcters in filename")
320
  };
321
#else
322
//extern const char *errors[];
323
#endif
324
#endif
325
//#endif
326
 
327
 
328
 
329