1/* 2 ziperr.h - Zip 3 3 4 Copyright (c) 1990-2007 Info-ZIP. All rights reserved. 5 6 See the accompanying file LICENSE, version 2007-Mar-4 or later 7 (the contents of which are also included in zip.h) for terms of use. 8 If, for some reason, all these files are missing, the Info-ZIP license 9 also may be found at: ftp://ftp.info-zip.org/pub/infozip/license.html 10*/ 11/* 12 * ziperr.h by Mark Adler 13 */ 14 15 16/* 17 * VMS message file ident string. (The "-xxx" suffix should be 18 * incremented when messages are changed for a particular program 19 * version.) Used only when generating the VMS message source file, but 20 * that can be done on a non-VMS system. 21 */ 22#define VMS_MSG_IDENT "V3.0-000" 23 24/* VMS-compatible "severity" values (bits 2:0): */ 25#define ZE_S_WARNING 0x00 26#define ZE_S_SUCCESS 0x01 27#define ZE_S_ERROR 0x02 28#define ZE_S_INFO 0x03 29#define ZE_S_SEVERE 0x04 30#define ZE_S_UNUSED 0x07 31 32/* Flags: */ 33#define ZE_S_PERR 0x10 34 35 36 /* Error return values. The values 0..4 and 12..18 follow the conventions 37 of PKZIP. The values 4..10 are all assigned to "insufficient memory" 38 by PKZIP, so the codes 5..10 are used here for other purposes. */ 39#define ZE_MISS -1 /* used by procname(), zipbare() */ 40#define ZE_OK 0 /* success */ 41#define ZE_EOF 2 /* unexpected end of zip file */ 42#define ZE_FORM 3 /* zip file structure error */ 43#define ZE_MEM 4 /* out of memory */ 44#define ZE_LOGIC 5 /* internal logic error */ 45#define ZE_BIG 6 /* entry too large to split, read, or write */ 46#define ZE_NOTE 7 /* invalid comment format */ 47#define ZE_TEST 8 /* zip test (-T) failed or out of memory */ 48#define ZE_ABORT 9 /* user interrupt or termination */ 49#define ZE_TEMP 10 /* error using a temp file */ 50#define ZE_READ 11 /* read or seek error */ 51#define ZE_NONE 12 /* nothing to do */ 52#define ZE_NAME 13 /* missing or empty zip file */ 53#define ZE_WRITE 14 /* error writing to a file */ 54#define ZE_CREAT 15 /* couldn't open to write */ 55#define ZE_PARMS 16 /* bad command line */ 56#define ZE_OPEN 18 /* could not open a specified file to read */ 57#define ZE_COMPERR 19 /* error in compilation options */ 58#define ZE_ZIP64 20 /* Zip64 not supported */ 59 60#define ZE_MAXERR 20 /* the highest error number */ 61 62 63/* Error messages for the ziperr() function in the zip programs. */ 64 65#ifdef GLOBALS 66struct 67{ 68 char *name; 69 char *string; 70 int severity; 71} ziperrors[ZE_MAXERR + 1] = { 72/* 0 */ { "OK", "Normal successful completion", ZE_S_SUCCESS }, 73/* 1 */ { "", "", ZE_S_UNUSED }, 74/* 2 */ { "EOF", "Unexpected end of zip file", ZE_S_SEVERE }, 75/* 3 */ { "FORM", "Zip file structure invalid", ZE_S_ERROR }, 76/* 4 */ { "MEM", "Out of memory", ZE_S_SEVERE }, 77/* 5 */ { "LOGIC", "Internal logic error", ZE_S_SEVERE }, 78/* 6 */ { "BIG", "Entry too big to split, read, or write", 79 ZE_S_ERROR }, 80/* 7 */ { "NOTE", "Invalid comment format", ZE_S_ERROR }, 81/* 8 */ { "TEST", "Zip file invalid, could not spawn unzip, or wrong unzip", 82 ZE_S_SEVERE }, 83/* 9 */ { "ABORT", "Interrupted", ZE_S_ERROR }, 84/* 10 */ { "TEMP", "Temporary file failure", ZE_S_SEVERE | ZE_S_PERR }, 85/* 11 */ { "READ", "Input file read failure", ZE_S_SEVERE | ZE_S_PERR }, 86/* 12 */ { "NONE", "Nothing to do!", ZE_S_WARNING }, 87/* 13 */ { "NAME", "Missing or empty zip file", ZE_S_ERROR }, 88/* 14 */ { "WRITE", "Output file write failure", ZE_S_SEVERE | ZE_S_PERR }, 89/* 15 */ { "CREAT", "Could not create output file", ZE_S_SEVERE | ZE_S_PERR }, 90/* 16 */ { "PARMS", "Invalid command arguments", ZE_S_ERROR }, 91/* 17 */ { "", "", ZE_S_UNUSED }, 92/* 18 */ { "OPEN", "File not found or no read permission", 93 ZE_S_ERROR | ZE_S_PERR }, 94/* 19 */ { "COMPERR", "Not supported", ZE_S_SEVERE }, 95/* 20 */ { "ZIP64", "Attempt to read unsupported Zip64 archive", 96 ZE_S_SEVERE } 97# ifdef AZTEC_C 98 , /* extremely lame compiler bug workaround */ 99# endif 100}; 101#else /* !GLOBALS */ 102/* Error messages for ziperr() */ 103extern struct 104{ 105 char *name; 106 char *string; 107 int severity; 108} ziperrors[ZE_MAXERR + 1]; 109#endif /* ?GLOBALS */ 110 111/* Macro to determine whether to call perror() or not. */ 112#define PERR(e) (ziperrors[e].severity & ZE_S_PERR) 113 114/* Macro for easy access to the message string. */ 115#define ZIPERRORS(e) ziperrors[e].string 116