From ebc5ce782ce46aefcd21209827b065872978b429 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 17 Jun 2008 11:29:34 +0000 Subject: [PATCH] 2008-06-17 13:28 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbmzip/hbmzip.ch * contrib/hbmzip/hbmzip.c + Added error codes to hbmzip.ch + Interface code changed to use manifest constants instead of literals in a few places. [TOMERGE RC1] --- harbour/ChangeLog | 8 ++++++++ harbour/contrib/hbmzip/hbmzip.c | 6 +++--- harbour/contrib/hbmzip/hbmzip.ch | 24 +++++++++++++++++++++--- 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 649f0b9d99..cfe1d623ca 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,14 @@ 2008-12-31 13:59 UTC+0100 Foo Bar */ +2008-06-17 13:28 UTC+0200 Viktor Szakats (harbour.01 syenar hu) + * contrib/hbmzip/hbmzip.ch + * contrib/hbmzip/hbmzip.c + + Added error codes to hbmzip.ch + + Interface code changed to use manifest constants + instead of literals in a few places. + [TOMERGE RC1] + 2008-06-17 09:43 UTC+0200 Viktor Szakats (harbour.01 syenar hu) * contrib/hbmisc/spd.c + SQL_SPRINTF() enhancements from Javier. diff --git a/harbour/contrib/hbmzip/hbmzip.c b/harbour/contrib/hbmzip/hbmzip.c index 03e11c8aa4..e274e0bd32 100644 --- a/harbour/contrib/hbmzip/hbmzip.c +++ b/harbour/contrib/hbmzip/hbmzip.c @@ -647,12 +647,12 @@ static int hb_unzipExtractCurrentFile( unzFile hUnzip, char* szFileName, char* s iResult = unzGetCurrentFileInfo( hUnzip, &ufi, szName, _POSIX_PATH_MAX, NULL, 0, NULL, 0 ); - if( iResult != 0 ) + if( iResult != UNZ_OK ) return iResult; iResult = unzOpenCurrentFilePassword( hUnzip, szPassword ); - if( iResult != 0 ) + if( iResult != UNZ_OK ) return iResult; if( szFileName ) @@ -683,7 +683,7 @@ static int hb_unzipExtractCurrentFile( unzFile hUnzip, char* szFileName, char* s if( ufi.external_fa & 0x40000000 ) /* DIRECTORY */ { hb_fsMkDir( (BYTE*) szName ); - iResult = 0; + iResult = UNZ_OK; } else { diff --git a/harbour/contrib/hbmzip/hbmzip.ch b/harbour/contrib/hbmzip/hbmzip.ch index 97796eccd7..b2ed003892 100644 --- a/harbour/contrib/hbmzip/hbmzip.ch +++ b/harbour/contrib/hbmzip/hbmzip.ch @@ -53,8 +53,26 @@ #ifndef HB_MZIP_CH_ #define HB_MZIP_CH_ -#define HB_ZIP_OPEN_CREATE 0 -#define HB_ZIP_OPEN_CREATEAFTER 1 -#define HB_ZIP_OPEN_ADDINZIP 2 +#define HB_ZIP_OPEN_CREATE 0 +#define HB_ZIP_OPEN_CREATEAFTER 1 +#define HB_ZIP_OPEN_ADDINZIP 2 + +#define Z_ERRNO -1 + +#define UNZ_OK 0 +#define UNZ_END_OF_LIST_OF_FILE -100 +#define UNZ_ERRNO Z_ERRNO +#define UNZ_EOF 0 +#define UNZ_PARAMERROR -102 +#define UNZ_BADZIPFILE -103 +#define UNZ_INTERNALERROR -104 +#define UNZ_CRCERROR -105 + +#define ZIP_OK 0 +#define ZIP_EOF 0 +#define ZIP_ERRNO Z_ERRNO +#define ZIP_PARAMERROR -102 +#define ZIP_BADZIPFILE -103 +#define ZIP_INTERNALERROR -104 #endif