Aes.h | Aes.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
BaseLibCompressor.h | BaseLibCompressor.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
BitFlag.h | BitFlag.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
/** | /** | |||
* \file BitFlag.h | * \file BitFlag.h | |||
* Includes the ZipArchiveLib::CBitFlag class. | * Includes the ZipArchiveLib::CBitFlag class. | |||
//* | ||||
*/ | */ | |||
#if !defined(ZIPARCHIVE_BITFLAG_DOT_H) | #if !defined(ZIPARCHIVE_BITFLAG_DOT_H) | |||
#define ZIPARCHIVE_BITFLAG_DOT_H | #define ZIPARCHIVE_BITFLAG_DOT_H | |||
#if _MSC_VER > 1000 | #if _MSC_VER > 1000 | |||
#pragma once | #pragma once | |||
#endif | #endif | |||
namespace ZipArchiveLib | namespace ZipArchiveLib | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 1 lines changed or added | |||
BytesWriter.h | BytesWriter.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Bzip2Compressor.h | Bzip2Compressor.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
DeflateCompressor.h | DeflateCompressor.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
DirEnumerator.h | DirEnumerator.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
FileFilter.h | FileFilter.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
FileInfo.h | FileInfo.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Hmac.h | Hmac.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
RandomPool.h | RandomPool.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Sha1.h | Sha1.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
Wildcard.h | Wildcard.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipAbstractFile.h | ZipAbstractFile.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 34 | skipping to change at line 34 | |||
#if _MSC_VER > 1000 | #if _MSC_VER > 1000 | |||
#pragma once | #pragma once | |||
#endif | #endif | |||
#include "ZipExport.h" | #include "ZipExport.h" | |||
#include "ZipString.h" | #include "ZipString.h" | |||
class ZIP_API CZipAbstractFile | class ZIP_API CZipAbstractFile | |||
{ | { | |||
public: | public: | |||
enum { begin = SEEK_SET, // 0 | enum | |||
current = SEEK_CUR, // 1 | { begin = SEEK_SET, // 0 | |||
end = SEEK_END // 2 | current = SEEK_CUR, // 1 | |||
end = SEEK_END // 2 | ||||
}; | }; | |||
CZipAbstractFile(){} | CZipAbstractFile(){} | |||
virtual bool Open(LPCTSTR , UINT , bool ){return false;} | virtual bool Open(LPCTSTR , UINT , bool ){return false;} | |||
virtual void Close() = 0; | virtual void Close() = 0; | |||
virtual void Flush() = 0; | virtual void Flush() = 0; | |||
virtual ZIP_FILE_USIZE GetPosition() const = 0; | virtual ZIP_FILE_USIZE GetPosition() const = 0; | |||
virtual ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE lOff, int nFrom) = 0; | virtual ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE lOff, int nFrom) = 0; | |||
ZIP_FILE_USIZE SafeSeek(ZIP_FILE_USIZE lOff, bool fromBeginning = tr ue) | ZIP_FILE_USIZE SafeSeek(ZIP_FILE_USIZE lOff, bool fromBeginning = tr ue) | |||
{ | { | |||
ZIP_FILE_SIZE offset; | ZIP_FILE_SIZE offset; | |||
skipping to change at line 65 | skipping to change at line 66 | |||
if (fromBeginning) | if (fromBeginning) | |||
return Seek(offset, CZipAbstractFile::begin); | return Seek(offset, CZipAbstractFile::begin); | |||
else | else | |||
return Seek(-offset, CZipAbstractFile::end); | return Seek(-offset, CZipAbstractFile::end); | |||
} | } | |||
virtual ZIP_FILE_USIZE GetLength() const = 0; | virtual ZIP_FILE_USIZE GetLength() const = 0; | |||
virtual void SetLength(ZIP_FILE_USIZE nNewLen) = 0; | virtual void SetLength(ZIP_FILE_USIZE nNewLen) = 0; | |||
virtual ZIP_FILE_USIZE SeekToBegin(){return Seek(0, begin);} | virtual ZIP_FILE_USIZE SeekToBegin(){return Seek(0, begin);} | |||
virtual ZIP_FILE_USIZE SeekToEnd(){return Seek(0, end);} | virtual ZIP_FILE_USIZE SeekToEnd(){return Seek(0, end);} | |||
virtual CZipString GetFilePath() const = 0; | virtual CZipString GetFilePath() const = 0; | |||
virtual bool HasFilePath() const = 0; | ||||
virtual UINT Read(void *lpBuf, UINT nCount) = 0; | virtual UINT Read(void *lpBuf, UINT nCount) = 0; | |||
virtual void Write(const void* lpBuf, UINT nCount) = 0; | virtual void Write(const void* lpBuf, UINT nCount) = 0; | |||
virtual bool IsClosed() const = 0; | virtual bool IsClosed() const = 0; | |||
virtual ~CZipAbstractFile(){}; | virtual ~CZipAbstractFile(){}; | |||
}; | }; | |||
#endif // !defined(ZIPARCHIVE_ZIPABSTRACTFILE_DOT_H) | #endif // !defined(ZIPARCHIVE_ZIPABSTRACTFILE_DOT_H) | |||
End of changes. 3 change blocks. | ||||
4 lines changed or deleted | 6 lines changed or added | |||
ZipAesCryptograph.h | ZipAesCryptograph.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipArchive.h | ZipArchive.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 91 | skipping to change at line 91 | |||
\param lpszFilePath | \param lpszFilePath | |||
Sets #m_szFilePath. | Sets #m_szFilePath. | |||
\param lpszFileNameInZip | \param lpszFileNameInZip | |||
Sets #m_szFileNameInZip. | Sets #m_szFileNameInZip. | |||
*/ | */ | |||
CZipAddNewFileInfo(LPCTSTR lpszFilePath, LPCTSTR lpszFileNameInZip) | CZipAddNewFileInfo(LPCTSTR lpszFilePath, LPCTSTR lpszFileNameInZip) | |||
{ | { | |||
Defaults(); | Defaults(); | |||
m_szFilePath = lpszFilePath; | m_szFilePath = lpszFilePath; | |||
m_szFileNameInZip = lpszFileNameInZip; | m_szFileNameInZip = lpszFileNameInZip; | |||
} | } | |||
/** | /** | |||
Initializes a new instance of the CZipAddNewFileInfo class. | Initializes a new instance of the CZipAddNewFileInfo class. | |||
\param pFile | \param pFile | |||
Sets #m_pFile. | Sets #m_pFile. | |||
\param lpszFileNameInZip | \param lpszFileNameInZip | |||
Sets #m_szFileNameInZip. | Sets #m_szFileNameInZip. | |||
skipping to change at line 667 | skipping to change at line 667 | |||
zipModeSplit = 0x0100, // For the internal use on ly. | zipModeSplit = 0x0100, // For the internal use on ly. | |||
zipModeBinSplit = 0x0200, // For the internal use on ly. | zipModeBinSplit = 0x0200, // For the internal use on ly. | |||
zipModeSpan = 0x0400, // For the interna l use only. | zipModeSpan = 0x0400, // For the interna l use only. | |||
zipModeSegmented = zipModeSplit | zipModeBinSplit | z ipModeSpan, // For the internal use only. | zipModeSegmented = zipModeSplit | zipModeBinSplit | z ipModeSpan, // For the internal use only. | |||
zipCreateSplit = zipCreate | zipModeSplit, ///< Cre ates a split archive. | zipCreateSplit = zipCreate | zipModeSplit, ///< Cre ates a split archive. | |||
zipCreateBinSplit = zipCreate | zipModeBinSplit, ///< Creates a binary split archive. | zipCreateBinSplit = zipCreate | zipModeBinSplit, ///< Creates a binary split archive. | |||
zipCreateSpan = zipCreate | zipModeSpan, ///< Crea tes a span archive. | zipCreateSpan = zipCreate | zipModeSpan, ///< Crea tes a span archive. | |||
zipOpenSplit = zipOpen | zipModeSplit, ///< Opens | zipOpenSplit = zipOpenReadOnly | zipModeSplit, // | |||
an existing split archive. Use when opening split archives on removable de | /< Opens an existing split archive. Use when opening split archives on remo | |||
vices or under Linux/Mac OS X. | vable devices or under Linux/Mac OS X. | |||
zipOpenBinSplit = zipOpen | zipModeBinSplit ///< Opens an ex | zipOpenBinSplit = zipOpenReadOnly | zipModeBinSplit ///< Ope | |||
isting binary split archive. | ns an existing binary split archive. | |||
}; | }; | |||
/** | /** | |||
Opens or creates a zip archive. | Opens or creates a zip archive. | |||
\param szPathName | \param szPathName | |||
The path to the archive. | The path to the archive. | |||
\param iMode | \param iMode | |||
skipping to change at line 732 | skipping to change at line 732 | |||
\see | \see | |||
<a href="kb">0610231924</a> | <a href="kb">0610231924</a> | |||
\see | \see | |||
Open(LPCTSTR, int, ZIP_SIZE_TYPE); | Open(LPCTSTR, int, ZIP_SIZE_TYPE); | |||
*/ | */ | |||
bool Open(CZipAbstractFile& af, int iMode = zipOpen, bool bAutoClose = false); | bool Open(CZipAbstractFile& af, int iMode = zipOpen, bool bAutoClose = false); | |||
/** | /** | |||
Opens the archive from the already opened archive. Both arch ives will share the same central directory. | Opens the archive from the already opened archive. Both arch ives will share the same central directory. | |||
The \a zip archive must be opened in read-only mode and the | The \a zip archive must be opened in read-only mode (unless | |||
newly opened archive will open as read-only as well. | \a allowNonReadOnly is set to \c true) | |||
and the newly opened archive will open as read-only as well. | ||||
\param zip | \param zip | |||
The archive that provides the reference to the centr | The archive that provides the reference to the centr | |||
al directory. It must be a read-only archive and if it is in memory, | al directory. It must be a read-only archive. | |||
\a pArchiveFile needs to be used. When \a pArchiveFi | If the archive has no physical representation, the s | |||
le is used, the \a zip archive cannot be segmented. | torage file of that archive | |||
has to return \c false from the <code>CZipAbstractFi | ||||
le::HasFilePath()</code> method. | ||||
Alternatively, \a pArchiveFile can be used. When \a | ||||
pArchiveFile is used, the \a zip archive cannot be segmented. | ||||
\param pArchiveFile | \param pArchiveFile | |||
When used, the current CZipArchive instance will use this file as the storage. This file must be opened in advance and the | When used, the current CZipArchive instance will use this file as the storage. This file must be opened in advance and the | |||
library will not attempt to close it at any time. | library will not attempt to close it at any time. | |||
\param bAllowNonReadOnly | ||||
When set to \c true, the method will allow opening f | ||||
rom a non-read only archive. However it is up to the user to ensure | ||||
that the modifications to the \a zip archive won't c | ||||
orrupt the state of the CZipArchive object opened from it. Such a situation | ||||
can happen when the \a zip archive is being modified | ||||
and the current archive is reading at the same time. | ||||
\return | \return | |||
\c true, if the new archive was successfully opened; \c false otherwise. | \c true, if the new archive was successfully opened; \c false otherwise. | |||
\note | \note | |||
If you use this method in a multithreaded environmen t, | If you use this method in a multithreaded environmen t, | |||
make sure that \c _ZIP_USE_LOCKING is defined in the \e _features.h file. Also make sure, that \a zip stays open until | make sure that \c _ZIP_USE_LOCKING is defined in the \e _features.h file. Also make sure, that \a zip stays open until | |||
this method returns. | this method returns. | |||
\see | \see | |||
<a href="kb">0610241003|thread</a> | <a href="kb">0610241003|thread</a> | |||
\see | \see | |||
zipOpenReadOnly | zipOpenReadOnly | |||
*/ | */ | |||
bool OpenFrom(CZipArchive& zip, CZipAbstractFile* pArchiveFile = NUL L); | bool OpenFrom(CZipArchive& zip, CZipAbstractFile* pArchiveFile = NUL L, bool bAllowNonReadOnly = false); | |||
/** | /** | |||
Sets the path fragment to be removed from the beginning of t he full path when adding or extracting a file. | Sets the path fragment to be removed from the beginning of t he full path when adding or extracting a file. | |||
Use it, if you don't want to use the full path (by setting t he \a bFullPath parameter in #AddNewFile or #ExtractFile to \c true) | Use it, if you don't want to use the full path (by setting t he \a bFullPath parameter in #AddNewFile or #ExtractFile to \c true) | |||
and you don't want to remove the whole path either (be setti ng the same parameter to \c false), but you want to remove only a specific beginning. | and you don't want to remove the whole path either (be setti ng the same parameter to \c false), but you want to remove only a specific beginning. | |||
Use it after opening the archive and before calling the #Add NewFile or #ExtractFile methods. | Use it after opening the archive and before calling the #Add NewFile or #ExtractFile methods. | |||
\param szPath | \param szPath | |||
The string that you want to be removed from the begi nning of the path of the file | The string that you want to be removed from the begi nning of the path of the file | |||
skipping to change at line 1032 | skipping to change at line 1040 | |||
bool bSkipInitialPath = true , | bool bSkipInitialPath = true , | |||
int iSmartLevel = zipsmSafeS mart, | int iSmartLevel = zipsmSafeS mart, | |||
unsigned long nBufSize = 655 36) | unsigned long nBufSize = 655 36) | |||
{ | { | |||
ZipArchiveLib::CNameFileFilter filter(lpszFileMask); | ZipArchiveLib::CNameFileFilter filter(lpszFileMask); | |||
return AddNewFiles(lpszPath, filter, bRecursive, iComprLevel , | return AddNewFiles(lpszPath, filter, bRecursive, iComprLevel , | |||
bSkipInitialPath, iSmartLevel, nBufSize); | bSkipInitialPath, iSmartLevel, nBufSize); | |||
} | } | |||
/** | /** | |||
Returns the index of the recently added file (if any). | ||||
\return | ||||
The index of the recently added file or \c ZIP_FILE_ | ||||
INDEX_UNSPECIFIED if the index is unknown. | ||||
*/ | ||||
ZIP_INDEX_TYPE GetLastIndexAdded() const | ||||
{ | ||||
return m_centralDir.GetLastIndexAdded(); | ||||
} | ||||
/** | ||||
Adds a new file to the opened archive. The archive cannot be | Adds a new file to the opened archive. The archive cannot be | |||
an existing (at the moment of opening the archive) segmented archive, | an existing (at the moment of opening the archive) segmented archive, | |||
because modifying such an archive is not possible with this version. | because modifying such an archive is not possible with this version. | |||
\param header | \param header | |||
The structure that provides additional information a bout the added file and serves as a template for | The structure that provides additional information a bout the added file and serves as a template for | |||
the properties of the new file. The following values can be set: | the properties of the new file. The following values can be set: | |||
\li Use CZipFileHeader::SetFileName to set the filen ame (it may include a path). It will be stored inside the archive | \li Use CZipFileHeader::SetFileName to set the filen ame (it may include a path). It will be stored inside the archive | |||
to represent this file. | to represent this file. | |||
\li Use CZipFileHeader::SetTime to set the modificat ion time. | \li Use CZipFileHeader::SetTime to set the modificat ion time. | |||
If \a lpszFilePath is not \c NULL it is over written and updated automatically. | If \a lpszFilePath is not \c NULL it is over written and updated automatically. | |||
skipping to change at line 1139 | skipping to change at line 1158 | |||
WriteNewFile | WriteNewFile | |||
*/ | */ | |||
bool CloseNewFile(bool bAfterException = false); | bool CloseNewFile(bool bAfterException = false); | |||
/** | /** | |||
Acquires a file with the given index from another archive. | Acquires a file with the given index from another archive. | |||
The compressed data of the file from another archive is copi ed to the current archive | The compressed data of the file from another archive is copi ed to the current archive | |||
without decompression. | without decompression. | |||
\param zip | \param zip | |||
The opened archive to get the file from (must not be a segmented archive). | The opened archive to get the file from. | |||
\param uIndex | \param uIndex | |||
A zero-based index of the file to get from the \a zi p archive. | A zero-based index of the file to get from the \a zi p archive. | |||
\param lpszNewFileName | \param lpszNewFileName | |||
The new filename to replace the old one from the \a zip archive. It can be \c NULL to leave the filename the same. | The new filename to replace the old one from the \a zip archive. It can be \c NULL to leave the filename the same. | |||
\param uReplaceIndex | \param uReplaceIndex | |||
The same as CZipAddNewFileInfo::m_uReplaceIndex. It can be \c ZIP_FILE_INDEX_UNSPECIFIED. | The same as CZipAddNewFileInfo::m_uReplaceIndex. It can be \c ZIP_FILE_INDEX_UNSPECIFIED. | |||
skipping to change at line 1211 | skipping to change at line 1230 | |||
return bRet; | return bRet; | |||
} | } | |||
/** | /** | |||
Acquires files with the given indexes from another archive. | Acquires files with the given indexes from another archive. | |||
The compressed data of the file from another archive is copi ed to the current archive | The compressed data of the file from another archive is copi ed to the current archive | |||
without decompression. | without decompression. | |||
\param zip | \param zip | |||
The opened archive to get the file from (must not be a segmented archive). | The opened archive to get the file from. | |||
\param aIndexes | \param aIndexes | |||
An array of zero-based indexes of the files to acqui re from the \a zip archive. | An array of zero-based indexes of the files to acqui re from the \a zip archive. | |||
\param bKeepSystComp | \param bKeepSystComp | |||
If \c false, then the system compatibility of the fi le from the \a zip archive | If \c false, then the system compatibility of the fi le from the \a zip archive | |||
is converted to the current archive system compatibi lity, if they differ. Otherwise | is converted to the current archive system compatibi lity, if they differ. Otherwise | |||
the source system compatibility is copied. | the source system compatibility is copied. | |||
\return | \return | |||
skipping to change at line 1259 | skipping to change at line 1278 | |||
SetPassword | SetPassword | |||
*/ | */ | |||
bool GetFromArchive(CZipArchive& zip, CZipIndexesArray &aIndexes, bo ol bKeepSystComp = false); | bool GetFromArchive(CZipArchive& zip, CZipIndexesArray &aIndexes, bo ol bKeepSystComp = false); | |||
/** | /** | |||
Acquires files with the given names from another archive. | Acquires files with the given names from another archive. | |||
The compressed data of the file from another archive is copi ed to the current archive | The compressed data of the file from another archive is copi ed to the current archive | |||
without decompression. | without decompression. | |||
\param zip | \param zip | |||
The opened archive to get the file from (must not be a segmented archive). | The opened archive to get the file from. | |||
\param aNames | \param aNames | |||
An array of filenames to acquire from the \a zip arc hive. | An array of filenames to acquire from the \a zip arc hive. | |||
\param bKeepSystComp | \param bKeepSystComp | |||
If \c false, then the system compatibility of the fi le from the \a zip archive | If \c false, then the system compatibility of the fi le from the \a zip archive | |||
is converted to the current archive system compatibi lity, if they differ. Otherwise | is converted to the current archive system compatibi lity, if they differ. Otherwise | |||
the source system compatibility is copied. | the source system compatibility is copied. | |||
\return | \return | |||
skipping to change at line 1360 | skipping to change at line 1379 | |||
In this case, if #m_szRootPath is set (with #SetRoot Path), then before adding the source path | In this case, if #m_szRootPath is set (with #SetRoot Path), then before adding the source path | |||
to \a lpszPath, from the source path is removed the part that matches #m_szRootPath | to \a lpszPath, from the source path is removed the part that matches #m_szRootPath | |||
(matching is performed starting from the beginning o f both strings). | (matching is performed starting from the beginning o f both strings). | |||
\param lpszNewName | \param lpszNewName | |||
The new name of the file after extraction. | The new name of the file after extraction. | |||
If \c NULL, the original filename stored in the arch ive is used. | If \c NULL, the original filename stored in the arch ive is used. | |||
May include a path information, but if \a bFullPath is \c false, | May include a path information, but if \a bFullPath is \c false, | |||
only the filename is extracted from this value. | only the filename is extracted from this value. | |||
\param iOverwriteMode | ||||
The mode used when overwriting a file during extract | ||||
ion. Can be one or more of <span class="linkapi">ZipPlatform::DeleteMode</s | ||||
pan> values. | ||||
\param pSeekPair | \param pSeekPair | |||
If not NULL, the file will be extracted starting fro m the seek position described by this value. | If not NULL, the file will be extracted starting fro m the seek position described by this value. | |||
\param nBufSize | \param nBufSize | |||
The size of the buffer used while file operations. | The size of the buffer used while file operations. | |||
\return | \return | |||
\c true if successful; \c false otherwise. | \c true if successful; \c false otherwise. | |||
\note | \note | |||
To extract files which filenames that match a specif ied pattern, use the #FindMatches method. | To extract files which filenames that match a specif ied pattern, use the #FindMatches method. | |||
\see | \see | |||
<a href="kb">0610241003</a> | <a href="kb">0610241003</a> | |||
\see | \see | |||
<a href="kb">0610231200</a> | <a href="kb">0610231200</a> | |||
\see | \see | |||
<a href="kb">0711101739</a> | <a href="kb">0711101739</a> | |||
\see | \see | |||
ExtractFile(ZIP_INDEX_TYPE, CZipAbstractFile&, bool, CZipCompressor::COffsetsPair*, DWORD) | ExtractFile(ZIP_INDEX_TYPE, CZipAbstractFile&, bool, ZipPlatform::DeleteFileMode, CZipCompressor::COffsetsPair*, DWORD) | |||
\see | \see | |||
FindMatches | FindMatches | |||
\see | \see | |||
SetCallback | SetCallback | |||
*/ | */ | |||
bool ExtractFile(ZIP_INDEX_TYPE uIndex, | bool ExtractFile(ZIP_INDEX_TYPE uIndex, | |||
LPCTSTR lpszPath, | LPCTSTR lpszPath, | |||
bool bFullPath = true, | bool bFullPath = true, | |||
LPCTSTR lpszNewName = NULL, | LPCTSTR lpszNewName = NULL, | |||
ZipPlatform::DeleteFileMode iOverwriteMode = ZipPlatform::df mRegular, | ||||
DWORD nBufSize = 65536); | DWORD nBufSize = 65536); | |||
/** | /** | |||
The same as #ExtractFile(ZIP_INDEX_TYPE, LPCTSTR, bool, LPCT STR, CZipCompressor::COffsetsPair*, DWORD ) | The same as #ExtractFile(ZIP_INDEX_TYPE, CZipAbstractFile&, bool, ZipPlatform::DeleteFileMode, CZipCompressor::COffsetsPair*, DWORD) | |||
but instead to a physical file, this method extracts data in to a \c CZipMemFile object. | but instead to a physical file, this method extracts data in to a \c CZipMemFile object. | |||
\param uIndex | \param uIndex | |||
The index of the file to extract. | The index of the file to extract. | |||
\param af | \param af | |||
An abstract file to receive the decompressed data. | An abstract file to receive the decompressed data. | |||
\param bRewind | \param bRewind | |||
If \c true, the memory file pointer is positioned at the beginning of the compressed data after compression. | If \c true, the memory file pointer is positioned at the beginning of the compressed data after compression. | |||
skipping to change at line 1421 | skipping to change at line 1444 | |||
- Writing of the decompressed data starts at the current pos ition of the memory file. | - Writing of the decompressed data starts at the current pos ition of the memory file. | |||
Keep this in mind, when you pass a \c CZipMemFile object tha t already contains data | Keep this in mind, when you pass a \c CZipMemFile object tha t already contains data | |||
(or has a buffer attached) - its contents may be overwritten . | (or has a buffer attached) - its contents may be overwritten . | |||
- If you try to extract a directory, the method will return \c false. | - If you try to extract a directory, the method will return \c false. | |||
\see | \see | |||
<a href="kb">0610231924</a> | <a href="kb">0610231924</a> | |||
\see | \see | |||
<a href="kb">0711101739</a> | <a href="kb">0711101739</a> | |||
\see | \see | |||
ExtractFile(ZIP_INDEX_TYPE, LPCTSTR, bool, LPCTSTR, CZipCompressor::COffsetsPair*, DWORD ) | ExtractFile(ZIP_INDEX_TYPE, CZipAbstractFile&, bool, ZipPlatform::DeleteFileMode, CZipCompressor::COffsetsPair*, DWORD) | |||
*/ | */ | |||
bool ExtractFile(ZIP_INDEX_TYPE uIndex, | bool ExtractFile(ZIP_INDEX_TYPE uIndex, | |||
CZipAbstractFile& af, | CZipAbstractFile& af, | |||
bool bRewind = true, | bool bRewind = true, | |||
DWORD nBufSize = 65536); | DWORD nBufSize = 65536); | |||
/** | /** | |||
Opens the file with the given index in the archive for extra cting. | Opens the file with the given index in the archive for extra cting. | |||
Not successful opening of the file doesn't lock the whole ar chive, so | Not successful opening of the file doesn't lock the whole ar chive, so | |||
you can try to open another one (after catching an exception , if it was | you can try to open another one (after catching an exception , if it was | |||
skipping to change at line 2596 | skipping to change at line 2619 | |||
\return | \return | |||
The zero-based index of the file in the archive whic h filename would be duplicated, | The zero-based index of the file in the archive whic h filename would be duplicated, | |||
or \c ZIP_FILE_INDEX_NOT_FOUND, if the filename woul d be unique. | or \c ZIP_FILE_INDEX_NOT_FOUND, if the filename woul d be unique. | |||
*/ | */ | |||
ZIP_INDEX_TYPE WillBeDuplicated(LPCTSTR lpszFilePath, bool bFullPath , bool bFileNameOnly = false, int iWhat = prAuto); | ZIP_INDEX_TYPE WillBeDuplicated(LPCTSTR lpszFilePath, bool bFullPath , bool bFileNameOnly = false, int iWhat = prAuto); | |||
/** | /** | |||
Predicts the full resulting filename with path after extraction. | Predicts the full resulting filename with path after extraction. | |||
The parameters (except for the first) are in the form you would p ass | The parameters (except for the first) are in the form you would p ass | |||
to the #ExtractFile(ZIP_INDEX_TYPE , LPCTSTR , bool , LPCTSTR , C ZipCompressor::COffsetsPair*, DWORD ) method. | to the #ExtractFile(ZIP_INDEX_TYPE, CZipAbstractFile&, bool, ZipP latform::DeleteFileMode, CZipCompressor::COffsetsPair*, DWORD) | |||
The method takes into account the root path set with the #SetRoot Path method. | The method takes into account the root path set with the #SetRoot Path method. | |||
\param lpszFileNameInZip | \param lpszFileNameInZip | |||
The filename of the file inside the archive (may be \c NULL if \a lpszNewName is not \c NULL). | The filename of the file inside the archive (may be \c NULL if \a lpszNewName is not \c NULL). | |||
\param lpszPath | \param lpszPath | |||
\param bFullPath | \param bFullPath | |||
\param lpszNewName | \param lpszNewName | |||
skipping to change at line 2775 | skipping to change at line 2798 | |||
checkNone, ///< If used in the #SetIgnoredConsistencyChecks method, examines all p ossible inconsistencies in an archive. | checkNone, ///< If used in the #SetIgnoredConsistencyChecks method, examines all p ossible inconsistencies in an archive. | |||
checkCRC = 0x0001, ///< Verifies CRC after decompression. Use it when working with Java <sup><smal l>TM</small></sup> Archives (jar). The CRC check is performed using CRC wri tten in a central header when closing a file after extraction. | checkCRC = 0x0001, ///< Verifies CRC after decompression. Use it when working with Java <sup><smal l>TM</small></sup> Archives (jar). The CRC check is performed using CRC wri tten in a central header when closing a file after extraction. | |||
checkLocalMethod = 0x0002, ///< Verifie s that the compression method written in a local header matches the compres sion method written in a central header. | checkLocalMethod = 0x0002, ///< Verifie s that the compression method written in a local header matches the compres sion method written in a central header. | |||
checkLocalSizes = 0x0004, ///< Verifie s that sizes of compressed and uncompressed data written in a local header match their counterparts in a central header. The compressed size in the lo cal header is always ignored, if it is \c 0. | checkLocalSizes = 0x0004, ///< Verifie s that sizes of compressed and uncompressed data written in a local header match their counterparts in a central header. The compressed size in the lo cal header is always ignored, if it is \c 0. | |||
checkLocalCRC = 0x0008, ///< Verifie s that the CRC written in a local header matches the CRC written in a centr al header. | checkLocalCRC = 0x0008, ///< Verifie s that the CRC written in a local header matches the CRC written in a centr al header. | |||
checkLocalFlag = 0x0010, ///< Verifie s that the general purpose flag value written in a local header matches its counterpart written in a central header. | checkLocalFlag = 0x0010, ///< Verifie s that the general purpose flag value written in a local header matches its counterpart written in a central header. | |||
checkLocalAll = checkLocalMethod | checkLo calSizes | checkLocalCRC | checkLocalFlag, ///< Examines all possible incon sistencies between central and local headers. These verifications are perfo rmed when opening a file for extraction. | checkLocalAll = checkLocalMethod | checkLo calSizes | checkLocalCRC | checkLocalFlag, ///< Examines all possible incon sistencies between central and local headers. These verifications are perfo rmed when opening a file for extraction. | |||
checkDataDescriptor = 0x0100, ///< Verifies that values written in extra data descriptor match values written in central he ader. This verification is performed when closing a file after extraction, but only if a file has a data descriptor (see CZipFileHeader::IsDataDescrip tor()). Ignored by default (it is consistent with behavior of popular archi vers). | checkDataDescriptor = 0x0100, ///< Verifies that values written in extra data descriptor match values written in central he ader. This verification is performed when closing a file after extraction, but only if a file has a data descriptor (see CZipFileHeader::IsDataDescrip tor()). Ignored by default (it is consistent with behavior of popular archi vers). | |||
checkVolumeEntries = 0x0200, ///< Verifies that the number of volumes and entries are correctly reported. | checkVolumeEntries = 0x0200, ///< Verifies that the number of volumes and entries are correctly reported. | |||
checkAll = checkCRC | checkLo calAll | checkDataDescriptor | checkVolumeEntries, ///< Logical sum of all possible verifications. | checkAll = checkCRC | checkLo calAll | checkDataDescriptor | checkVolumeEntries, ///< Logical sum of all possible verifications. | |||
checkIgnoredByDefault = checkDataDescriptor | checkVolumeE | checkIgnoredByDefault = checkDataDescriptor | checkVolumeE | |||
ntries ///< Verifies that are ignored by default by the ZipArchive Library | ntries ///< Checks that are ignored by default by the ZipArchive Library | |||
}; | ||||
/** | ||||
Flags for workarounding various problems in archives. | ||||
\see | ||||
SetSpecialFlags | ||||
*/ | ||||
enum SpecialFlags | ||||
{ | ||||
sfNone, | ||||
/** | ||||
Forces reading all headers from the central director | ||||
y, even if the number of files reported by the archive is different. | ||||
By default, the ZipArchive Library reads only the nu | ||||
mber of headers declared by the archive. Call this method before opening an | ||||
archive. | ||||
This method is useful when dealing with archives cre | ||||
ated with | ||||
external software that puts more files inside an arc | ||||
hive that it is permitted by the zip format. Such a situation | ||||
can take place with archives created with e.g. BOMAr | ||||
chiveHelper (Mac OS X utility), when the number of files exceeds 65,535. | ||||
*/ | ||||
sfExhaustiveRead, | ||||
}; | }; | |||
/** | /** | |||
Sets the consistency checks to ignore while processing the a rchive. Allows opening archives which are not entirely | Sets the consistency checks to ignore while processing the a rchive. Allows opening archives which are not entirely | |||
consistent, but nevertheless the compressed data is correct. The level is reset to #checkIgnoredByDefault when | consistent, but nevertheless the compressed data is correct. The level is reset to #checkIgnoredByDefault when | |||
opening or creating an archive. | opening or creating an archive. | |||
\param iLevel | \param iLevel | |||
The consistency check. It can be one or more of the #ConsistencyCheck values. | The consistency check. It can be one or more of the #ConsistencyCheck values. | |||
\see | \see | |||
skipping to change at line 2812 | skipping to change at line 2855 | |||
\see | \see | |||
SetIgnoredConsistencyChecks | SetIgnoredConsistencyChecks | |||
*/ | */ | |||
int GetIgnoredConsistencyChecks() const | int GetIgnoredConsistencyChecks() const | |||
{ | { | |||
return m_centralDir.m_iIgnoredChecks; | return m_centralDir.m_iIgnoredChecks; | |||
} | } | |||
/** | /** | |||
Forces reading all headers from the central directory, even | Sets special flags. It can be one or more of the #SpecialFla | |||
if the number of files reported by the archive is different. | gs values. | |||
By default, the ZipArchive Library reads only the number of | ||||
headers declared by the archive. Call this method before opening an archive | ||||
. | ||||
\param bExhaustiveRead | ||||
If \c true, exhaustive read will be performed; \c fa | ||||
lse otherwise. | ||||
\note This method is useful when dealing with archives creat | ||||
ed with | ||||
external software that put more files inside an archive that | ||||
it is permitted by the zip format. Such a situation | ||||
can take place with archives created with e.g. BOMArchiveHel | ||||
per (Mac OS X utility), when the number of files exceeds 65,535. | ||||
\see | \see | |||
GetExhaustiveRead | GetSpecialFlags | |||
*/ | */ | |||
void SetExhaustiveRead(bool bExhaustiveRead) | void SetSpecialFlags(int iSpecialFlags) | |||
{ | { | |||
if (!IsClosed()) | if (!IsClosed()) | |||
{ | { | |||
ZIPTRACE("%s(%i) : Set it before opening the archive .\n"); | ZIPTRACE("%s(%i) : Set it before opening the archive .\n"); | |||
return; | return; | |||
} | } | |||
m_bExhaustiveRead = bExhaustiveRead; | m_centralDir.m_specialFlags = iSpecialFlags; | |||
} | } | |||
/** | /** | |||
Returns the value indicating whether the exhaustive read fun | Returns the currently set special flags. It can be one or mo | |||
ction is active. | re of the #SpecialFlags values. | |||
\return | ||||
\c true, if the exhaustive read function is active; | ||||
\c false otherwise. | ||||
\see | \see | |||
SetExhaustiveRead | SetSpecialFlags | |||
*/ | */ | |||
bool GetExhaustiveRead() const | int GetSpecialFlags() const | |||
{ | { | |||
return m_bExhaustiveRead; | return m_centralDir.m_specialFlags; | |||
} | } | |||
/** | /** | |||
Finds indexes of the files, which filenames match the specif ied pattern. The indexes are stored in the \a ar array. | Finds indexes of the files, which filenames match the specif ied pattern. The indexes are stored in the \a ar array. | |||
The indexes can be used then e.g. in deleting or extracting files. | The indexes can be used then e.g. in deleting or extracting files. | |||
\param lpszPattern | \param lpszPattern | |||
The pattern to match. The case-sensitivity of the pa ttern | The pattern to match. The case-sensitivity of the pa ttern | |||
is set to the global archive case-sensitivity (set w ith the #SetCaseSensitivity method). | is set to the global archive case-sensitivity (set w ith the #SetCaseSensitivity method). | |||
skipping to change at line 3136 | skipping to change at line 3168 | |||
\return | \return | |||
\c false, if the files could not be encrypted; \c tr ue otherwise. | \c false, if the files could not be encrypted; \c tr ue otherwise. | |||
\see | \see | |||
EncryptFiles | EncryptFiles | |||
*/ | */ | |||
bool EncryptFilesInternal(CZipIndexesArray* pIndexes); | bool EncryptFilesInternal(CZipIndexesArray* pIndexes); | |||
/** | /** | |||
The value set with #SetExhaustiveRead. | ||||
*/ | ||||
bool m_bExhaustiveRead; | ||||
/** | ||||
See the description of #OpenNewFile(CZipFileHeader&, int, LP CTSTR) | See the description of #OpenNewFile(CZipFileHeader&, int, LP CTSTR) | |||
\param header | \param header | |||
\param iLevel | \param iLevel | |||
\param lpszFilePath | \param lpszFilePath | |||
\param uReplaceIndex | \param uReplaceIndex | |||
For the internal use only. | For the internal use only. | |||
\see | \see | |||
OpenNewFile(CZipFileHeader&, int, LPCTSTR) | OpenNewFile(CZipFileHeader&, int, LPCTSTR) | |||
*/ | */ | |||
End of changes. 27 change blocks. | ||||
57 lines changed or deleted | 91 lines changed or added | |||
ZipAutoBuffer.h | ZipAutoBuffer.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipBaseException.h | ZipBaseException.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipCallback.h | ZipCallback.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 93 | skipping to change at line 93 | |||
Override this method in a derived class. If you defi ne this method inside the class declaration, consider inlining | Override this method in a derived class. If you defi ne this method inside the class declaration, consider inlining | |||
it to make an action progress faster. | it to make an action progress faster. | |||
\see | \see | |||
CZipSegmCallback | CZipSegmCallback | |||
*/ | */ | |||
virtual bool Callback(ZIP_SIZE_TYPE uProgress) = 0; | virtual bool Callback(ZIP_SIZE_TYPE uProgress) = 0; | |||
/** | /** | |||
The filename of an external file, if an action (adding, extr acting or segmentation) uses such a file. | The filename of an external file, if an action (adding, extr acting or segmentation) uses such a file. | |||
You can set its value, to change the currently used path. | ||||
*/ | */ | |||
CZipString m_szExternalFile; | CZipString m_szExternalFile; | |||
virtual ~CZipCallback(){} | virtual ~CZipCallback(){} | |||
}; | }; | |||
/** | /** | |||
When you derive from CZipSegmCallback, you can use the derived class as a callback object for: | When you derive from CZipSegmCallback, you can use the derived class as a callback object for: | |||
- the disk change notification in a spanned archive, | - the disk change notification in a spanned archive, | |||
- notification about the next part being processed in a spli t archive. | - notification about the next part being processed in a spli t archive. | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 2 lines changed or added | |||
ZipCallbackProvider.h | ZipCallbackProvider.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipCentralDir.h | ZipCentralDir.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 143 | skipping to change at line 143 | |||
m_pszComment.Release(); | m_pszComment.Release(); | |||
// initialize ( necessary when using 64 bits - we ar e copying only 4 bytes in Read()) | // initialize ( necessary when using 64 bits - we ar e copying only 4 bytes in Read()) | |||
m_bInArchive = false; | m_bInArchive = false; | |||
m_uEndOffset = 0; | m_uEndOffset = 0; | |||
m_uLastVolume = 0; | m_uLastVolume = 0; | |||
m_uVolumeWithCD = 0; | m_uVolumeWithCD = 0; | |||
m_uVolumeEntriesNo = 0; | m_uVolumeEntriesNo = 0; | |||
m_uEntriesNumber = 0; | m_uEntriesNumber = 0; | |||
m_uSize = 0; | m_uSize = 0; | |||
m_uOffset = 0; | m_uOffset = 0; | |||
m_iLastIndexAdded = ZIP_FILE_INDEX_UNSPECIFIED; | ||||
} | } | |||
bool CheckIfOK_1() | bool CheckIfOK_1() | |||
{ | { | |||
return (m_uEndOffset >= m_uOffset + m_uSize); | return (m_uEndOffset >= m_uOffset + m_uSize); | |||
} | } | |||
ZIP_SIZE_TYPE CalculateBytesBeforeZip() | ZIP_SIZE_TYPE CalculateBytesBeforeZip() | |||
{ | { | |||
return m_uEndOffset - m_uSize - m_uOffset; | return m_uEndOffset - m_uSize - m_uOffset; | |||
} | } | |||
bool CheckIfOK_2() | bool CheckIfOK_2() | |||
skipping to change at line 183 | skipping to change at line 184 | |||
/** | /** | |||
The case-sensitivity of CZipCentralDir::m_pFindArray sorting. | The case-sensitivity of CZipCentralDir::m_pFindArray sorting. | |||
*/ | */ | |||
bool m_bCaseSensitive; | bool m_bCaseSensitive; | |||
/** | /** | |||
The value set with the CZipCentralDir::EnableFindFas t method. | The value set with the CZipCentralDir::EnableFindFas t method. | |||
*/ | */ | |||
bool m_bFindFastEnabled; | bool m_bFindFastEnabled; | |||
/** | ||||
The index of the recently added file. | ||||
*/ | ||||
ZIP_INDEX_TYPE m_iLastIndexAdded; | ||||
private: | private: | |||
/** | /** | |||
The method used in string comparisons. It is set dep ending on the current case-sensitivity. | The method used in string comparisons. It is set dep ending on the current case-sensitivity. | |||
*/ | */ | |||
ZIPSTRINGCOMPARE m_pCompare; | ZIPSTRINGCOMPARE m_pCompare; | |||
int m_iReference; | int m_iReference; | |||
#ifdef _ZIP_USE_LOCKING | #ifdef _ZIP_USE_LOCKING | |||
ZipArchiveLib::CZipMutex m_mutex; | ZipArchiveLib::CZipMutex m_mutex; | |||
#endif | #endif | |||
}; | }; | |||
skipping to change at line 221 | skipping to change at line 227 | |||
Initializes the object. | Initializes the object. | |||
\param pSource | \param pSource | |||
If not \c NULL, it specifies the central directory f or sharing. | If not \c NULL, it specifies the central directory f or sharing. | |||
*/ | */ | |||
void Init(CZipCentralDir* pSource = NULL); | void Init(CZipCentralDir* pSource = NULL); | |||
/** | /** | |||
Reads the central directory from the archive. | Reads the central directory from the archive. | |||
\param bExhaustiveRead | ||||
\c true, if the exhaustive read should be performed, | ||||
\c false otherwise. | ||||
\see | ||||
CZipArchive::SetExhaustiveRead | ||||
*/ | */ | |||
void Read(bool bExhaustiveRead); | void Read(); | |||
/** | /** | |||
Opens the file with the given index. | Opens the file with the given index. | |||
\param uIndex | \param uIndex | |||
A zero-based index of the file to open. | A zero-based index of the file to open. | |||
*/ | */ | |||
void OpenFile(ZIP_INDEX_TYPE uIndex); | void OpenFile(ZIP_INDEX_TYPE uIndex); | |||
skipping to change at line 311 | skipping to change at line 311 | |||
\param bRichHeaderTemplateCopy | \param bRichHeaderTemplateCopy | |||
\c true, if copy crc and sizes values from \a header ; \c false otherwise. | \c true, if copy crc and sizes values from \a header ; \c false otherwise. | |||
\return | \return | |||
The new header. | The new header. | |||
*/ | */ | |||
CZipFileHeader* AddNewFile(const CZipFileHeader & header, ZIP_INDEX_ TYPE uReplaceIndex, int iLevel, bool bRichHeaderTemplateCopy = false); | CZipFileHeader* AddNewFile(const CZipFileHeader & header, ZIP_INDEX_ TYPE uReplaceIndex, int iLevel, bool bRichHeaderTemplateCopy = false); | |||
/** | /** | |||
Returns the index of the recently added file (if any). | ||||
\return | ||||
The index of the recently added file or \c ZIP_FILE_ | ||||
INDEX_UNSPECIFIED if the index is unknown. | ||||
*/ | ||||
ZIP_INDEX_TYPE GetLastIndexAdded() const | ||||
{ | ||||
return m_pInfo ? m_pInfo->m_iLastIndexAdded : ZIP_FILE_INDEX | ||||
_UNSPECIFIED; | ||||
} | ||||
/** | ||||
Removes physically the central directory from the archive. | Removes physically the central directory from the archive. | |||
*/ | */ | |||
void RemoveFromDisk(); | void RemoveFromDisk(); | |||
/** | /** | |||
Returns the central directory size. | Returns the central directory size. | |||
\param bWhole | \param bWhole | |||
If \c true, include the size of the file headers. | If \c true, include the size of the file headers. | |||
If \c false, the size of the file headers is not inc luded. | If \c false, the size of the file headers is not inc luded. | |||
skipping to change at line 480 | skipping to change at line 491 | |||
/** | /** | |||
Consistency checks to ignore. It can be one or more of the C ZipArchive::ConsistencyCheck values. | Consistency checks to ignore. It can be one or more of the C ZipArchive::ConsistencyCheck values. | |||
\see | \see | |||
CZipArchive::SetIgnoredConsistencyChecks | CZipArchive::SetIgnoredConsistencyChecks | |||
*/ | */ | |||
int m_iIgnoredChecks; | int m_iIgnoredChecks; | |||
/** | /** | |||
The currently set special flags. | ||||
\see | ||||
CZipArchive::SetSpecialFlags | ||||
*/ | ||||
ZipArchiveLib::CBitFlag m_specialFlags; | ||||
/** | ||||
Returns the value indicating whether the specified consisten cy check should be performed. | Returns the value indicating whether the specified consisten cy check should be performed. | |||
\param iLevel | \param iLevel | |||
The level to check. It can be one or more of the CZi pArchive::ConsistencyCheck values. | The level to check. It can be one or more of the CZi pArchive::ConsistencyCheck values. | |||
\return | \return | |||
\c true, if the specified check should be performed; \c false otherwise. | \c true, if the specified check should be performed; \c false otherwise. | |||
\see | \see | |||
m_iIgnoredChecks | m_iIgnoredChecks | |||
skipping to change at line 727 | skipping to change at line 746 | |||
/** | /** | |||
The central directory information. | The central directory information. | |||
\see | \see | |||
CInfo | CInfo | |||
*/ | */ | |||
CInfo* m_pInfo; | CInfo* m_pInfo; | |||
/** | /** | |||
Reads file headers from the archive. | Reads file headers from the archive. | |||
\param bExhaustiveRead | ||||
\c true, if the exhaustive read should be performed, | ||||
\c false otherwise. | ||||
\see | ||||
CZipArchive::SetExhaustiveRead | ||||
*/ | */ | |||
void ReadHeaders(bool bExhaustiveRead); | void ReadHeaders(); | |||
/** | /** | |||
Frees the memory allocated for the CZipFileHeader structures . | Frees the memory allocated for the CZipFileHeader structures . | |||
*/ | */ | |||
void RemoveHeaders(); | void RemoveHeaders(); | |||
/** | /** | |||
Removes data descriptors from a segmented archive that turne d out to be single-segment only. | Removes data descriptors from a segmented archive that turne d out to be single-segment only. | |||
It is not called for encrypted files. | It is not called for encrypted files. | |||
End of changes. 9 change blocks. | ||||
17 lines changed or deleted | 30 lines changed or added | |||
ZipCollections.h | ZipCollections.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipCollections_mfc.h | ZipCollections_mfc.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipCollections_stl.h | ZipCollections_stl.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipCompatibility.h | ZipCompatibility.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 51 | skipping to change at line 51 | |||
\see | \see | |||
CZipArchive::GetSystemCompatibility | CZipArchive::GetSystemCompatibility | |||
\see | \see | |||
CZipFileHeader::GetSystemCompatibility | CZipFileHeader::GetSystemCompatibility | |||
\see | \see | |||
ZipPlatform::GetSystemID | ZipPlatform::GetSystemID | |||
*/ | */ | |||
enum ZipPlatforms | enum ZipPlatforms | |||
{ | { | |||
zcDosFat, ///< MS-DOS and OS/2 (FAT / | zcDosFat, ///< MS-DOS and OS/2 (FAT / VFAT / FAT32 fil | |||
VFAT / FAT32 file systems) | e systems) | |||
zcAmiga, ///< Amiga | zcAmiga, ///< Amiga | |||
zcVaxVms, ///< VAX/VMS | zcVaxVms, ///< VAX/VMS | |||
zcUnix, ///< Unix / Linux | zcUnix, ///< Unix / Linux | |||
zcVmCms, ///< VM/CMS | zcVmCms, ///< VM/CMS | |||
zcAtari, ///< Atari ST | zcAtari, ///< Atari ST | |||
zcOs2Hpfs, ///< OS/2 H.P.F.S. | zcOs2Hpfs, ///< OS/2 H.P.F.S. | |||
zcMacintosh, ///< Macintosh | zcMacintosh, ///< Macintosh | |||
zcZsystem, ///< Z-System | zcZsystem, ///< Z-System | |||
zcCpm, ///< CP/M | zcCpm, ///< CP/M | |||
zcTops20, ///< TOPS-20 | zcTops20, ///< TOPS-20 | |||
zcNtfs, ///< Windows NTFS | zcNtfs, ///< Windows NTFS | |||
zcQDos, ///< SMS/QDOS | zcQDos, ///< SMS/QDOS | |||
zcAcorn, ///< Acorn RISC OS | zcAcorn, ///< Acorn RISC OS | |||
ZcMvs, ///< MVS | ZcMvs, ///< MVS | |||
zcVfat, ///< Win32 VFAT | zcVfat, ///< Win32 VFAT | |||
zcAtheOS, ///< AtheOS | zcAtheOS, ///< AtheOS | |||
zcBeOS, ///< BeOS | zcBeOS, ///< BeOS | |||
zcTandem, ///< Tandem NSK | zcTandem, ///< Tandem NSK | |||
zcTheos, ///< Theos | zcTheos, ///< Theos | |||
zcMacDarwin ///< Mac OS/X (Darwin) | zcMacDarwin, ///< Mac OS/X (Darwin) | |||
zcLast ///< For the internal use | ||||
}; | ||||
/** | ||||
Platform independent attributes. | ||||
*/ | ||||
enum InternalFileAttributes | ||||
{ | ||||
attROnly = 0x01, ///< Read-only attribute. | ||||
attHidd = 0x02, ///< Hidden attribute. | ||||
attSys = 0x04, ///< System attribute. | ||||
attDir = 0x10, ///< Directory attribute. | ||||
attArch = 0x20 ///< Archived attribute. | ||||
}; | }; | |||
ZIP_API DWORD GetAsInternalAttributes(DWORD uAttr, int iFromSystem); | ||||
/** | /** | |||
Checks whether the system with the given code is supported b y the ZipArchive Library. | Checks whether the system with the given code is supported b y the ZipArchive Library. | |||
\param iCode | \param iCode | |||
One of the #ZipPlatforms values to check. | One of the #ZipPlatforms values to check. | |||
\return | \return | |||
\c true, if supported; \c false otherwise. | \c true, if supported; \c false otherwise. | |||
*/ | */ | |||
ZIP_API bool IsPlatformSupported(int iCode); | ZIP_API bool IsPlatformSupported(int iCode); | |||
skipping to change at line 142 | skipping to change at line 157 | |||
/** | /** | |||
Changes the path separators from slash to backslash or vice- versa in \a szFileName. | Changes the path separators from slash to backslash or vice- versa in \a szFileName. | |||
\param szFileName | \param szFileName | |||
The filename to have the path separators changed. | The filename to have the path separators changed. | |||
\param bReplaceSlash | \param bReplaceSlash | |||
If \c true, changes slash to backslash. If \c false, changes backslash to slash. | If \c true, changes slash to backslash. If \c false, changes backslash to slash. | |||
*/ | */ | |||
void SlashBackslashChg(CZipString& szFileName, bool bReplaceSlash); | ZIP_API void SlashBackslashChg(CZipString& szFileName, bool bReplace | |||
Slash); | ||||
/** | ||||
Normalizes path separators to the default character used by | ||||
the current platform. | ||||
\param szFileName | ||||
The filename to have the path separators normalized. | ||||
*/ | ||||
ZIP_API void NormalizePathSeparators(CZipString& szFileName); | ||||
/** | /** | |||
Returns the default filename code page for the given platfor m. | Returns the default filename code page for the given platfor m. | |||
\param iPlatform | \param iPlatform | |||
One of the ZipCompatibility::ZipPlatforms values. | One of the ZipCompatibility::ZipPlatforms values. | |||
\return | \return | |||
The default filename code page. | The default filename code page. | |||
*/ | */ | |||
End of changes. 4 change blocks. | ||||
24 lines changed or deleted | 49 lines changed or added | |||
ZipCompressor.h | ZipCompressor.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 71 | skipping to change at line 71 | |||
m_uCrc32 = 0; | m_uCrc32 = 0; | |||
} | } | |||
public: | public: | |||
/** | /** | |||
The type of a compressor. | The type of a compressor. | |||
*/ | */ | |||
enum CompressorType | enum CompressorType | |||
{ | { | |||
typeDeflate = 1, ///< Deflate compression (default in zip archives). | typeDeflate = 1, ///< Deflate compression (default in zip archives). | |||
typeBzip2 ///< Bzip2 compression. | typeBzip2, ///< Bzip2 compression. | |||
typePPMd ///< PPMd compression | ||||
}; | }; | |||
/** | /** | |||
The compression level. | The compression level. | |||
*/ | */ | |||
enum CompressionLevel | enum CompressionLevel | |||
{ | { | |||
levelDefault = -1, ///< The default compression level ( equals \c 6 for deflate). | levelDefault = -1, ///< The default compression level ( equals \c 6 for deflate). | |||
levelStore = 0, ///< No compression used. Data is st ored. | levelStore = 0, ///< No compression used. Data is st ored. | |||
levelFastest = 1, ///< The fastest compression. The co mpression ratio is the lowest (apart from #levelStore). | levelFastest = 1, ///< The fastest compression. The co mpression ratio is the lowest (apart from #levelStore). | |||
skipping to change at line 413 | skipping to change at line 415 | |||
The size of the buffer. | The size of the buffer. | |||
*/ | */ | |||
void UpdateCrc(const void *pBuffer, DWORD uSize); | void UpdateCrc(const void *pBuffer, DWORD uSize); | |||
/** | /** | |||
Flushes data in the buffer into the storage, encrypting the data if needed. | Flushes data in the buffer into the storage, encrypting the data if needed. | |||
*/ | */ | |||
void FlushWriteBuffer() | void FlushWriteBuffer() | |||
{ | { | |||
if (m_pCryptograph) | WriteBuffer(m_pBuffer, (DWORD)m_uComprLeft); | |||
m_pCryptograph->Encode(m_pBuffer, (DWORD)m_uComprLef | ||||
t); | ||||
m_pStorage->Write(m_pBuffer, (DWORD)m_uComprLeft, false); | ||||
m_uComprLeft = 0; | m_uComprLeft = 0; | |||
} | } | |||
/** | /** | |||
Writes the buffer into the storage, encrypting the data if n | ||||
eeded. | ||||
\param pBuffer | ||||
The buffer with data to write. | ||||
\param uSize | ||||
The size of the buffer. | ||||
*/ | ||||
void WriteBuffer(char* pBuffer, DWORD uSize) | ||||
{ | ||||
if (uSize == 0) | ||||
return; | ||||
if (m_pCryptograph) | ||||
m_pCryptograph->Encode(pBuffer, uSize); | ||||
m_pStorage->Write(pBuffer, uSize, false); | ||||
} | ||||
/** | ||||
Fills the read buffer. | ||||
\return | ||||
The number of bytes read. | ||||
*/ | ||||
DWORD FillBuffer() | ||||
{ | ||||
DWORD uToRead = m_pBuffer.GetSize(); | ||||
if (m_uComprLeft < uToRead) | ||||
uToRead = (DWORD)m_uComprLeft; | ||||
if (uToRead > 0) | ||||
{ | ||||
m_pStorage->Read(m_pBuffer, uToRead, false); | ||||
if (m_pCryptograph) | ||||
m_pCryptograph->Decode(m_pBuffer, uToRead); | ||||
m_uComprLeft -= uToRead; | ||||
} | ||||
return uToRead; | ||||
} | ||||
/** | ||||
Initializes the internal buffer. | Initializes the internal buffer. | |||
\see | \see | |||
ReleaseBuffer | ReleaseBuffer | |||
*/ | */ | |||
void InitBuffer(); | void InitBuffer(); | |||
/** | /** | |||
Releases the internal buffer. | Releases the internal buffer. | |||
End of changes. 4 change blocks. | ||||
6 lines changed or deleted | 45 lines changed or added | |||
ZipCrc32Cryptograph.h | ZipCrc32Cryptograph.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipCryptograph.h | ZipCryptograph.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipException.h | ZipException.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 135 | skipping to change at line 135 | |||
The name of the archive for which the error occurred. | The name of the archive for which the error occurred. | |||
*/ | */ | |||
CZipString m_szFileName; | CZipString m_szFileName; | |||
/** | /** | |||
The codes of errors thrown by the ZipArchive Library. | The codes of errors thrown by the ZipArchive Library. | |||
*/ | */ | |||
enum ZipErrors | enum ZipErrors | |||
{ | { | |||
noError, ///< No error. | noError, ///< No error. | |||
// 1 - 42 reserved for errno (from STL) values - used | // 1 - 199 reserved for errno (from STL) values - used | |||
only in non-MFC versions | only in non-MFC versions | |||
// 43 - 99 reserved | genericError = 200, ///< An unspecified error. | |||
genericError = 100, ///< An unspecified error. | ||||
badZipFile, ///< Damaged or not a zip fi le. | badZipFile, ///< Damaged or not a zip fi le. | |||
badCrc, ///< Crc is mismatched. | badCrc, ///< Crc is mismatched. | |||
noCallback, ///< There is no spanned arc hive callback object set. | noCallback, ///< There is no spanned arc hive callback object set. | |||
noVolumeSize, ///< The volume size was not defined for a split archive. | noVolumeSize, ///< The volume size was not defined for a split archive. | |||
aborted, ///< The volume change callb ack in a segmented archive method returned \c false. | aborted, ///< The volume change callb ack in a segmented archive method returned \c false. | |||
abortedAction, ///< The action callback method retu rned \c false. | abortedAction, ///< The action callback method retu rned \c false. | |||
abortedSafely, ///< The action callback method retu rned \c false, but the data is not corrupted. | abortedSafely, ///< The action callback method retu rned \c false, but the data is not corrupted. | |||
nonRemovable, ///< The device selected for the spa nned archive is not removable. | nonRemovable, ///< The device selected for the spa nned archive is not removable. | |||
tooManyVolumes, ///< The limit of the maximum number of volumes has been reached. | tooManyVolumes, ///< The limit of the maximum number of volumes has been reached. | |||
tooManyFiles, ///< The limit of the maximum number of files in an archive has been reached. | tooManyFiles, ///< The limit of the maximum number of files in an archive has been reached. | |||
skipping to change at line 182 | skipping to change at line 181 | |||
bufError, ///< Zlib library error. | bufError, ///< Zlib library error. | |||
versionError, ///< Zlib library error. | versionError, ///< Zlib library error. | |||
}; | }; | |||
/** | /** | |||
The error code. It takes one of the CZipException::ZipErrors values. | The error code. It takes one of the CZipException::ZipErrors values. | |||
*/ | */ | |||
int m_iCause; | int m_iCause; | |||
/** | /** | |||
An error code reported by the system during the recent opera tion. | An error code reported by the system during the recent opera tion. | |||
It is set to \c ::GetLastError value on Windows and to \c er rno on other platforms. | It is set to \c <code>GetLastError()</code> value on Windows and to \c errno on other platforms. | |||
*/ | */ | |||
ZIP_SYSTEM_ERROR_TYPE m_iSystemError; | ZIP_SYSTEM_ERROR_TYPE m_iSystemError; | |||
virtual ~CZipException() throw(); | virtual ~CZipException() throw(); | |||
protected: | protected: | |||
#ifdef _ZIP_ENABLE_ERROR_DESCRIPTION | #ifdef _ZIP_ENABLE_ERROR_DESCRIPTION | |||
/** | /** | |||
Returns the error description. | Returns the error description. | |||
End of changes. 3 change blocks. | ||||
6 lines changed or deleted | 5 lines changed or added | |||
ZipExport.h | ZipExport.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipExtraData.h | ZipExtraData.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipExtraField.h | ZipExtraField.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipFile.h | ZipFile.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipFileHeader.h | ZipFileHeader.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 143 | skipping to change at line 142 | |||
Sets the filename. | Sets the filename. | |||
The actual renaming of the file inside of the archive depend s on the current commit mode. | The actual renaming of the file inside of the archive depend s on the current commit mode. | |||
\param lpszFileName | \param lpszFileName | |||
The filename to set. | The filename to set. | |||
\return | \return | |||
\c true, if the method succeeded; \c false, if the c urrent state of the archive is invalid for this method to be called. | \c true, if the method succeeded; \c false, if the c urrent state of the archive is invalid for this method to be called. | |||
\note | ||||
Leading path separators are removed from the filenam | ||||
e unless the header is a directory and the filename contains of only one pa | ||||
th separator (indicating a root path). | ||||
\see | \see | |||
<a href="kb">0610231944|rename</a> | <a href="kb">0610231944|rename</a> | |||
\see | \see | |||
GetFileName | GetFileName | |||
\see | \see | |||
CZipArchive::CommitChanges | CZipArchive::CommitChanges | |||
*/ | */ | |||
bool SetFileName(LPCTSTR lpszFileName); | bool SetFileName(LPCTSTR lpszFileName); | |||
/** | /** | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 6 lines changed or added | |||
ZipFileMapping.h | ZipFileMapping.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipFileMapping_lnx.h | ZipFileMapping_lnx.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipFileMapping_win.h | ZipFileMapping_win.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipFile_mfc.h | ZipFile_mfc.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 50 | skipping to change at line 50 | |||
{ | { | |||
e->Delete(); | e->Delete(); | |||
return this->m_strFileName; | return this->m_strFileName; | |||
} | } | |||
} | } | |||
ZIP_FILE_USIZE GetPosition() const {return CFile::GetPosition() ;} | ZIP_FILE_USIZE GetPosition() const {return CFile::GetPosition() ;} | |||
void SetLength(ZIP_FILE_USIZE nNewLen) {CFile::SetLength(nNewLen);} | void SetLength(ZIP_FILE_USIZE nNewLen) {CFile::SetLength(nNewLen);} | |||
ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE lOff , int nFrom){return CFile::Se ek(lOff, nFrom);} | ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE lOff , int nFrom){return CFile::Se ek(lOff, nFrom);} | |||
ZIP_FILE_USIZE GetLength() const {return CFile::GetLength();} | ZIP_FILE_USIZE GetLength() const {return CFile::GetLength();} | |||
bool HasFilePath() const | ||||
{ | ||||
return true; | ||||
} | ||||
UINT Read(void *lpBuf, UINT nCount){return CFile::Read(lpBuf, nCount );} | UINT Read(void *lpBuf, UINT nCount){return CFile::Read(lpBuf, nCount );} | |||
void Write(const void* lpBuf, UINT nCount){CFile::Write(lpBuf, nCoun t);} | void Write(const void* lpBuf, UINT nCount){CFile::Write(lpBuf, nCoun t);} | |||
bool Open( LPCTSTR lpszFileName, UINT nOpenFlags, bool bThrowExc) | bool Open( LPCTSTR lpszFileName, UINT nOpenFlags, bool bThrowExc) | |||
{ | { | |||
CFileException* e = new CFileException; | CFileException* e = new CFileException; | |||
bool bRet = CFile::Open(lpszFileName, nOpenFlags, e) != 0; | bool bRet = CFile::Open(lpszFileName, nOpenFlags, e) != 0; | |||
if (!bRet && bThrowExc) | if (!bRet && bThrowExc) | |||
throw e; | throw e; | |||
e->Delete(); | e->Delete(); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 5 lines changed or added | |||
ZipFile_stl.h | ZipFile_stl.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 79 | skipping to change at line 79 | |||
shareDenyNone = 0x00040, | shareDenyNone = 0x00040, | |||
modeCreate = 0x01000, | modeCreate = 0x01000, | |||
modeNoTruncate = 0x02000 | modeNoTruncate = 0x02000 | |||
}; | }; | |||
CZipFile(); | CZipFile(); | |||
CZipFile(LPCTSTR lpszFileName, UINT openFlags); | CZipFile(LPCTSTR lpszFileName, UINT openFlags); | |||
void Flush(); | void Flush(); | |||
ZIP_FILE_USIZE GetLength() const; | ZIP_FILE_USIZE GetLength() const; | |||
CZipString GetFilePath() const {return m_szFileName;} | CZipString GetFilePath() const {return m_szFileName;} | |||
bool HasFilePath() const | ||||
{ | ||||
return true; | ||||
} | ||||
bool IsClosed()const { return m_hFile == -1;} | bool IsClosed()const { return m_hFile == -1;} | |||
bool Open(LPCTSTR lpszFileName, UINT openFlags, bool bThrow); | bool Open(LPCTSTR lpszFileName, UINT openFlags, bool bThrow); | |||
void Close(); | void Close(); | |||
void Write(const void* lpBuf, UINT nCount); | void Write(const void* lpBuf, UINT nCount); | |||
ZIP_FILE_USIZE GetPosition() const; | ZIP_FILE_USIZE GetPosition() const; | |||
void SetLength(ZIP_FILE_USIZE uNewLen); | void SetLength(ZIP_FILE_USIZE uNewLen); | |||
UINT Read(void *lpBuf, UINT nCount); | UINT Read(void *lpBuf, UINT nCount); | |||
ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE dOff, int nFrom); | ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE dOff, int nFrom); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 5 lines changed or added | |||
ZipFile_win.h | ZipFile_win.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 52 | skipping to change at line 52 | |||
shareDenyNone = 0x00040, | shareDenyNone = 0x00040, | |||
modeCreate = 0x01000, | modeCreate = 0x01000, | |||
modeNoTruncate = 0x02000 | modeNoTruncate = 0x02000 | |||
}; | }; | |||
CZipFile(); | CZipFile(); | |||
CZipFile(LPCTSTR lpszFileName, UINT openFlags); | CZipFile(LPCTSTR lpszFileName, UINT openFlags); | |||
void Flush(); | void Flush(); | |||
ULONGLONG GetLength() const; | ULONGLONG GetLength() const; | |||
CZipString GetFilePath() const {return m_szFileName;} | CZipString GetFilePath() const {return m_szFileName;} | |||
bool HasFilePath() const | ||||
{ | ||||
return true; | ||||
} | ||||
bool IsClosed()const { return m_hFile == INVALID_HANDLE_VALUE;} | bool IsClosed()const { return m_hFile == INVALID_HANDLE_VALUE;} | |||
bool Open(LPCTSTR lpszFileName, UINT openFlags, bool bThrow); | bool Open(LPCTSTR lpszFileName, UINT openFlags, bool bThrow); | |||
void Close(); | void Close(); | |||
void Write(const void* lpBuf, UINT nCount); | void Write(const void* lpBuf, UINT nCount); | |||
ULONGLONG GetPosition() const; | ULONGLONG GetPosition() const; | |||
void SetLength(ULONGLONG uNewLen); | void SetLength(ULONGLONG uNewLen); | |||
UINT Read(void *lpBuf, UINT nCount); | UINT Read(void *lpBuf, UINT nCount); | |||
ULONGLONG Seek(LONGLONG dOff, int nFrom); | ULONGLONG Seek(LONGLONG dOff, int nFrom); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 5 lines changed or added | |||
ZipMemFile.h | ZipMemFile.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 36 | skipping to change at line 36 | |||
#include "ZipAbstractFile.h" | #include "ZipAbstractFile.h" | |||
#include "ZipString.h" | #include "ZipString.h" | |||
#include "ZipExport.h" | #include "ZipExport.h" | |||
/** | /** | |||
Represents a file in memory. | Represents a file in memory. | |||
Automatically grows when necessary. | Automatically grows when necessary. | |||
*/ | */ | |||
class ZIP_API CZipMemFile : public CZipAbstractFile | class ZIP_API CZipMemFile : public CZipAbstractFile | |||
// when ZIP_ZFI_WIN is defined under VS 6.0, do not derive from CFile, as s | ||||
izes are limited to DWORD | ||||
#if defined _ZIP_IMPL_MFC && (_MSC_VER >= 1300 || _ZIP_FILE_IMPLEMENTATION | ||||
!= ZIP_ZFI_WIN) | ||||
, public CFile | ||||
#endif | ||||
{ | { | |||
protected: | protected: | |||
size_t m_nGrowBy, m_nPos; | size_t m_nGrowBy, m_nPos; | |||
size_t m_nBufSize, m_nDataSize; | size_t m_nBufSize, m_nDataSize; | |||
BYTE* m_lpBuf; | BYTE* m_lpBuf; | |||
bool m_bAutoDelete; | bool m_bAutoDelete; | |||
void Free() | void Free() | |||
{ | { | |||
if (m_lpBuf) | if (m_lpBuf) | |||
{ | { | |||
skipping to change at line 59 | skipping to change at line 63 | |||
} | } | |||
void Init() | void Init() | |||
{ | { | |||
m_nGrowBy = m_nPos = 0; | m_nGrowBy = m_nPos = 0; | |||
m_nBufSize = m_nDataSize = 0; | m_nBufSize = m_nDataSize = 0; | |||
m_lpBuf = NULL; | m_lpBuf = NULL; | |||
} | } | |||
void Grow(size_t nBytes); | void Grow(size_t nBytes); | |||
public: | public: | |||
#if defined _ZIP_IMPL_MFC && (_MSC_VER >= 1300 || _ZIP_FILE_IMPLEMENTATION | ||||
!= ZIP_ZFI_WIN) | ||||
DECLARE_DYNAMIC(CZipMemFile) | ||||
#endif | ||||
bool IsClosed() const { return m_lpBuf == NULL;} | bool IsClosed() const { return m_lpBuf == NULL;} | |||
void Flush(){} | void Flush(){} | |||
ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE lOff, int nFrom); | ZIP_FILE_USIZE Seek(ZIP_FILE_SIZE lOff, int nFrom); | |||
ZIP_FILE_USIZE GetLength() const {return m_nDataSize;} | ZIP_FILE_USIZE GetLength() const {return m_nDataSize;} | |||
void Write(const void* lpBuf, UINT nCount); | void Write(const void* lpBuf, UINT nCount); | |||
UINT Read(void* lpBuf, UINT nCount); | UINT Read(void* lpBuf, UINT nCount); | |||
void SetLength(ZIP_FILE_USIZE nNewLen); | void SetLength(ZIP_FILE_USIZE nNewLen); | |||
CZipString GetFilePath() const {return _T("");} | CZipString GetFilePath() const {return _T("");} | |||
bool HasFilePath() const | ||||
{ | ||||
return false; | ||||
} | ||||
CZipMemFile(long nGrowBy = 1024) | CZipMemFile(long nGrowBy = 1024) | |||
{ | { | |||
Init(); | Init(); | |||
m_nGrowBy = nGrowBy; | m_nGrowBy = nGrowBy; | |||
m_bAutoDelete = true; | m_bAutoDelete = true; | |||
} | } | |||
CZipMemFile(BYTE* lpBuf, UINT nBufSize, long nGrowBy = 0) | CZipMemFile(BYTE* lpBuf, UINT nBufSize, long nGrowBy = 0) | |||
{ | { | |||
Init(); | Init(); | |||
End of changes. 4 change blocks. | ||||
1 lines changed or deleted | 16 lines changed or added | |||
ZipMutex.h | ZipMutex.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipMutex_lnx.h | ZipMutex_lnx.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipMutex_win.h | ZipMutex_win.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipPathComponent.h | ZipPathComponent.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 41 | skipping to change at line 41 | |||
#include "ZipString.h" | #include "ZipString.h" | |||
#include "ZipExport.h" | #include "ZipExport.h" | |||
/** | /** | |||
Splits a file path into components. | Splits a file path into components. | |||
*/ | */ | |||
class ZIP_API CZipPathComponent | class ZIP_API CZipPathComponent | |||
{ | { | |||
public: | public: | |||
static const CZipString PathPrefix; | ||||
#ifdef _ZIP_SYSTEM_WIN | #ifdef _ZIP_SYSTEM_WIN | |||
static const CZipString PathPrefix; | ||||
/** | /** | |||
The type of the prefix in path. | The type of the prefix in path. | |||
*/ | */ | |||
enum PrefixType | enum PrefixType | |||
{ | { | |||
ptNone = 0, ///< There is no prefix pres ent. | ptNone = 0, ///< There is no prefix pres ent. | |||
ptUnc = 2, ///< UNC path. | ptUnc = 2, ///< UNC path. | |||
ptUnicode = 4, ///< Unicode path. | ptUnicode = 4, ///< Unicode path. | |||
ptUncWin = 8 ///< Windows UNC path. | ptUncWin = 8 ///< Windows UNC path. | |||
}; | }; | |||
/** | /** | |||
Returns the length of the path prefix detected. | Returns the length of the path prefix detected. | |||
\param path | \param path | |||
The path to examine. | The path to examine. | |||
\return | \return | |||
The length of the path prefix or \c 0, if no prefix was detected. | The length of the path prefix or \c 0, if no prefix was detected. | |||
*/ | */ | |||
static int IsPrefixed(const CZipString& path); | static int IsPrefixed(const CZipString& path); | |||
/** | ||||
Adds an UNC prefix to the paths. | ||||
\param path | ||||
The path to add a prefix to. | ||||
\param isFolder | ||||
\c true if the \a path points to a folder; \c false | ||||
otherwise. | ||||
\return | ||||
The prefixed path. | ||||
*/ | ||||
static CZipString AddPrefix(LPCTSTR path, bool isFolder = true); | ||||
/** | ||||
Adds an UNC prefix to the paths. | ||||
\param path | ||||
The path to add a prefix to. | ||||
\param isFolder | ||||
\c true if the \a path points to a folder; \c false | ||||
otherwise. | ||||
*/ | ||||
static void AddPrefix(CZipString& path, bool isFolder = true); | ||||
#endif | #endif | |||
CZipPathComponent(){} | CZipPathComponent(){} | |||
/** | /** | |||
Initializes a new instance of the CZipPathComponent class. | Initializes a new instance of the CZipPathComponent class. | |||
\param lpszFullPath | \param lpszFullPath | |||
The full path to the file. | The full path to the file. | |||
\see | \see | |||
SetFullPath | SetFullPath | |||
skipping to change at line 119 | skipping to change at line 145 | |||
} | } | |||
/** | /** | |||
Removes path separators from the end of \a szPath | Removes path separators from the end of \a szPath | |||
\param szPath | \param szPath | |||
The path to have path separators removed. | The path to have path separators removed. | |||
*/ | */ | |||
static void RemoveSeparators(CZipString& szPath) | static void RemoveSeparators(CZipString& szPath) | |||
{ | { | |||
// szPath.TrimRight(m_cSeparator); | ||||
szPath.TrimRight(_T("\\/")); | szPath.TrimRight(_T("\\/")); | |||
} | } | |||
/** | /** | |||
Removes path separators from the beginning of \a szPath. | Removes path separators from the beginning of \a szPath. | |||
\param szPath | \param szPath | |||
The path to have path separators removed. | The path to have path separators removed. | |||
*/ | */ | |||
static void RemoveSeparatorsLeft(CZipString& szPath) | static void RemoveSeparatorsLeft(CZipString& szPath) | |||
End of changes. 5 change blocks. | ||||
3 lines changed or deleted | 30 lines changed or added | |||
ZipPlatform.h | ZipPlatform.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 40 | skipping to change at line 40 | |||
#include "ZipString.h" | #include "ZipString.h" | |||
#include "ZipPathComponent.h" | #include "ZipPathComponent.h" | |||
#include <sys/types.h> | #include <sys/types.h> | |||
#include "ZipExport.h" | #include "ZipExport.h" | |||
/** | /** | |||
Includes functions that require system-specific implementation. | Includes functions that require system-specific implementation. | |||
*/ | */ | |||
namespace ZipPlatform | namespace ZipPlatform | |||
{ | { | |||
/** | ||||
The mode for deleting files. | ||||
*/ | ||||
enum DeleteFileMode | ||||
{ | ||||
dfmRegular = 0x00, ///< No spec | ||||
ial action is taken when overwriting a file. | ||||
dfmRemoveReadOnly = 0x01 ///< The read-only a | ||||
ttribute is cleared before overwriting a file. | ||||
#if defined _ZIP_SYSTEM_WIN && defined SHFileOperation | ||||
,dfmRecycleBin = 0x02 ///< The overwritten | ||||
file is moved to the Recycle Bin (Windows only). | ||||
#endif | ||||
}; | ||||
/** | /** | |||
Returns the default case-sensitivity for the current file sy stem. | Returns the default case-sensitivity for the current file sy stem. | |||
\return | \return | |||
\c true, if the system is case-sensitive; \c false o therwise. | \c true, if the system is case-sensitive; \c false o therwise. | |||
*/ | */ | |||
ZIP_API bool GetSystemCaseSensitivity(); | ZIP_API bool GetSystemCaseSensitivity(); | |||
/** | /** | |||
Returns the current system identifier. | Returns the current system identifier. | |||
skipping to change at line 114 | skipping to change at line 124 | |||
ZIP_API bool GetCurrentDirectory(CZipString& sz); ///< Returns the current directory and stores it in \a sz. | ZIP_API bool GetCurrentDirectory(CZipString& sz); ///< Returns the current directory and stores it in \a sz. | |||
ZIP_API bool ChangeDirectory(LPCTSTR lpDirectory); ///< Changes the current directory. | ZIP_API bool ChangeDirectory(LPCTSTR lpDirectory); ///< Changes the current directory. | |||
ZIP_API bool SetFileAttr(LPCTSTR lpFileName, DWORD uAttr); ///< Sets the file attributes. | ZIP_API bool SetFileAttr(LPCTSTR lpFileName, DWORD uAttr); ///< Sets the file attributes. | |||
ZIP_API bool GetFileAttr(LPCTSTR lpFileName, DWORD& uAttr); ///< Ret urns the file attributes. | ZIP_API bool GetFileAttr(LPCTSTR lpFileName, DWORD& uAttr); ///< Ret urns the file attributes. | |||
ZIP_API bool GetFileModTime(LPCTSTR lpFileName, time_t & ttime); /// < Returns the file modification time. | ZIP_API bool GetFileModTime(LPCTSTR lpFileName, time_t & ttime); /// < Returns the file modification time. | |||
ZIP_API bool SetFileModTime(LPCTSTR lpFileName, time_t ttime); /// < Set the file modification time. | ZIP_API bool SetFileModTime(LPCTSTR lpFileName, time_t ttime); /// < Set the file modification time. | |||
ZIP_API bool GetFileSize(LPCTSTR lpszFileName, ZIP_SIZE_TYPE& dSize) ; ///< Returns the file size. | ZIP_API bool GetFileSize(LPCTSTR lpszFileName, ZIP_SIZE_TYPE& dSize) ; ///< Returns the file size. | |||
ZIP_API bool CreateNewDirectory(LPCTSTR lpDirectory); ///< Creates a new directory. | ZIP_API bool CreateNewDirectory(LPCTSTR lpDirectory); ///< Creates a new directory. | |||
ZIP_API bool SetVolLabel(LPCTSTR lpszPath, LPCTSTR lpszLabel); ///< Sets a label on a removable device. \c lpszPath may point to a file on the device. | ZIP_API bool SetVolLabel(LPCTSTR lpszPath, LPCTSTR lpszLabel); ///< Sets a label on a removable device. \c lpszPath may point to a file on the device. | |||
ZIP_API bool ForceDirectory(LPCTSTR lpDirectory); ///< Creates nested directories at once. | ZIP_API bool ForceDirectory(LPCTSTR lpDirectory); ///< Creates nested directories at once. | |||
ZIP_API bool RemoveFile(LPCTSTR lpszFileName, bool bThrow = true); / //< Removes a file. | ZIP_API bool RemoveFile(LPCTSTR lpszFileName, bool bThrow = true, in t iMode = dfmRegular); ///< Removes a file. | |||
ZIP_API bool RenameFile( LPCTSTR lpszOldName, LPCTSTR lpszNewName, b ool bThrow = true); ///< Renames a file. | ZIP_API bool RenameFile( LPCTSTR lpszOldName, LPCTSTR lpszNewName, b ool bThrow = true); ///< Renames a file. | |||
#ifdef _ZIP_SYSTEM_LINUX | #ifdef _ZIP_SYSTEM_LINUX | |||
ZIP_API bool SetExeAttr( LPCTSTR lpFileName ); ///< Sets executable permissions for a file. | ZIP_API bool SetExeAttr( LPCTSTR lpFileName ); ///< Sets executable permissions for a file. | |||
#endif | #endif | |||
#if defined _ZIP_IMPL_STL || _ZIP_FILE_IMPLEMENTATION == ZIP_ZFI_STL | #if defined _ZIP_IMPL_STL || _ZIP_FILE_IMPLEMENTATION == ZIP_ZFI_STL | |||
/** | /** | |||
Truncates the file. | Truncates the file. | |||
End of changes. 3 change blocks. | ||||
3 lines changed or deleted | 16 lines changed or added | |||
ZipSplitNamesHandler.h | ZipSplitNamesHandler.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipStorage.h | ZipStorage.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 459 | skipping to change at line 459 | |||
\param bWrite | \param bWrite | |||
Set to \c false, if the storage should not perform a ny write operations. | Set to \c false, if the storage should not perform a ny write operations. | |||
\param bGetLastVolumeName | \param bGetLastVolumeName | |||
Set to \c true, if the storage should return the pat h. | Set to \c true, if the storage should return the pat h. | |||
\return | \return | |||
The file path of the archive or of the last volume i n the archive. | The file path of the archive or of the last volume i n the archive. | |||
Only if \a bGetLastVolumeName is set to \c true. | Only if \a bGetLastVolumeName is set to \c true. | |||
*/ | */ | |||
CZipString Close(bool bWrite, bool bGetLastVolumeName); | CZipString Close(bool bWrite, bool bGetLastVolumeName = false); | |||
/** | /** | |||
Represents the physical storage for the archive (or the curr ent archive segment in segmented archives). | Represents the physical storage for the archive (or the curr ent archive segment in segmented archives). | |||
*/ | */ | |||
CZipAbstractFile* m_pFile; | CZipAbstractFile* m_pFile; | |||
/** | /** | |||
The signature of the extended header. | The signature of the extended header. | |||
*/ | */ | |||
static char m_gszExtHeaderSignat[]; | static char m_gszExtHeaderSignat[]; | |||
ZipArchiveLib::CBitFlag& GetState() | ||||
{ | ||||
return m_state; | ||||
} | ||||
protected: | protected: | |||
/** | /** | |||
Returns the file offset after the last data byte in the arch ive. | Returns the file offset after the last data byte in the arch ive. | |||
\return | \return | |||
The file offset after the last data byte in the arch ive. | The file offset after the last data byte in the arch ive. | |||
*/ | */ | |||
ZIP_SIZE_TYPE GetLastDataOffset() | ZIP_SIZE_TYPE GetLastDataOffset() | |||
{ | { | |||
End of changes. 3 change blocks. | ||||
2 lines changed or deleted | 7 lines changed or added | |||
ZipString.h | ZipString.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipStringStoreSettings.h | ZipStringStoreSettings.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipString_mfc.h | ZipString_mfc.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
ZipString_stl.h | ZipString_stl.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 238 | skipping to change at line 238 | |||
} | } | |||
#endif | #endif | |||
void MakeReverse() | void MakeReverse() | |||
{ | { | |||
std::reverse(begin(), end()); | std::reverse(begin(), end()); | |||
} | } | |||
CZipString Left( int nCount ) const { return substr(0, nCount);} | CZipString Left( int nCount ) const { return substr(0, nCount);} | |||
CZipString Right( int nCount) const | CZipString Right( int nCount) const | |||
{ | { | |||
nCount = (int)size() < nCount ? (int)size() : nCount; | int s = (int)size(); | |||
return substr(size() - nCount); | nCount = s < nCount ? s : nCount; | |||
return substr(s - nCount); | ||||
} | } | |||
CZipString Mid( int nFirst ) const {return substr(nFirst);} | CZipString Mid( int nFirst ) const {return substr(nFirst);} | |||
CZipString Mid( int nFirst, int nCount ) const {return substr(nFirst , nCount);} | CZipString Mid( int nFirst, int nCount ) const {return substr(nFirst , nCount);} | |||
int Collate( LPCTSTR lpsz ) const | int Collate( LPCTSTR lpsz ) const | |||
{ | { | |||
#if !defined __GNUC__ || defined __MINGW32__ | #if !defined __GNUC__ || defined __MINGW32__ | |||
return _tcscoll(c_str(), lpsz); | return _tcscoll(c_str(), lpsz); | |||
#else | #else | |||
//return compare(lpsz); | //return compare(lpsz); | |||
return strcoll(c_str(), lpsz); | return strcoll(c_str(), lpsz); | |||
End of changes. 2 change blocks. | ||||
3 lines changed or deleted | 4 lines changed or added | |||
_features.h | _features.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 151 | skipping to change at line 150 | |||
/** | /** | |||
Active implementation of CZipFile class. | Active implementation of CZipFile class. | |||
\see | \see | |||
<a href="kb">0610050933|fileImpl</a> | <a href="kb">0610050933|fileImpl</a> | |||
*/ | */ | |||
#define _ZIP_FILE_IMPLEMENTATION ZIP_ZFI_DEFAULT | #define _ZIP_FILE_IMPLEMENTATION ZIP_ZFI_DEFAULT | |||
#if defined _ZIP_ZIP64 && (defined __BORLANDC__ || (defined _MSC_VER && _MS C_VER < 1300 && defined _ZIP_IMPL_MFC)) | #if defined _ZIP_ZIP64 && (defined __BORLANDC__ || (defined _MSC_VER && _MS C_VER < 1300 && defined _ZIP_IMPL_MFC)) | |||
/** | /** | |||
Define this, if you want to use Zip64 functionality in Visua l Studio 6.0 MFC or Borland. These platforms do not support large files, | Define this, if you want to use Zip64 functionality in Visua l Studio 6.0 MFC or C++Builder. These platforms do not support large files, | |||
but this definition will cause to use the STL implementation of CZipFile (which has the support for large files) instead of MFC. | but this definition will cause to use the STL implementation of CZipFile (which has the support for large files) instead of MFC. | |||
\see | \see | |||
<a href="kb">0610050933|fileImpl</a> | <a href="kb">0610050933|fileImpl</a> | |||
*/ | */ | |||
#if _ZIP_FILE_IMPLEMENTATION != ZIP_ZFI_WIN | #if _ZIP_FILE_IMPLEMENTATION != ZIP_ZFI_WIN | |||
#undef _ZIP_FILE_IMPLEMENTATION | #undef _ZIP_FILE_IMPLEMENTATION | |||
#define _ZIP_FILE_IMPLEMENTATION ZIP_ZFI_WIN | #define _ZIP_FILE_IMPLEMENTATION ZIP_ZFI_WIN | |||
#endif | #endif | |||
#endif | #endif | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
_platform.h | _platform.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
deflate.h | deflate.h | |||
---|---|---|---|---|
/* deflate.h -- internal compression state | /* deflate.h -- internal compression state | |||
* Copyright (C) 1995-2004 Jean-loup Gailly | * Copyright (C) 1995-2010 Jean-loup Gailly | |||
* For conditions of distribution and use, see copyright notice in zlib.h | * For conditions of distribution and use, see copyright notice in zlib.h | |||
*/ | */ | |||
/* WARNING: this file should *not* be used by applications. It is | /* WARNING: this file should *not* be used by applications. It is | |||
part of the implementation of the compression library and is | part of the implementation of the compression library and is | |||
subject to change. Applications should only use zlib.h. | subject to change. Applications should only use zlib.h. | |||
*/ | */ | |||
/* @(#) $Id$ */ | /* @(#) $Id$ */ | |||
skipping to change at line 262 | skipping to change at line 262 | |||
ush bi_buf; | ush bi_buf; | |||
/* Output buffer. bits are inserted starting at the bottom (least | /* Output buffer. bits are inserted starting at the bottom (least | |||
* significant bits). | * significant bits). | |||
*/ | */ | |||
int bi_valid; | int bi_valid; | |||
/* Number of valid bits in bi_buf. All bits above the last valid bit | /* Number of valid bits in bi_buf. All bits above the last valid bit | |||
* are always zero. | * are always zero. | |||
*/ | */ | |||
ulg high_water; | ||||
/* High water mark offset in window for initialized bytes -- bytes abov | ||||
e | ||||
* this are set to zero in order to avoid memory check warnings when | ||||
* longest match routines access bytes past the input. This is then | ||||
* updated to the new high water mark. | ||||
*/ | ||||
} FAR deflate_state; | } FAR deflate_state; | |||
/* Output a byte on the stream. | /* Output a byte on the stream. | |||
* IN assertion: there is enough room in pending_buf. | * IN assertion: there is enough room in pending_buf. | |||
*/ | */ | |||
#define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} | #define put_byte(s, c) {s->pending_buf[s->pending++] = (c);} | |||
#define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) | #define MIN_LOOKAHEAD (MAX_MATCH+MIN_MATCH+1) | |||
/* Minimum amount of lookahead, except at the end of the input file. | /* Minimum amount of lookahead, except at the end of the input file. | |||
* See deflate.c for comments about the MIN_MATCH+1. | * See deflate.c for comments about the MIN_MATCH+1. | |||
*/ | */ | |||
#define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) | #define MAX_DIST(s) ((s)->w_size-MIN_LOOKAHEAD) | |||
/* In order to simplify the code, particularly on 16 bit machines, match | /* In order to simplify the code, particularly on 16 bit machines, match | |||
* distances are limited to MAX_DIST instead of WSIZE. | * distances are limited to MAX_DIST instead of WSIZE. | |||
*/ | */ | |||
#define WIN_INIT MAX_MATCH | ||||
/* Number of bytes after end of data in window to initialize in order to av | ||||
oid | ||||
memory checker errors from longest match routines */ | ||||
/* in trees.c */ | /* in trees.c */ | |||
void _tr_init OF((deflate_state *s)); | void ZLIB_INTERNAL _tr_init OF((deflate_state *s)); | |||
int _tr_tally OF((deflate_state *s, unsigned dist, unsigned lc)); | int ZLIB_INTERNAL _tr_tally OF((deflate_state *s, unsigned dist, unsigned l | |||
void _tr_flush_block OF((deflate_state *s, charf *buf, ulg stored_len, | c)); | |||
int eof)); | void ZLIB_INTERNAL _tr_flush_block OF((deflate_state *s, charf *buf, | |||
void _tr_align OF((deflate_state *s)); | ulg stored_len, int last)); | |||
void _tr_stored_block OF((deflate_state *s, charf *buf, ulg stored_len, | void ZLIB_INTERNAL _tr_align OF((deflate_state *s)); | |||
int eof)); | void ZLIB_INTERNAL _tr_stored_block OF((deflate_state *s, charf *buf, | |||
ulg stored_len, int last)); | ||||
#define d_code(dist) \ | #define d_code(dist) \ | |||
((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) | ((dist) < 256 ? _dist_code[dist] : _dist_code[256+((dist)>>7)]) | |||
/* Mapping from a distance to a distance code. dist is the distance - 1 and | /* Mapping from a distance to a distance code. dist is the distance - 1 and | |||
* must not have side effects. _dist_code[256] and _dist_code[257] are neve r | * must not have side effects. _dist_code[256] and _dist_code[257] are neve r | |||
* used. | * used. | |||
*/ | */ | |||
#ifndef DEBUG | #ifndef DEBUG | |||
/* Inline versions of _tr_tally for speed: */ | /* Inline versions of _tr_tally for speed: */ | |||
#if defined(GEN_TREES_H) || !defined(STDC) | #if defined(GEN_TREES_H) || !defined(STDC) | |||
extern uch _length_code[]; | extern uch ZLIB_INTERNAL _length_code[]; | |||
extern uch _dist_code[]; | extern uch ZLIB_INTERNAL _dist_code[]; | |||
#else | #else | |||
extern const uch _length_code[]; | extern const uch ZLIB_INTERNAL _length_code[]; | |||
extern const uch _dist_code[]; | extern const uch ZLIB_INTERNAL _dist_code[]; | |||
#endif | #endif | |||
# define _tr_tally_lit(s, c, flush) \ | # define _tr_tally_lit(s, c, flush) \ | |||
{ uch cc = (c); \ | { uch cc = (c); \ | |||
s->d_buf[s->last_lit] = 0; \ | s->d_buf[s->last_lit] = 0; \ | |||
s->l_buf[s->last_lit++] = cc; \ | s->l_buf[s->last_lit++] = cc; \ | |||
s->dyn_ltree[cc].Freq++; \ | s->dyn_ltree[cc].Freq++; \ | |||
flush = (s->last_lit == s->lit_bufsize-1); \ | flush = (s->last_lit == s->lit_bufsize-1); \ | |||
} | } | |||
# define _tr_tally_dist(s, distance, length, flush) \ | # define _tr_tally_dist(s, distance, length, flush) \ | |||
End of changes. 6 change blocks. | ||||
12 lines changed or deleted | 26 lines changed or added | |||
inffast.h | inffast.h | |||
---|---|---|---|---|
/* inffast.h -- header to use inffast.c | /* inffast.h -- header to use inffast.c | |||
* Copyright (C) 1995-2003 Mark Adler | * Copyright (C) 1995-2003, 2010 Mark Adler | |||
* For conditions of distribution and use, see copyright notice in zlib.h | * For conditions of distribution and use, see copyright notice in zlib.h | |||
*/ | */ | |||
/* WARNING: this file should *not* be used by applications. It is | /* WARNING: this file should *not* be used by applications. It is | |||
part of the implementation of the compression library and is | part of the implementation of the compression library and is | |||
subject to change. Applications should only use zlib.h. | subject to change. Applications should only use zlib.h. | |||
*/ | */ | |||
void inflate_fast OF((z_streamp strm, unsigned start)); | void ZLIB_INTERNAL inflate_fast OF((z_streamp strm, unsigned start)); | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
inflate.h | inflate.h | |||
---|---|---|---|---|
/* inflate.h -- internal inflate state definition | /* inflate.h -- internal inflate state definition | |||
* Copyright (C) 1995-2004 Mark Adler | * Copyright (C) 1995-2009 Mark Adler | |||
* For conditions of distribution and use, see copyright notice in zlib.h | * For conditions of distribution and use, see copyright notice in zlib.h | |||
*/ | */ | |||
/* WARNING: this file should *not* be used by applications. It is | /* WARNING: this file should *not* be used by applications. It is | |||
part of the implementation of the compression library and is | part of the implementation of the compression library and is | |||
subject to change. Applications should only use zlib.h. | subject to change. Applications should only use zlib.h. | |||
*/ | */ | |||
/* define NO_GZIP when compiling if you want to disable gzip header and | /* define NO_GZIP when compiling if you want to disable gzip header and | |||
trailer decoding by inflate(). NO_GZIP would be used to avoid linking i n | trailer decoding by inflate(). NO_GZIP would be used to avoid linking i n | |||
skipping to change at line 35 | skipping to change at line 35 | |||
EXLEN, /* i: waiting for extra length (gzip) */ | EXLEN, /* i: waiting for extra length (gzip) */ | |||
EXTRA, /* i: waiting for extra bytes (gzip) */ | EXTRA, /* i: waiting for extra bytes (gzip) */ | |||
NAME, /* i: waiting for end of file name (gzip) */ | NAME, /* i: waiting for end of file name (gzip) */ | |||
COMMENT, /* i: waiting for end of comment (gzip) */ | COMMENT, /* i: waiting for end of comment (gzip) */ | |||
HCRC, /* i: waiting for header crc (gzip) */ | HCRC, /* i: waiting for header crc (gzip) */ | |||
DICTID, /* i: waiting for dictionary check value */ | DICTID, /* i: waiting for dictionary check value */ | |||
DICT, /* waiting for inflateSetDictionary() call */ | DICT, /* waiting for inflateSetDictionary() call */ | |||
TYPE, /* i: waiting for type bits, including last-flag bit */ | TYPE, /* i: waiting for type bits, including last-flag bit */ | |||
TYPEDO, /* i: same, but skip check to exit inflate on new block */ | TYPEDO, /* i: same, but skip check to exit inflate on new block */ | |||
STORED, /* i: waiting for stored size (length and complement) * / | STORED, /* i: waiting for stored size (length and complement) * / | |||
COPY_, /* i/o: same as COPY below, but only first time in */ | ||||
COPY, /* i/o: waiting for input or output to copy stored bloc k */ | COPY, /* i/o: waiting for input or output to copy stored bloc k */ | |||
TABLE, /* i: waiting for dynamic block table lengths */ | TABLE, /* i: waiting for dynamic block table lengths */ | |||
LENLENS, /* i: waiting for code length code lengths */ | LENLENS, /* i: waiting for code length code lengths */ | |||
CODELENS, /* i: waiting for length/lit and distance code lengths */ | CODELENS, /* i: waiting for length/lit and distance code lengths */ | |||
LEN, /* i: waiting for length/lit code */ | LEN_, /* i: same as LEN below, but only first time in */ | |||
LEN, /* i: waiting for length/lit/eob code */ | ||||
LENEXT, /* i: waiting for length extra bits */ | LENEXT, /* i: waiting for length extra bits */ | |||
DIST, /* i: waiting for distance code */ | DIST, /* i: waiting for distance code */ | |||
DISTEXT, /* i: waiting for distance extra bits */ | DISTEXT, /* i: waiting for distance extra bits */ | |||
MATCH, /* o: waiting for output space to copy string */ | MATCH, /* o: waiting for output space to copy string */ | |||
LIT, /* o: waiting for output space to write literal */ | LIT, /* o: waiting for output space to write literal */ | |||
CHECK, /* i: waiting for 32-bit check value */ | CHECK, /* i: waiting for 32-bit check value */ | |||
LENGTH, /* i: waiting for 32-bit length (gzip) */ | LENGTH, /* i: waiting for 32-bit length (gzip) */ | |||
DONE, /* finished check, done -- remain here until reset */ | DONE, /* finished check, done -- remain here until reset */ | |||
BAD, /* got a data error -- remain here until reset */ | BAD, /* got a data error -- remain here until reset */ | |||
MEM, /* got an inflate() memory error -- remain here until reset */ | MEM, /* got an inflate() memory error -- remain here until reset */ | |||
SYNC /* looking for synchronization bytes to restart inflate() * / | SYNC /* looking for synchronization bytes to restart inflate() * / | |||
} inflate_mode; | } inflate_mode; | |||
/* | /* | |||
State transitions between above modes - | State transitions between above modes - | |||
(most modes can go to the BAD or MEM mode -- not shown for clarity) | (most modes can go to BAD or MEM on error -- not shown for clarity) | |||
Process header: | Process header: | |||
HEAD -> (gzip) or (zlib) | HEAD -> (gzip) or (zlib) or (raw) | |||
(gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME | (gzip) -> FLAGS -> TIME -> OS -> EXLEN -> EXTRA -> NAME -> COMMENT | |||
NAME -> COMMENT -> HCRC -> TYPE | -> | |||
HCRC -> TYPE | ||||
(zlib) -> DICTID or TYPE | (zlib) -> DICTID or TYPE | |||
DICTID -> DICT -> TYPE | DICTID -> DICT -> TYPE | |||
(raw) -> TYPEDO | ||||
Read deflate blocks: | Read deflate blocks: | |||
TYPE -> STORED or TABLE or LEN or CHECK | TYPE -> TYPEDO -> STORED or TABLE or LEN_ or CHECK | |||
STORED -> COPY -> TYPE | STORED -> COPY_ -> COPY -> TYPE | |||
TABLE -> LENLENS -> CODELENS -> LEN | TABLE -> LENLENS -> CODELENS -> LEN_ | |||
Read deflate codes: | LEN_ -> LEN | |||
Read deflate codes in fixed or dynamic block: | ||||
LEN -> LENEXT or LIT or TYPE | LEN -> LENEXT or LIT or TYPE | |||
LENEXT -> DIST -> DISTEXT -> MATCH -> LEN | LENEXT -> DIST -> DISTEXT -> MATCH -> LEN | |||
LIT -> LEN | LIT -> LEN | |||
Process trailer: | Process trailer: | |||
CHECK -> LENGTH -> DONE | CHECK -> LENGTH -> DONE | |||
*/ | */ | |||
/* state maintained between inflate() calls. Approximately 7K bytes. */ | /* state maintained between inflate() calls. Approximately 10K bytes. */ | |||
struct inflate_state { | struct inflate_state { | |||
inflate_mode mode; /* current inflate mode */ | inflate_mode mode; /* current inflate mode */ | |||
int last; /* true if processing last block */ | int last; /* true if processing last block */ | |||
int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ | int wrap; /* bit 0 true for zlib, bit 1 true for gzip */ | |||
int havedict; /* true if dictionary provided */ | int havedict; /* true if dictionary provided */ | |||
int flags; /* gzip header method and flags (0 if zlib) */ | int flags; /* gzip header method and flags (0 if zlib) */ | |||
unsigned dmax; /* zlib header max distance (INFLATE_STRICT ) */ | unsigned dmax; /* zlib header max distance (INFLATE_STRICT ) */ | |||
unsigned long check; /* protected copy of check value */ | unsigned long check; /* protected copy of check value */ | |||
unsigned long total; /* protected copy of output count */ | unsigned long total; /* protected copy of output count */ | |||
gz_headerp head; /* where to save gzip header information */ | gz_headerp head; /* where to save gzip header information */ | |||
/* sliding window */ | /* sliding window */ | |||
unsigned wbits; /* log base 2 of requested window size */ | unsigned wbits; /* log base 2 of requested window size */ | |||
unsigned wsize; /* window size or zero if not using window */ | unsigned wsize; /* window size or zero if not using window */ | |||
unsigned whave; /* valid bytes in the window */ | unsigned whave; /* valid bytes in the window */ | |||
unsigned write; /* window write index */ | unsigned wnext; /* window write index */ | |||
unsigned char FAR *window; /* allocated sliding window, if needed */ | unsigned char FAR *window; /* allocated sliding window, if needed */ | |||
/* bit accumulator */ | /* bit accumulator */ | |||
unsigned long hold; /* input bit accumulator */ | unsigned long hold; /* input bit accumulator */ | |||
unsigned bits; /* number of bits in "in" */ | unsigned bits; /* number of bits in "in" */ | |||
/* for string and stored block copying */ | /* for string and stored block copying */ | |||
unsigned length; /* literal or length of data to copy */ | unsigned length; /* literal or length of data to copy */ | |||
unsigned offset; /* distance back to copy string from */ | unsigned offset; /* distance back to copy string from */ | |||
/* for table and code decoding */ | /* for table and code decoding */ | |||
unsigned extra; /* extra bits needed */ | unsigned extra; /* extra bits needed */ | |||
/* fixed and dynamic code tables */ | /* fixed and dynamic code tables */ | |||
skipping to change at line 115 | skipping to change at line 119 | |||
unsigned distbits; /* index bits for distcode */ | unsigned distbits; /* index bits for distcode */ | |||
/* dynamic table building */ | /* dynamic table building */ | |||
unsigned ncode; /* number of code length code lengths */ | unsigned ncode; /* number of code length code lengths */ | |||
unsigned nlen; /* number of length code lengths */ | unsigned nlen; /* number of length code lengths */ | |||
unsigned ndist; /* number of distance code lengths */ | unsigned ndist; /* number of distance code lengths */ | |||
unsigned have; /* number of code lengths in lens[] */ | unsigned have; /* number of code lengths in lens[] */ | |||
code FAR *next; /* next available space in codes[] */ | code FAR *next; /* next available space in codes[] */ | |||
unsigned short lens[320]; /* temporary storage for code lengths */ | unsigned short lens[320]; /* temporary storage for code lengths */ | |||
unsigned short work[288]; /* work area for code table building */ | unsigned short work[288]; /* work area for code table building */ | |||
code codes[ENOUGH]; /* space for code tables */ | code codes[ENOUGH]; /* space for code tables */ | |||
int sane; /* if false, allow invalid distance too far | ||||
*/ | ||||
int back; /* bits back of last unprocessed length/lit | ||||
*/ | ||||
unsigned was; /* initial length of match */ | ||||
}; | }; | |||
End of changes. 10 change blocks. | ||||
12 lines changed or deleted | 22 lines changed or added | |||
inftrees.h | inftrees.h | |||
---|---|---|---|---|
/* inftrees.h -- header to use inftrees.c | /* inftrees.h -- header to use inftrees.c | |||
* Copyright (C) 1995-2005 Mark Adler | * Copyright (C) 1995-2005, 2010 Mark Adler | |||
* For conditions of distribution and use, see copyright notice in zlib.h | * For conditions of distribution and use, see copyright notice in zlib.h | |||
*/ | */ | |||
/* WARNING: this file should *not* be used by applications. It is | /* WARNING: this file should *not* be used by applications. It is | |||
part of the implementation of the compression library and is | part of the implementation of the compression library and is | |||
subject to change. Applications should only use zlib.h. | subject to change. Applications should only use zlib.h. | |||
*/ | */ | |||
/* Structure for decoding tables. Each entry provides either the | /* Structure for decoding tables. Each entry provides either the | |||
information needed to do the operation requested by the code that | information needed to do the operation requested by the code that | |||
skipping to change at line 38 | skipping to change at line 38 | |||
} code; | } code; | |||
/* op values as set by inflate_table(): | /* op values as set by inflate_table(): | |||
00000000 - literal | 00000000 - literal | |||
0000tttt - table link, tttt != 0 is the number of table index bits | 0000tttt - table link, tttt != 0 is the number of table index bits | |||
0001eeee - length or distance, eeee is the number of extra bits | 0001eeee - length or distance, eeee is the number of extra bits | |||
01100000 - end of block | 01100000 - end of block | |||
01000000 - invalid code | 01000000 - invalid code | |||
*/ | */ | |||
/* Maximum size of dynamic tree. The maximum found in a long but non- | /* Maximum size of the dynamic table. The maximum number of code structure | |||
exhaustive search was 1444 code structures (852 for length/literals | s is | |||
and 592 for distances, the latter actually the result of an | 1444, which is the sum of 852 for literal/length codes and 592 for dista | |||
exhaustive search). The true maximum is not known, but the value | nce | |||
below is more than safe. */ | codes. These values were found by exhaustive searches using the program | |||
#define ENOUGH 2048 | examples/enough.c found in the zlib distribtution. The arguments to tha | |||
#define MAXD 592 | t | |||
program are the number of symbols, the initial root table size, and the | ||||
maximum bit length of a code. "enough 286 9 15" for literal/length code | ||||
s | ||||
returns returns 852, and "enough 30 6 15" for distance codes returns 592 | ||||
. | ||||
The initial root table size (9 or 6) is found in the fifth argument of t | ||||
he | ||||
inflate_table() calls in inflate.c and infback.c. If the root table siz | ||||
e is | ||||
changed, then these maximum sizes would be need to be recalculated and | ||||
updated. */ | ||||
#define ENOUGH_LENS 852 | ||||
#define ENOUGH_DISTS 592 | ||||
#define ENOUGH (ENOUGH_LENS+ENOUGH_DISTS) | ||||
/* Type of code to build for inftable() */ | /* Type of code to build for inflate_table() */ | |||
typedef enum { | typedef enum { | |||
CODES, | CODES, | |||
LENS, | LENS, | |||
DISTS | DISTS | |||
} codetype; | } codetype; | |||
extern int inflate_table OF((codetype type, unsigned short FAR *lens, | int ZLIB_INTERNAL inflate_table OF((codetype type, unsigned short FAR *lens , | |||
unsigned codes, code FAR * FAR *table, | unsigned codes, code FAR * FAR *table, | |||
unsigned FAR *bits, unsigned short FAR *work)) ; | unsigned FAR *bits, unsigned short FAR *work)) ; | |||
End of changes. 4 change blocks. | ||||
10 lines changed or deleted | 24 lines changed or added | |||
std_mfc.h | std_mfc.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
std_stl.h | std_stl.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
skipping to change at line 117 | skipping to change at line 117 | |||
#define _UI64_MAX ULONG_LONG_MAX | #define _UI64_MAX ULONG_LONG_MAX | |||
#else | #else | |||
#define _UI64_MAX ULONGLONG_MAX | #define _UI64_MAX ULONGLONG_MAX | |||
#endif | #endif | |||
#endif | #endif | |||
#define _lseeki64 lseek64 | #define _lseeki64 lseek64 | |||
#else | #else | |||
#include <TCHAR.H> | #include <TCHAR.H> | |||
#include <windows.h> | #include <windows.h> | |||
#include <stddef.h> | #include <stddef.h> | |||
#ifndef _I64_MAX | ||||
#include <limits.h> | ||||
#endif | ||||
#ifndef STRICT | #ifndef STRICT | |||
#define STRICT | #define STRICT | |||
#endif | #endif | |||
typedef BOOL ZBOOL; | typedef BOOL ZBOOL; | |||
#endif // #ifndef _WIN32 | #endif // #ifndef _WIN32 | |||
#ifndef ASSERT | #ifndef ASSERT | |||
#ifdef _DEBUG | #ifdef _DEBUG | |||
#include <assert.h> | #include <assert.h> | |||
End of changes. 2 change blocks. | ||||
1 lines changed or deleted | 4 lines changed or added | |||
stdafx.h | stdafx.h | |||
---|---|---|---|---|
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
// This source file is part of the ZipArchive library source distribution a nd | // This source file is part of the ZipArchive library source distribution a nd | |||
// is Copyrighted 2000 - 2009 by Artpol Software - Tadeusz Dracz | // is Copyrighted 2000 - 2010 by Artpol Software - Tadeusz Dracz | |||
// | // | |||
// This program is free software; you can redistribute it and/or | // This program is free software; you can redistribute it and/or | |||
// modify it under the terms of the GNU General Public License | // modify it under the terms of the GNU General Public License | |||
// as published by the Free Software Foundation; either version 2 | // as published by the Free Software Foundation; either version 2 | |||
// of the License, or (at your option) any later version. | // of the License, or (at your option) any later version. | |||
// | // | |||
// For the licensing details refer to the License.txt file. | // For the licensing details refer to the License.txt file. | |||
// | // | |||
// Web Site: http://www.artpol-software.com | // Web Site: http://www.artpol-software.com | |||
/////////////////////////////////////////////////////////////////////////// ///// | /////////////////////////////////////////////////////////////////////////// ///// | |||
End of changes. 1 change blocks. | ||||
1 lines changed or deleted | 1 lines changed or added | |||
trees.h | trees.h | |||
---|---|---|---|---|
skipping to change at line 73 | skipping to change at line 73 | |||
local const ct_data static_dtree[D_CODES] = { | local const ct_data static_dtree[D_CODES] = { | |||
{{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, | {{ 0},{ 5}}, {{16},{ 5}}, {{ 8},{ 5}}, {{24},{ 5}}, {{ 4},{ 5}}, | |||
{{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, | {{20},{ 5}}, {{12},{ 5}}, {{28},{ 5}}, {{ 2},{ 5}}, {{18},{ 5}}, | |||
{{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, | {{10},{ 5}}, {{26},{ 5}}, {{ 6},{ 5}}, {{22},{ 5}}, {{14},{ 5}}, | |||
{{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, | {{30},{ 5}}, {{ 1},{ 5}}, {{17},{ 5}}, {{ 9},{ 5}}, {{25},{ 5}}, | |||
{{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, | {{ 5},{ 5}}, {{21},{ 5}}, {{13},{ 5}}, {{29},{ 5}}, {{ 3},{ 5}}, | |||
{{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} | {{19},{ 5}}, {{11},{ 5}}, {{27},{ 5}}, {{ 7},{ 5}}, {{23},{ 5}} | |||
}; | }; | |||
const uch _dist_code[DIST_CODE_LEN] = { | const uch ZLIB_INTERNAL _dist_code[DIST_CODE_LEN] = { | |||
0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, | 0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, | |||
8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, | 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, | |||
10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, | 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, | |||
11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, | 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, | |||
12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, | 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, | |||
13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, | |||
13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | |||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | |||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, | |||
14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, | 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, | |||
skipping to change at line 102 | skipping to change at line 102 | |||
27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, | 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, | |||
27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | |||
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | |||
28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, | |||
28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, | 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, | |||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, | 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, | |||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, | 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, | |||
29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 | 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29 | |||
}; | }; | |||
const uch _length_code[MAX_MATCH-MIN_MATCH+1]= { | const uch ZLIB_INTERNAL _length_code[MAX_MATCH-MIN_MATCH+1]= { | |||
0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, | 0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, | |||
13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, | 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, | |||
17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, | 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, | |||
19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, | |||
21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, | 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, | |||
22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, | 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, | |||
23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, | 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, | |||
24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, | 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, | |||
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, | |||
25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, | 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added | |||
zconf.h | zconf.h | |||
---|---|---|---|---|
/* zconf.h -- configuration of the zlib compression library | /* zconf.h -- configuration of the zlib compression library | |||
* Copyright (C) 1995-2005 Jean-loup Gailly. | * Copyright (C) 1995-2010 Jean-loup Gailly. | |||
* For conditions of distribution and use, see copyright notice in zlib.h | * For conditions of distribution and use, see copyright notice in zlib.h | |||
*/ | */ | |||
/* @(#) $Id$ */ | /* @(#) $Id$ */ | |||
#ifndef ZCONF_H | #ifndef ZCONF_H | |||
#define ZCONF_H | #define ZCONF_H | |||
#if _MSC_VER > 1000 | #if _MSC_VER > 1000 | |||
#pragma warning (disable : 4131) | #pragma warning (disable : 4131) | |||
skipping to change at line 24 | skipping to change at line 24 | |||
#pragma warning (disable : 4127) | #pragma warning (disable : 4127) | |||
#pragma warning (disable : 4100) | #pragma warning (disable : 4100) | |||
#pragma warning (disable : 4244) | #pragma warning (disable : 4244) | |||
#pragma warning (disable : 4702) | #pragma warning (disable : 4702) | |||
#pragma warning (disable : 4206) | #pragma warning (disable : 4206) | |||
#endif | #endif | |||
/* | /* | |||
* If you *really* need a unique prefix for all types and library functions , | * If you *really* need a unique prefix for all types and library functions , | |||
* compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. | * compile with -DZ_PREFIX. The "standard" zlib should be compiled without it. | |||
* Even better than compiling with -DZ_PREFIX would be to use configure to | ||||
set | ||||
* this permanently in zconf.h using "./configure --zprefix". | ||||
*/ | */ | |||
#ifdef Z_PREFIX | #ifdef Z_PREFIX /* may be set to #if 1 by ./configure */ | |||
//# define deflateInit zarch_deflateInit | ||||
# define deflateInit_ zarch_deflateInit_ | /* all linked symbols */ | |||
# define deflate zarch_deflate | # define _dist_code zarch__dist_code | |||
# define deflateEnd zarch_deflateEnd | # define _length_code zarch__length_code | |||
//# define deflateInit2 zarch_deflateInit2 | # define _tr_align zarch__tr_align | |||
# define deflateInit2_ zarch_deflateInit2_ | # define _tr_flush_block zarch__tr_flush_block | |||
# define deflateSetDictionary zarch_deflateSetDictionary | # define _tr_init zarch__tr_init | |||
# define deflateCopy zarch_deflateCopy | # define _tr_stored_block zarch__tr_stored_block | |||
# define deflateReset zarch_deflateReset | # define _tr_tally zarch__tr_tally | |||
# define deflateParams zarch_deflateParams | # define adler32 zarch_adler32 | |||
# define deflateBound zarch_deflateBound | # define adler32_combine zarch_adler32_combine | |||
# define deflatePrime zarch_deflatePrime | # define adler32_combine64 zarch_adler32_combine64 | |||
# define deflateSetHeader zarch_deflateSetHeader | # define compress zarch_compress | |||
# define deflateTune zarch_deflateTune | # define compress2 zarch_compress2 | |||
//# define inflateInit zarch_inflateInit | # define compressBound zarch_compressBound | |||
//# define inflateInit2 zarch_inflateInit2 | # define crc32 zarch_crc32 | |||
# define inflateInit2_ zarch_inflateInit2_ | # define crc32_combine zarch_crc32_combine | |||
# define inflateInit_ zarch_inflateInit_ | # define crc32_combine64 zarch_crc32_combine64 | |||
# define inflate zarch_inflate | # define deflate zarch_deflate | |||
# define inflateEnd zarch_inflateEnd | # define deflateBound zarch_deflateBound | |||
# define inflateSetDictionary zarch_inflateSetDictionary | # define deflateCopy zarch_deflateCopy | |||
# define inflateSync zarch_inflateSync | # define deflateEnd zarch_deflateEnd | |||
# define inflateSyncPoint zarch_inflateSyncPoint | # define deflateInit2_ zarch_deflateInit2_ | |||
# define inflateCopy zarch_inflateCopy | # define deflateInit_ zarch_deflateInit_ | |||
# define inflateReset zarch_inflateReset | # define deflateParams zarch_deflateParams | |||
//# define inflateBackInit zarch_inflateBackInit | # define deflatePrime zarch_deflatePrime | |||
# define inflateBackInit_ zarch_inflateBackInit_ | # define deflateReset zarch_deflateReset | |||
# define inflateBack zarch_inflateBack | # define deflateSetDictionary zarch_deflateSetDictionary | |||
# define inflateBackEnd zarch_inflateBackEnd | # define deflateSetHeader zarch_deflateSetHeader | |||
# define inflatePrime zarch_inflatePrime | # define deflateTune zarch_deflateTune | |||
# define inflateGetHeader zarch_inflateGetHeader | # define deflate_copyright zarch_deflate_copyright | |||
# define compress zarch_compress | # define get_crc_table zarch_get_crc_table | |||
# define compress2 zarch_compress2 | # define gz_error zarch_gzarch_error | |||
# define compressBound zarch_compressBound | # define gz_intmax zarch_gzarch_intmax | |||
# define uncompress zarch_uncompress | # define gz_strwinerror zarch_gzarch_strwinerror | |||
# define adler32 zarch_adler32 | # define gzbuffer zarch_gzbuffer | |||
# define adler32_combine zarch_adler32_combine | # define gzclearerr zarch_gzclearerr | |||
# define crc32_combine zarch_crc32_combine | # define gzclose zarch_gzclose | |||
# define deflate_copyright zarch_deflate_copyright | # define gzclose_r zarch_gzclose_r | |||
# define inflate_copyright zarch_inflate_copyright | # define gzclose_w zarch_gzclose_w | |||
# define crc32 zarch_crc32 | # define gzdirect zarch_gzdirect | |||
# define get_crc_table zarch_get_crc_table | # define gzdopen zarch_gzdopen | |||
# define gzeof zarch_gzeof | ||||
# define gzerror zarch_gzerror | ||||
# define gzflush zarch_gzflush | ||||
# define gzgetc zarch_gzgetc | ||||
# define gzgets zarch_gzgets | ||||
# define gzoffset zarch_gzoffset | ||||
# define gzoffset64 zarch_gzoffset64 | ||||
# define gzopen zarch_gzopen | ||||
# define gzopen64 zarch_gzopen64 | ||||
# define gzprintf zarch_gzprintf | ||||
# define gzputc zarch_gzputc | ||||
# define gzputs zarch_gzputs | ||||
# define gzread zarch_gzread | ||||
# define gzrewind zarch_gzrewind | ||||
# define gzseek zarch_gzseek | ||||
# define gzseek64 zarch_gzseek64 | ||||
# define gzsetparams zarch_gzsetparams | ||||
# define gztell zarch_gztell | ||||
# define gztell64 zarch_gztell64 | ||||
# define gzungetc zarch_gzungetc | ||||
# define gzwrite zarch_gzwrite | ||||
# define inflate zarch_inflate | ||||
# define inflateBack zarch_inflateBack | ||||
# define inflateBackEnd zarch_inflateBackEnd | ||||
# define inflateBackInit_ zarch_inflateBackInit_ | ||||
# define inflateCopy zarch_inflateCopy | ||||
# define inflateEnd zarch_inflateEnd | ||||
# define inflateGetHeader zarch_inflateGetHeader | ||||
# define inflateInit2_ zarch_inflateInit2_ | ||||
# define inflateInit_ zarch_inflateInit_ | ||||
# define inflateMark zarch_inflateMark | ||||
# define inflatePrime zarch_inflatePrime | ||||
# define inflateReset zarch_inflateReset | ||||
# define inflateReset2 zarch_inflateReset2 | ||||
# define inflateSetDictionary zarch_inflateSetDictionary | ||||
# define inflateSync zarch_inflateSync | ||||
# define inflateSyncPoint zarch_inflateSyncPoint | ||||
# define inflateUndermine zarch_inflateUndermine | ||||
# define inflate_copyright zarch_inflate_copyright | ||||
# define inflate_fast zarch_inflate_fast | ||||
# define inflate_table zarch_inflate_table | ||||
# define uncompress zarch_uncompress | ||||
# define zError zarch_zError | ||||
# define zcalloc zarch_zcalloc | ||||
# define zcfree zarch_zcfree | ||||
# define zlibCompileFlags zarch_zlibCompileFlags | ||||
# define zlibVersion zarch_zlibVersion | ||||
# define zError zarch_zError | # define zError zarch_zError | |||
# define z_stream zarch_z_stream | # define z_stream zarch_z_stream | |||
# define z_stream_s zarch_z_stream_s | # define z_stream_s zarch_z_stream_s | |||
# define alloc_func zarch_alloc_func | # define alloc_func zarch_alloc_func | |||
# define free_func zarch_free_func | # define free_func zarch_free_func | |||
# define in_func zarch_in_func | # define in_func zarch_in_func | |||
# define out_func zarch_out_func | # define out_func zarch_out_func | |||
# define Byte zarch_Byte | # define Byte zarch_Byte | |||
# define uInt zarch_uInt | # define uInt zarch_uInt | |||
# define uLong zarch_uLong | # define uLong zarch_uLong | |||
skipping to change at line 93 | skipping to change at line 143 | |||
# define uLongf zarch_uLongf | # define uLongf zarch_uLongf | |||
# define voidpf zarch_voidpf | # define voidpf zarch_voidpf | |||
# define voidp zarch_voidp | # define voidp zarch_voidp | |||
# define deflate_state zarch_deflate_state | # define deflate_state zarch_deflate_state | |||
# define deflate_slow zarch_deflate_slow | # define deflate_slow zarch_deflate_slow | |||
# define deflate_fast zarch_deflate_fast | # define deflate_fast zarch_deflate_fast | |||
# define deflate_stored zarch_deflate_stored | # define deflate_stored zarch_deflate_stored | |||
# define z_streamp zarch_z_streamp | # define z_streamp zarch_z_streamp | |||
# define deflate_rle zarch_deflate_rle | # define deflate_rle zarch_deflate_rle | |||
# define inflate_state zarch_inflate_state | # define inflate_state zarch_inflate_state | |||
# define inflate_fast zarch_inflate_fast | ||||
# define inflate_table zarch_inflate_table | /* all zlib typedefs in zlib.h and zconf.h */ | |||
# define updatewindow zarch_updatewindow | # define Byte zarch_Byte | |||
//# define inflate_mode zarch_inflate_mode | # define Bytef zarch_Bytef | |||
//# define send_bits zarch_send_bits | # define alloc_func zarch_alloc_func | |||
# define zlibVersion zarch_zlibVersion | # define charf zarch_charf | |||
# define zlibCompileFlags zarch_zlibCompileFlags | # define free_func zarch_free_func | |||
# define zError zarch_zError | # define gzFile zarch_gzFile | |||
# define _tr_init zarch_tr_init | # define gz_header zarch_gzarch_header | |||
# define _tr_tally zarch_tr_tally | # define gz_headerp zarch_gzarch_headerp | |||
# define _tr_flush_block zarch_tr_flush_block | # define in_func zarch_in_func | |||
# define _tr_align zarch_tr_align | # define intf zarch_intf | |||
# define _tr_stored_block zarch_tr_stored_block | # define out_func zarch_out_func | |||
# define _dist_code zarch_dist_code | # define uInt zarch_uInt | |||
# define _length_code zarch_length_code | # define uIntf zarch_uIntf | |||
# define uLong zarch_uLong | ||||
# define uLongf zarch_uLongf | ||||
# define voidp zarch_voidp | ||||
# define voidpc zarch_voidpc | ||||
# define voidpf zarch_voidpf | ||||
/* all zlib structs in zlib.h and zconf.h */ | ||||
# define gz_header_s zarch_gzarch_header_s | ||||
# define internal_state zarch_internal_state | ||||
#endif | #endif | |||
#if defined(__MSDOS__) && !defined(MSDOS) | #if defined(__MSDOS__) && !defined(MSDOS) | |||
# define MSDOS | # define MSDOS | |||
#endif | #endif | |||
#if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) | #if (defined(OS_2) || defined(__OS2__)) && !defined(OS2) | |||
# define OS2 | # define OS2 | |||
#endif | #endif | |||
#if defined(_WINDOWS) && !defined(WINDOWS) | #if defined(_WINDOWS) && !defined(WINDOWS) | |||
# define WINDOWS | # define WINDOWS | |||
#endif | #endif | |||
#if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) | #if defined(_WIN32) || defined(_WIN32_WCE) || defined(__WIN32__) | |||
# ifndef WIN32 | # ifndef WIN32 | |||
# define WIN32 | # define WIN32 | |||
# endif | # endif | |||
#endif | #endif | |||
#if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) | #if (defined(MSDOS) || defined(OS2) || defined(WINDOWS)) && !defined(WIN32) | |||
# if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) | # if !defined(__GNUC__) && !defined(__FLAT__) && !defined(__386__) | |||
# ifndef SYS16BIT | # ifndef SYS16BIT | |||
# define SYS16BIT | # define SYS16BIT | |||
# endif | # endif | |||
# endif | # endif | |||
#endif | #endif | |||
skipping to change at line 339 | skipping to change at line 399 | |||
#ifdef STDC | #ifdef STDC | |||
typedef void const *voidpc; | typedef void const *voidpc; | |||
typedef void FAR *voidpf; | typedef void FAR *voidpf; | |||
typedef void *voidp; | typedef void *voidp; | |||
#else | #else | |||
typedef Byte const *voidpc; | typedef Byte const *voidpc; | |||
typedef Byte FAR *voidpf; | typedef Byte FAR *voidpf; | |||
typedef Byte *voidp; | typedef Byte *voidp; | |||
#endif | #endif | |||
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */ | #ifdef HAVE_UNISTD_H /* may be set to #if 1 by ./configure */ | |||
# include <sys/types.h> /* for off_t */ | # define Z_HAVE_UNISTD_H | |||
# include <unistd.h> /* for SEEK_* and off_t */ | #endif | |||
#ifdef STDC | ||||
# include <sys/types.h> /* for off_t */ | ||||
#endif | ||||
/* a little trick to accommodate both "#define _LARGEFILE64_SOURCE" and | ||||
* "#define _LARGEFILE64_SOURCE 1" as requesting 64-bit operations, (even | ||||
* though the former does not conform to the LFS document), but considering | ||||
* both "#undef _LARGEFILE64_SOURCE" and "#define _LARGEFILE64_SOURCE 0" as | ||||
* equivalently requesting no 64-bit operations | ||||
*/ | ||||
#if -_LARGEFILE64_SOURCE - -1 == 1 | ||||
# undef _LARGEFILE64_SOURCE | ||||
#endif | ||||
#if defined(Z_HAVE_UNISTD_H) || defined(_LARGEFILE64_SOURCE) | ||||
# include <unistd.h> /* for SEEK_* and off_t */ | ||||
# ifdef VMS | # ifdef VMS | |||
# include <unixio.h> /* for off_t */ | # include <unixio.h> /* for off_t */ | |||
# endif | # endif | |||
# ifndef z_off_t | ||||
# define z_off_t off_t | # define z_off_t off_t | |||
# endif | ||||
#endif | #endif | |||
#ifndef SEEK_SET | #ifndef SEEK_SET | |||
# define SEEK_SET 0 /* Seek from beginning of file. */ | # define SEEK_SET 0 /* Seek from beginning of file. */ | |||
# define SEEK_CUR 1 /* Seek from current position. */ | # define SEEK_CUR 1 /* Seek from current position. */ | |||
# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ | # define SEEK_END 2 /* Set file pointer to EOF plus "offset" */ | |||
#endif | #endif | |||
#ifndef z_off_t | #ifndef z_off_t | |||
# define z_off_t long | # define z_off_t long | |||
#endif | #endif | |||
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 | ||||
# define z_off64_t off64_t | ||||
#else | ||||
# define z_off64_t z_off_t | ||||
#endif | ||||
#if defined(__OS400__) | #if defined(__OS400__) | |||
#define NO_vsnprintf | # define NO_vsnprintf | |||
#endif | #endif | |||
#if defined(__MVS__) | #if defined(__MVS__) | |||
# define NO_vsnprintf | # define NO_vsnprintf | |||
# ifdef FAR | ||||
# undef FAR | ||||
# endif | ||||
#endif | #endif | |||
/* MVS linker does not support external names larger than 8 bytes */ | /* MVS linker does not support external names larger than 8 bytes */ | |||
#if defined(__MVS__) | #if defined(__MVS__) | |||
# pragma map(deflateInit_,"DEIN") | #pragma map(deflateInit_,"DEIN") | |||
# pragma map(deflateInit2_,"DEIN2") | #pragma map(deflateInit2_,"DEIN2") | |||
# pragma map(deflateEnd,"DEEND") | #pragma map(deflateEnd,"DEEND") | |||
# pragma map(deflateBound,"DEBND") | #pragma map(deflateBound,"DEBND") | |||
# pragma map(inflateInit_,"ININ") | #pragma map(inflateInit_,"ININ") | |||
# pragma map(inflateInit2_,"ININ2") | #pragma map(inflateInit2_,"ININ2") | |||
# pragma map(inflateEnd,"INEND") | #pragma map(inflateEnd,"INEND") | |||
# pragma map(inflateSync,"INSY") | #pragma map(inflateSync,"INSY") | |||
# pragma map(inflateSetDictionary,"INSEDI") | #pragma map(inflateSetDictionary,"INSEDI") | |||
# pragma map(compressBound,"CMBND") | #pragma map(compressBound,"CMBND") | |||
# pragma map(inflate_table,"INTABL") | #pragma map(inflate_table,"INTABL") | |||
# pragma map(inflate_fast,"INFA") | #pragma map(inflate_fast,"INFA") | |||
# pragma map(inflate_copyright,"INCOPY") | #pragma map(inflate_copyright,"INCOPY") | |||
#endif | #endif | |||
#endif /* ZCONF_H */ | #endif /* ZCONF_H */ | |||
End of changes. 15 change blocks. | ||||
81 lines changed or deleted | 166 lines changed or added | |||
zlib.h | zlib.h | |||
---|---|---|---|---|
/* zlib.h -- interface of the 'zlib' general purpose compression library | /* zlib.h -- interface of the 'zlib' general purpose compression library | |||
version 1.2.3, July 18th, 2005 | version 1.2.5, April 19th, 2010 | |||
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler | Copyright (C) 1995-2010 Jean-loup Gailly and Mark Adler | |||
This software is provided 'as-is', without any express or implied | This software is provided 'as-is', without any express or implied | |||
warranty. In no event will the authors be held liable for any damages | warranty. In no event will the authors be held liable for any damages | |||
arising from the use of this software. | arising from the use of this software. | |||
Permission is granted to anyone to use this software for any purpose, | Permission is granted to anyone to use this software for any purpose, | |||
including commercial applications, and to alter it and redistribute it | including commercial applications, and to alter it and redistribute it | |||
freely, subject to the following restrictions: | freely, subject to the following restrictions: | |||
1. The origin of this software must not be misrepresented; you must not | 1. The origin of this software must not be misrepresented; you must not | |||
skipping to change at line 43 | skipping to change at line 43 | |||
#define Z_PREFIX 1 | #define Z_PREFIX 1 | |||
#define NO_GZIP 1 | #define NO_GZIP 1 | |||
#define NO_DUMMY_DECL 1 | #define NO_DUMMY_DECL 1 | |||
#include "zconf.h" | #include "zconf.h" | |||
#ifdef __cplusplus | #ifdef __cplusplus | |||
extern "C" { | extern "C" { | |||
#endif | #endif | |||
#define ZLIB_VERSION "1.2.3" | #define ZLIB_VERSION "1.2.5" | |||
#define ZLIB_VERNUM 0x1230 | #define ZLIB_VERNUM 0x1250 | |||
#define ZLIB_VER_MAJOR 1 | ||||
#define ZLIB_VER_MINOR 2 | ||||
#define ZLIB_VER_REVISION 5 | ||||
#define ZLIB_VER_SUBREVISION 0 | ||||
#define PKZIP_BUG_WORKAROUND 1 | #define PKZIP_BUG_WORKAROUND 1 | |||
/* | /* | |||
The 'zlib' compression library provides in-memory compression and | The 'zlib' compression library provides in-memory compression and | |||
decompression functions, including integrity checks of the uncompressed | decompression functions, including integrity checks of the uncompressed d | |||
data. This version of the library supports only one compression method | ata. | |||
(deflation) but other algorithms will be added later and will have the sa | This version of the library supports only one compression method (deflati | |||
me | on) | |||
stream interface. | but other algorithms will be added later and will have the same stream | |||
interface. | ||||
Compression can be done in a single step if the buffers are large | Compression can be done in a single step if the buffers are large enoug | |||
enough (for example if an input file is mmap'ed), or can be done by | h, | |||
repeated calls of the compression function. In the latter case, the | or can be done by repeated calls of the compression function. In the lat | |||
application must provide more input and/or consume the output | ter | |||
case, the application must provide more input and/or consume the output | ||||
(providing more output space) before each call. | (providing more output space) before each call. | |||
The compressed data format used by default by the in-memory functions is | The compressed data format used by default by the in-memory functions i s | |||
the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped | the zlib format, which is a zlib wrapper documented in RFC 1950, wrapped | |||
around a deflate stream, which is itself documented in RFC 1951. | around a deflate stream, which is itself documented in RFC 1951. | |||
The library also supports reading and writing files in gzip (.gz) form at | The library also supports reading and writing files in gzip (.gz) forma t | |||
with an interface similar to that of stdio using the functions that start | with an interface similar to that of stdio using the functions that start | |||
with "gz". The gzip format is different from the zlib format. gzip is a | with "gz". The gzip format is different from the zlib format. gzip is a | |||
gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. | gzip wrapper, documented in RFC 1952, wrapped around a deflate stream. | |||
This library can optionally read and write gzip streams in memory as w ell. | This library can optionally read and write gzip streams in memory as we ll. | |||
The zlib format was designed to be compact and fast for use in memory | The zlib format was designed to be compact and fast for use in memory | |||
and on communications channels. The gzip format was designed for single- | and on communications channels. The gzip format was designed for single- | |||
file compression on file systems, has a larger header than zlib to mainta in | file compression on file systems, has a larger header than zlib to mainta in | |||
directory information, and uses a different, slower check method than zli b. | directory information, and uses a different, slower check method than zli b. | |||
The library does not install any signal handler. The decoder checks | The library does not install any signal handler. The decoder checks | |||
the consistency of the compressed data, so the library should never | the consistency of the compressed data, so the library should never crash | |||
crash even in case of corrupted input. | even in case of corrupted input. | |||
*/ | */ | |||
typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); | typedef voidpf (*alloc_func) OF((voidpf opaque, uInt items, uInt size)); | |||
typedef void (*free_func) OF((voidpf opaque, voidpf address)); | typedef void (*free_func) OF((voidpf opaque, voidpf address)); | |||
//struct internal_state; | struct internal_state; | |||
typedef struct z_stream_s { | typedef struct z_stream_s { | |||
Bytef *next_in; /* next input byte */ | Bytef *next_in; /* next input byte */ | |||
uInt avail_in; /* number of bytes available at next_in */ | uInt avail_in; /* number of bytes available at next_in */ | |||
uLongLong total_in; /* total nb of input bytes read so far */ | uLongLong total_in; /* total nb of input bytes read so far */ | |||
Bytef *next_out; /* next output byte should be put there */ | Bytef *next_out; /* next output byte should be put there */ | |||
uInt avail_out; /* remaining free space at next_out */ | uInt avail_out; /* remaining free space at next_out */ | |||
uLongLong total_out; /* total nb of bytes output so far */ | uLongLong total_out; /* total nb of bytes output so far */ | |||
skipping to change at line 133 | skipping to change at line 135 | |||
Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ | Bytef *comment; /* pointer to zero-terminated comment or Z_NULL */ | |||
uInt comm_max; /* space at comment (only when reading header) */ | uInt comm_max; /* space at comment (only when reading header) */ | |||
int hcrc; /* true if there was or will be a header crc */ | int hcrc; /* true if there was or will be a header crc */ | |||
int done; /* true when done reading gzip header (not used | int done; /* true when done reading gzip header (not used | |||
when writing a gzip file) */ | when writing a gzip file) */ | |||
} gz_header; | } gz_header; | |||
typedef gz_header FAR *gz_headerp; | typedef gz_header FAR *gz_headerp; | |||
/* | /* | |||
The application must update next_in and avail_in when avail_in has | The application must update next_in and avail_in when avail_in has dro | |||
dropped to zero. It must update next_out and avail_out when avail_out | pped | |||
has dropped to zero. The application must initialize zalloc, zfree and | to zero. It must update next_out and avail_out when avail_out has dropp | |||
opaque before calling the init function. All other fields are set by the | ed | |||
compression library and must not be updated by the application. | to zero. The application must initialize zalloc, zfree and opaque befor | |||
e | ||||
calling the init function. All other fields are set by the compression | ||||
library and must not be updated by the application. | ||||
The opaque value provided by the application will be passed as the first | The opaque value provided by the application will be passed as the fir | |||
parameter for calls of zalloc and zfree. This can be useful for custom | st | |||
memory management. The compression library attaches no meaning to the | parameter for calls of zalloc and zfree. This can be useful for custom | |||
memory management. The compression library attaches no meaning to the | ||||
opaque value. | opaque value. | |||
zalloc must return Z_NULL if there is not enough memory for the object. | zalloc must return Z_NULL if there is not enough memory for the object . | |||
If zlib is used in a multi-threaded application, zalloc and zfree must b e | If zlib is used in a multi-threaded application, zalloc and zfree must b e | |||
thread safe. | thread safe. | |||
On 16-bit systems, the functions zalloc and zfree must be able to alloca | On 16-bit systems, the functions zalloc and zfree must be able to allo | |||
te | cate | |||
exactly 65536 bytes, but will not be required to allocate more than this | exactly 65536 bytes, but will not be required to allocate more than this | |||
if the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, | if | |||
pointers returned by zalloc for objects of exactly 65536 bytes *must* | the symbol MAXSEG_64K is defined (see zconf.h). WARNING: On MSDOS, poin | |||
have their offset normalized to zero. The default allocation function | ters | |||
provided by this library ensures this (see zutil.c). To reduce memory | returned by zalloc for objects of exactly 65536 bytes *must* have their | |||
requirements and avoid any allocation of 64K objects, at the expense of | offset normalized to zero. The default allocation function provided by | |||
compression ratio, compile the library with -DMAX_WBITS=14 (see zconf.h) | this | |||
. | library ensures this (see zutil.c). To reduce memory requirements and a | |||
void | ||||
any allocation of 64K objects, at the expense of compression ratio, comp | ||||
ile | ||||
the library with -DMAX_WBITS=14 (see zconf.h). | ||||
The fields total_in and total_out can be used for statistics or | The fields total_in and total_out can be used for statistics or progre | |||
progress reports. After compression, total_in holds the total size of | ss | |||
the uncompressed data and may be saved for use in the decompressor | reports. After compression, total_in holds the total size of the | |||
(particularly if the decompressor wants to decompress everything in | uncompressed data and may be saved for use in the decompressor (particul | |||
a single step). | arly | |||
if the decompressor wants to decompress everything in a single step). | ||||
*/ | */ | |||
/* constants */ | /* constants */ | |||
#define Z_NO_FLUSH 0 | #define Z_NO_FLUSH 0 | |||
#define Z_PARTIAL_FLUSH 1 /* will be removed, use Z_SYNC_FLUSH instead */ | #define Z_PARTIAL_FLUSH 1 | |||
#define Z_SYNC_FLUSH 2 | #define Z_SYNC_FLUSH 2 | |||
#define Z_FULL_FLUSH 3 | #define Z_FULL_FLUSH 3 | |||
#define Z_FINISH 4 | #define Z_FINISH 4 | |||
#define Z_BLOCK 5 | #define Z_BLOCK 5 | |||
#define Z_TREES 6 | ||||
/* Allowed flush values; see deflate() and inflate() below for details */ | /* Allowed flush values; see deflate() and inflate() below for details */ | |||
#define Z_OK 0 | #define Z_OK 0 | |||
#define Z_STREAM_END 1 | #define Z_STREAM_END 1 | |||
#define Z_NEED_DICT 2 | #define Z_NEED_DICT 2 | |||
#define Z_ERRNO (-1) | #define Z_ERRNO (-1) | |||
#define Z_STREAM_ERROR (-2) | #define Z_STREAM_ERROR (-2) | |||
#define Z_DATA_ERROR (-3) | #define Z_DATA_ERROR (-3) | |||
#define Z_MEM_ERROR (-4) | #define Z_MEM_ERROR (-4) | |||
#define Z_BUF_ERROR (-5) | #define Z_BUF_ERROR (-5) | |||
#define Z_VERSION_ERROR (-6) | #define Z_VERSION_ERROR (-6) | |||
/* Return codes for the compression/decompression functions. Negative | /* Return codes for the compression/decompression functions. Negative value | |||
* values are errors, positive values are used for special but normal event | s | |||
s. | * are errors, positive values are used for special but normal events. | |||
*/ | */ | |||
#define Z_NO_COMPRESSION 0 | #define Z_NO_COMPRESSION 0 | |||
#define Z_BEST_SPEED 1 | #define Z_BEST_SPEED 1 | |||
#define Z_BEST_COMPRESSION 9 | #define Z_BEST_COMPRESSION 9 | |||
#define Z_DEFAULT_COMPRESSION (-1) | #define Z_DEFAULT_COMPRESSION (-1) | |||
/* compression levels */ | /* compression levels */ | |||
#define Z_FILTERED 1 | #define Z_FILTERED 1 | |||
#define Z_HUFFMAN_ONLY 2 | #define Z_HUFFMAN_ONLY 2 | |||
skipping to change at line 218 | skipping to change at line 220 | |||
#define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ | #define Z_NULL 0 /* for initializing zalloc, zfree, opaque */ | |||
#define zlib_version zlibVersion() | #define zlib_version zlibVersion() | |||
/* for compatibility with versions < 1.0.2 */ | /* for compatibility with versions < 1.0.2 */ | |||
/* basic functions */ | /* basic functions */ | |||
ZEXTERN const char * ZEXPORT zlibVersion OF((void)); | ZEXTERN const char * ZEXPORT zlibVersion OF((void)); | |||
/* The application can compare zlibVersion and ZLIB_VERSION for consistency . | /* The application can compare zlibVersion and ZLIB_VERSION for consistency . | |||
If the first character differs, the library code actually used is | If the first character differs, the library code actually used is not | |||
not compatible with the zlib.h header file used by the application. | compatible with the zlib.h header file used by the application. This ch | |||
This check is automatically made by deflateInit and inflateInit. | eck | |||
is automatically made by deflateInit and inflateInit. | ||||
*/ | */ | |||
/* | /* | |||
ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); | ZEXTERN int ZEXPORT deflateInit OF((z_streamp strm, int level)); | |||
Initializes the internal stream state for compression. The fields | Initializes the internal stream state for compression. The fields | |||
zalloc, zfree and opaque must be initialized before by the caller. | zalloc, zfree and opaque must be initialized before by the caller. If | |||
If zalloc and zfree are set to Z_NULL, deflateInit updates them to | zalloc and zfree are set to Z_NULL, deflateInit updates them to use defa | |||
use default allocation functions. | ult | |||
allocation functions. | ||||
The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: | The compression level must be Z_DEFAULT_COMPRESSION, or between 0 and 9: | |||
1 gives best speed, 9 gives best compression, 0 gives no compression at | 1 gives best speed, 9 gives best compression, 0 gives no compression at | |||
all (the input data is simply copied a block at a time). | all | |||
Z_DEFAULT_COMPRESSION requests a default compromise between speed and | (the input data is simply copied a block at a time). Z_DEFAULT_COMPRESS | |||
compression (currently equivalent to level 6). | ION | |||
requests a default compromise between speed and compression (currently | ||||
equivalent to level 6). | ||||
deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not | deflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enou | |||
enough memory, Z_STREAM_ERROR if level is not a valid compression level, | gh | |||
memory, Z_STREAM_ERROR if level is not a valid compression level, or | ||||
Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatib le | Z_VERSION_ERROR if the zlib library version (zlib_version) is incompatib le | |||
with the version assumed by the caller (ZLIB_VERSION). | with the version assumed by the caller (ZLIB_VERSION). msg is set to nu | |||
msg is set to null if there is no error message. deflateInit does not | ll | |||
perform any compression: this will be done by deflate(). | if there is no error message. deflateInit does not perform any compress | |||
ion: | ||||
this will be done by deflate(). | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); | ZEXTERN int ZEXPORT deflate OF((z_streamp strm, int flush)); | |||
/* | /* | |||
deflate compresses as much data as possible, and stops when the input | deflate compresses as much data as possible, and stops when the input | |||
buffer becomes empty or the output buffer becomes full. It may introduce | buffer becomes empty or the output buffer becomes full. It may introduce | |||
some | some output latency (reading input without producing any output) except w | |||
output latency (reading input without producing any output) except when | hen | |||
forced to flush. | forced to flush. | |||
The detailed semantics are as follows. deflate performs one or both of the | The detailed semantics are as follows. deflate performs one or both of the | |||
following actions: | following actions: | |||
- Compress more input starting at next_in and update next_in and avail_in | - Compress more input starting at next_in and update next_in and avail_in | |||
accordingly. If not all input can be processed (because there is not | accordingly. If not all input can be processed (because there is not | |||
enough room in the output buffer), next_in and avail_in are updated and | enough room in the output buffer), next_in and avail_in are updated and | |||
processing will resume at this point for the next call of deflate(). | processing will resume at this point for the next call of deflate(). | |||
- Provide more output starting at next_out and update next_out and avail_ out | - Provide more output starting at next_out and update next_out and avail_ out | |||
accordingly. This action is forced if the parameter flush is non zero. | accordingly. This action is forced if the parameter flush is non zero. | |||
Forcing flush frequently degrades the compression ratio, so this parame ter | Forcing flush frequently degrades the compression ratio, so this parame ter | |||
should be set only when necessary (in interactive applications). | should be set only when necessary (in interactive applications). Some | |||
Some output may be provided even if flush is not set. | output may be provided even if flush is not set. | |||
Before the call of deflate(), the application should ensure that at least | Before the call of deflate(), the application should ensure that at lea | |||
one of the actions is possible, by providing more input and/or consuming | st | |||
more output, and updating avail_in or avail_out accordingly; avail_out | one of the actions is possible, by providing more input and/or consuming | |||
should never be zero before the call. The application can consume the | more | |||
compressed output when it wants, for example when the output buffer is fu | output, and updating avail_in or avail_out accordingly; avail_out should | |||
ll | never be zero before the call. The application can consume the compresse | |||
(avail_out == 0), or after each call of deflate(). If deflate returns Z_O | d | |||
K | output when it wants, for example when the output buffer is full (avail_o | |||
and with zero avail_out, it must be called again after making room in the | ut | |||
output buffer because there might be more output pending. | == 0), or after each call of deflate(). If deflate returns Z_OK and with | |||
zero avail_out, it must be called again after making room in the output | ||||
buffer because there might be more output pending. | ||||
Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to | Normally the parameter flush is set to Z_NO_FLUSH, which allows deflate to | |||
decide how much data to accumualte before producing output, in order to | decide how much data to accumulate before producing output, in order to | |||
maximize compression. | maximize compression. | |||
If the parameter flush is set to Z_SYNC_FLUSH, all pending output is | If the parameter flush is set to Z_SYNC_FLUSH, all pending output is | |||
flushed to the output buffer and the output is aligned on a byte boundary , so | flushed to the output buffer and the output is aligned on a byte boundary , so | |||
that the decompressor can get all input data available so far. (In partic | that the decompressor can get all input data available so far. (In | |||
ular | particular avail_in is zero after the call if enough output space has bee | |||
avail_in is zero after the call if enough output space has been provided | n | |||
before the call.) Flushing may degrade compression for some compression | provided before the call.) Flushing may degrade compression for some | |||
algorithms and so it should be used only when necessary. | compression algorithms and so it should be used only when necessary. Thi | |||
s | ||||
completes the current deflate block and follows it with an empty stored b | ||||
lock | ||||
that is three bits plus filler bits to the next byte, followed by four by | ||||
tes | ||||
(00 00 ff ff). | ||||
If flush is set to Z_PARTIAL_FLUSH, all pending output is flushed to th | ||||
e | ||||
output buffer, but the output is not aligned to a byte boundary. All of | ||||
the | ||||
input data so far will be available to the decompressor, as for Z_SYNC_FL | ||||
USH. | ||||
This completes the current deflate block and follows it with an empty fix | ||||
ed | ||||
codes block that is 10 bits long. This assures that enough bytes are out | ||||
put | ||||
in order for the decompressor to finish the block before the empty fixed | ||||
code | ||||
block. | ||||
If flush is set to Z_BLOCK, a deflate block is completed and emitted, a | ||||
s | ||||
for Z_SYNC_FLUSH, but the output is not aligned on a byte boundary, and u | ||||
p to | ||||
seven bits of the current block are held to be written as the next byte a | ||||
fter | ||||
the next deflate block is completed. In this case, the decompressor may | ||||
not | ||||
be provided enough bits at this point in order to complete decompression | ||||
of | ||||
the data provided so far to the compressor. It may need to wait for the | ||||
next | ||||
block to be emitted. This is for advanced applications that need to cont | ||||
rol | ||||
the emission of deflate blocks. | ||||
If flush is set to Z_FULL_FLUSH, all output is flushed as with | If flush is set to Z_FULL_FLUSH, all output is flushed as with | |||
Z_SYNC_FLUSH, and the compression state is reset so that decompression ca n | Z_SYNC_FLUSH, and the compression state is reset so that decompression ca n | |||
restart from this point if previous compressed data has been damaged or i f | restart from this point if previous compressed data has been damaged or i f | |||
random access is desired. Using Z_FULL_FLUSH too often can seriously degr ade | random access is desired. Using Z_FULL_FLUSH too often can seriously deg rade | |||
compression. | compression. | |||
If deflate returns with avail_out == 0, this function must be called ag ain | If deflate returns with avail_out == 0, this function must be called ag ain | |||
with the same value of the flush parameter and more output space (updated | with the same value of the flush parameter and more output space (updated | |||
avail_out), until the flush is complete (deflate returns with non-zero | avail_out), until the flush is complete (deflate returns with non-zero | |||
avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure that | avail_out). In the case of a Z_FULL_FLUSH or Z_SYNC_FLUSH, make sure tha t | |||
avail_out is greater than six to avoid repeated flush markers due to | avail_out is greater than six to avoid repeated flush markers due to | |||
avail_out == 0 on return. | avail_out == 0 on return. | |||
If the parameter flush is set to Z_FINISH, pending input is processed, | If the parameter flush is set to Z_FINISH, pending input is processed, | |||
pending output is flushed and deflate returns with Z_STREAM_END if there | pending output is flushed and deflate returns with Z_STREAM_END if there | |||
was enough output space; if deflate returns with Z_OK, this function must | was | |||
be | enough output space; if deflate returns with Z_OK, this function must be | |||
called again with Z_FINISH and more output space (updated avail_out) but no | called again with Z_FINISH and more output space (updated avail_out) but no | |||
more input data, until it returns with Z_STREAM_END or an error. After | more input data, until it returns with Z_STREAM_END or an error. After | |||
deflate has returned Z_STREAM_END, the only possible operations on the | deflate has returned Z_STREAM_END, the only possible operations on the st | |||
stream are deflateReset or deflateEnd. | ream | |||
are deflateReset or deflateEnd. | ||||
Z_FINISH can be used immediately after deflateInit if all the compressi on | Z_FINISH can be used immediately after deflateInit if all the compressi on | |||
is to be done in a single step. In this case, avail_out must be at least | is to be done in a single step. In this case, avail_out must be at least | |||
the value returned by deflateBound (see below). If deflate does not retur | the | |||
n | value returned by deflateBound (see below). If deflate does not return | |||
Z_STREAM_END, then it must be called again as described above. | Z_STREAM_END, then it must be called again as described above. | |||
deflate() sets strm->adler to the adler32 checksum of all input read | deflate() sets strm->adler to the adler32 checksum of all input read | |||
so far (that is, total_in bytes). | so far (that is, total_in bytes). | |||
deflate() may update strm->data_type if it can make a good guess about | deflate() may update strm->data_type if it can make a good guess about | |||
the input data type (Z_BINARY or Z_TEXT). In doubt, the data is considere | the input data type (Z_BINARY or Z_TEXT). In doubt, the data is consider | |||
d | ed | |||
binary. This field is only for information purposes and does not affect | binary. This field is only for information purposes and does not affect | |||
the compression algorithm in any manner. | the | |||
compression algorithm in any manner. | ||||
deflate() returns Z_OK if some progress has been made (more input | deflate() returns Z_OK if some progress has been made (more input | |||
processed or more output produced), Z_STREAM_END if all input has been | processed or more output produced), Z_STREAM_END if all input has been | |||
consumed and all output has been produced (only when flush is set to | consumed and all output has been produced (only when flush is set to | |||
Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for examp le | Z_FINISH), Z_STREAM_ERROR if the stream state was inconsistent (for examp le | |||
if next_in or next_out was NULL), Z_BUF_ERROR if no progress is possible | if next_in or next_out was Z_NULL), Z_BUF_ERROR if no progress is possibl | |||
(for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is no | e | |||
t | (for example avail_in or avail_out was zero). Note that Z_BUF_ERROR is n | |||
ot | ||||
fatal, and deflate() can be called again with more input and more output | fatal, and deflate() can be called again with more input and more output | |||
space to continue compressing. | space to continue compressing. | |||
*/ | */ | |||
ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); | ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); | |||
/* | /* | |||
All dynamically allocated data structures for this stream are freed. | All dynamically allocated data structures for this stream are freed. | |||
This function discards any unprocessed input and does not flush any | This function discards any unprocessed input and does not flush any pend | |||
pending output. | ing | |||
output. | ||||
deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the | deflateEnd returns Z_OK if success, Z_STREAM_ERROR if the | |||
stream state was inconsistent, Z_DATA_ERROR if the stream was freed | stream state was inconsistent, Z_DATA_ERROR if the stream was freed | |||
prematurely (some input or output was discarded). In the error case, | prematurely (some input or output was discarded). In the error case, ms | |||
msg may be set but then points to a static string (which must not be | g | |||
may be set but then points to a static string (which must not be | ||||
deallocated). | deallocated). | |||
*/ | */ | |||
/* | /* | |||
ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); | ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); | |||
Initializes the internal stream state for decompression. The fields | Initializes the internal stream state for decompression. The fields | |||
next_in, avail_in, zalloc, zfree and opaque must be initialized before b y | next_in, avail_in, zalloc, zfree and opaque must be initialized before b y | |||
the caller. If next_in is not Z_NULL and avail_in is large enough (the e | the caller. If next_in is not Z_NULL and avail_in is large enough (the | |||
xact | exact value depends on the compression method), inflateInit determines t | |||
value depends on the compression method), inflateInit determines the | he | |||
compression method from the zlib header and allocates all data structure s | compression method from the zlib header and allocates all data structure s | |||
accordingly; otherwise the allocation will be deferred to the first call of | accordingly; otherwise the allocation will be deferred to the first call of | |||
inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates the m to | inflate. If zalloc and zfree are set to Z_NULL, inflateInit updates the m to | |||
use default allocation functions. | use default allocation functions. | |||
inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enou gh | inflateInit returns Z_OK if success, Z_MEM_ERROR if there was not enou gh | |||
memory, Z_VERSION_ERROR if the zlib library version is incompatible with the | memory, Z_VERSION_ERROR if the zlib library version is incompatible with the | |||
version assumed by the caller. msg is set to null if there is no error | version assumed by the caller, or Z_STREAM_ERROR if the parameters are | |||
message. inflateInit does not perform any decompression apart from readi | invalid, such as a null pointer to the structure. msg is set to null if | |||
ng | there is no error message. inflateInit does not perform any decompressi | |||
the zlib header if present: this will be done by inflate(). (So next_in | on | |||
and | apart from possibly reading the zlib header if present: actual decompres | |||
avail_in may be modified, but next_out and avail_out are unchanged.) | sion | |||
will be done by inflate(). (So next_in and avail_in may be modified, bu | ||||
t | ||||
next_out and avail_out are unused and unchanged.) The current implementa | ||||
tion | ||||
of inflateInit() does not process any header information -- that is defe | ||||
rred | ||||
until inflate() is called. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); | ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); | |||
/* | /* | |||
inflate decompresses as much data as possible, and stops when the input | inflate decompresses as much data as possible, and stops when the input | |||
buffer becomes empty or the output buffer becomes full. It may introduce | buffer becomes empty or the output buffer becomes full. It may introduce | |||
some output latency (reading input without producing any output) except w hen | some output latency (reading input without producing any output) except w hen | |||
forced to flush. | forced to flush. | |||
The detailed semantics are as follows. inflate performs one or both of th e | The detailed semantics are as follows. inflate performs one or both of t he | |||
following actions: | following actions: | |||
- Decompress more input starting at next_in and update next_in and avail_ in | - Decompress more input starting at next_in and update next_in and avail_ in | |||
accordingly. If not all input can be processed (because there is not | accordingly. If not all input can be processed (because there is not | |||
enough room in the output buffer), next_in is updated and processing | enough room in the output buffer), next_in is updated and processing wi | |||
will resume at this point for the next call of inflate(). | ll | |||
resume at this point for the next call of inflate(). | ||||
- Provide more output starting at next_out and update next_out and avail_ out | - Provide more output starting at next_out and update next_out and avail_ out | |||
accordingly. inflate() provides as much output as possible, until ther | accordingly. inflate() provides as much output as possible, until ther | |||
e | e is | |||
is no more input data or no more space in the output buffer (see below | no more input data or no more space in the output buffer (see below abo | |||
about the flush parameter). | ut | |||
the flush parameter). | ||||
Before the call of inflate(), the application should ensure that at least | Before the call of inflate(), the application should ensure that at lea | |||
one of the actions is possible, by providing more input and/or consuming | st | |||
more output, and updating the next_* and avail_* values accordingly. | one of the actions is possible, by providing more input and/or consuming | |||
The application can consume the uncompressed output when it wants, for | more | |||
example when the output buffer is full (avail_out == 0), or after each | output, and updating the next_* and avail_* values accordingly. The | |||
call of inflate(). If inflate returns Z_OK and with zero avail_out, it | application can consume the uncompressed output when it wants, for exampl | |||
must be called again after making room in the output buffer because there | e | |||
might be more output pending. | when the output buffer is full (avail_out == 0), or after each call of | |||
inflate(). If inflate returns Z_OK and with zero avail_out, it must be | ||||
called again after making room in the output buffer because there might b | ||||
e | ||||
more output pending. | ||||
The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, | The flush parameter of inflate() can be Z_NO_FLUSH, Z_SYNC_FLUSH, Z_FIN | |||
Z_FINISH, or Z_BLOCK. Z_SYNC_FLUSH requests that inflate() flush as much | ISH, | |||
output as possible to the output buffer. Z_BLOCK requests that inflate() | Z_BLOCK, or Z_TREES. Z_SYNC_FLUSH requests that inflate() flush as much | |||
stop | output as possible to the output buffer. Z_BLOCK requests that inflate() | |||
if and when it gets to the next deflate block boundary. When decoding the | stop if and when it gets to the next deflate block boundary. When decodi | |||
zlib or gzip format, this will cause inflate() to return immediately afte | ng | |||
r | the zlib or gzip format, this will cause inflate() to return immediately | |||
the header and before the first block. When doing a raw inflate, inflate( | after the header and before the first block. When doing a raw inflate, | |||
) | inflate() will go ahead and process the first block, and will return when | |||
will go ahead and process the first block, and will return when it gets t | it | |||
o | gets to the end of that block, or when it runs out of data. | |||
the end of that block, or when it runs out of data. | ||||
The Z_BLOCK option assists in appending to or combining deflate streams . | The Z_BLOCK option assists in appending to or combining deflate streams . | |||
Also to assist in this, on return inflate() will set strm->data_type to t he | Also to assist in this, on return inflate() will set strm->data_type to t he | |||
number of unused bits in the last byte taken from strm->next_in, plus 64 | number of unused bits in the last byte taken from strm->next_in, plus 64 | |||
if inflate() is currently decoding the last block in the deflate stream, | if | |||
plus 128 if inflate() returned immediately after decoding an end-of-block | inflate() is currently decoding the last block in the deflate stream, plu | |||
code or decoding the complete header up to just before the first byte of | s | |||
the | 128 if inflate() returned immediately after decoding an end-of-block code | |||
deflate stream. The end-of-block will not be indicated until all of the | or | |||
uncompressed data from that block has been written to strm->next_out. Th | decoding the complete header up to just before the first byte of the defl | |||
e | ate | |||
number of unused bits may in general be greater than seven, except when | stream. The end-of-block will not be indicated until all of the uncompre | |||
bit 7 of data_type is set, in which case the number of unused bits will b | ssed | |||
e | data from that block has been written to strm->next_out. The number of | |||
less than eight. | unused bits may in general be greater than seven, except when bit 7 of | |||
data_type is set, in which case the number of unused bits will be less th | ||||
an | ||||
eight. data_type is set as noted here every time inflate() returns for a | ||||
ll | ||||
flush options, and so can be used to determine the amount of currently | ||||
consumed input in bits. | ||||
The Z_TREES option behaves as Z_BLOCK does, but it also returns when th | ||||
e | ||||
end of each deflate block header is reached, before any actual data in th | ||||
at | ||||
block is decoded. This allows the caller to determine the length of the | ||||
deflate block header for later use in random access within a deflate bloc | ||||
k. | ||||
256 is added to the value of strm->data_type when inflate() returns | ||||
immediately after reaching the end of the deflate block header. | ||||
inflate() should normally be called until it returns Z_STREAM_END or an | inflate() should normally be called until it returns Z_STREAM_END or an | |||
error. However if all decompression is to be performed in a single step | error. However if all decompression is to be performed in a single step | |||
(a single call of inflate), the parameter flush should be set to | (a | |||
Z_FINISH. In this case all pending input is processed and all pending | single call of inflate), the parameter flush should be set to Z_FINISH. | |||
output is flushed; avail_out must be large enough to hold all the | In | |||
uncompressed data. (The size of the uncompressed data may have been saved | this case all pending input is processed and all pending output is flushe | |||
by the compressor for this purpose.) The next operation on this stream mu | d; | |||
st | avail_out must be large enough to hold all the uncompressed data. (The s | |||
be inflateEnd to deallocate the decompression state. The use of Z_FINISH | ize | |||
is never required, but can be used to inform inflate that a faster approa | of the uncompressed data may have been saved by the compressor for this | |||
ch | purpose.) The next operation on this stream must be inflateEnd to dealloc | |||
may be used for the single inflate() call. | ate | |||
the decompression state. The use of Z_FINISH is never required, but can | ||||
be | ||||
used to inform inflate that a faster approach may be used for the single | ||||
inflate() call. | ||||
In this implementation, inflate() always flushes as much output as | In this implementation, inflate() always flushes as much output as | |||
possible to the output buffer, and always uses the faster approach on the | possible to the output buffer, and always uses the faster approach on the | |||
first call. So the only effect of the flush parameter in this implementat ion | first call. So the only effect of the flush parameter in this implementa tion | |||
is on the return value of inflate(), as noted below, or when it returns e arly | is on the return value of inflate(), as noted below, or when it returns e arly | |||
because Z_BLOCK is used. | because Z_BLOCK or Z_TREES is used. | |||
If a preset dictionary is needed after this call (see inflateSetDictio nary | If a preset dictionary is needed after this call (see inflateSetDictio nary | |||
below), inflate sets strm->adler to the adler32 checksum of the dictionar y | below), inflate sets strm->adler to the adler32 checksum of the dictionar y | |||
chosen by the compressor and returns Z_NEED_DICT; otherwise it sets | chosen by the compressor and returns Z_NEED_DICT; otherwise it sets | |||
strm->adler to the adler32 checksum of all output produced so far (that i s, | strm->adler to the adler32 checksum of all output produced so far (that i s, | |||
total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as descr ibed | total_out bytes) and returns Z_OK, Z_STREAM_END or an error code as descr ibed | |||
below. At the end of the stream, inflate() checks that its computed adler 32 | below. At the end of the stream, inflate() checks that its computed adle r32 | |||
checksum is equal to that saved by the compressor and returns Z_STREAM_EN D | checksum is equal to that saved by the compressor and returns Z_STREAM_EN D | |||
only if the checksum is correct. | only if the checksum is correct. | |||
inflate() will decompress and check either zlib-wrapped or gzip-wrapped | inflate() can decompress and check either zlib-wrapped or gzip-wrapped | |||
deflate data. The header type is detected automatically. Any informatio | deflate data. The header type is detected automatically, if requested wh | |||
n | en | |||
contained in the gzip header is not retained, so applications that need t | initializing with inflateInit2(). Any information contained in the gzip | |||
hat | header is not retained, so applications that need that information should | |||
information should instead use raw inflate, see inflateInit2() below, or | instead use raw inflate, see inflateInit2() below, or inflateBack() and | |||
inflateBack() and perform their own processing of the gzip header and | perform their own processing of the gzip header and trailer. | |||
trailer. | ||||
inflate() returns Z_OK if some progress has been made (more input proce ssed | inflate() returns Z_OK if some progress has been made (more input proce ssed | |||
or more output produced), Z_STREAM_END if the end of the compressed data has | or more output produced), Z_STREAM_END if the end of the compressed data has | |||
been reached and all uncompressed output has been produced, Z_NEED_DICT i f a | been reached and all uncompressed output has been produced, Z_NEED_DICT i f a | |||
preset dictionary is needed at this point, Z_DATA_ERROR if the input data was | preset dictionary is needed at this point, Z_DATA_ERROR if the input data was | |||
corrupted (input stream not conforming to the zlib format or incorrect ch eck | corrupted (input stream not conforming to the zlib format or incorrect ch eck | |||
value), Z_STREAM_ERROR if the stream structure was inconsistent (for exam ple | value), Z_STREAM_ERROR if the stream structure was inconsistent (for exam ple | |||
if next_in or next_out was NULL), Z_MEM_ERROR if there was not enough mem ory, | next_in or next_out was Z_NULL), Z_MEM_ERROR if there was not enough memo ry, | |||
Z_BUF_ERROR if no progress is possible or if there was not enough room in the | Z_BUF_ERROR if no progress is possible or if there was not enough room in the | |||
output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and | output buffer when Z_FINISH is used. Note that Z_BUF_ERROR is not fatal, and | |||
inflate() can be called again with more input and more output space to | inflate() can be called again with more input and more output space to | |||
continue decompressing. If Z_DATA_ERROR is returned, the application may | continue decompressing. If Z_DATA_ERROR is returned, the application may | |||
then | then call inflateSync() to look for a good compression block if a partial | |||
call inflateSync() to look for a good compression block if a partial reco | recovery of the data is desired. | |||
very | ||||
of the data is desired. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); | ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); | |||
/* | /* | |||
All dynamically allocated data structures for this stream are freed. | All dynamically allocated data structures for this stream are freed. | |||
This function discards any unprocessed input and does not flush any | This function discards any unprocessed input and does not flush any pend | |||
pending output. | ing | |||
output. | ||||
inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state | inflateEnd returns Z_OK if success, Z_STREAM_ERROR if the stream state | |||
was inconsistent. In the error case, msg may be set but then points to a | was inconsistent. In the error case, msg may be set but then points to a | |||
static string (which must not be deallocated). | static string (which must not be deallocated). | |||
*/ | */ | |||
/* Advanced functions */ | /* Advanced functions */ | |||
/* | /* | |||
The following functions are needed only in some special applications. | The following functions are needed only in some special applications. | |||
*/ | */ | |||
/* | /* | |||
ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, | ZEXTERN int ZEXPORT deflateInit2 OF((z_streamp strm, | |||
int level, | int level, | |||
int method, | int method, | |||
int windowBits, | int windowBits, | |||
int memLevel, | int memLevel, | |||
int strategy)); | int strategy)); | |||
This is another version of deflateInit with more compression options. | This is another version of deflateInit with more compression options. | |||
The | The | |||
fields next_in, zalloc, zfree and opaque must be initialized before by | fields next_in, zalloc, zfree and opaque must be initialized before by t | |||
the caller. | he | |||
caller. | ||||
The method parameter is the compression method. It must be Z_DEFLATED in | The method parameter is the compression method. It must be Z_DEFLATED in | |||
this version of the library. | this version of the library. | |||
The windowBits parameter is the base two logarithm of the window size | The windowBits parameter is the base two logarithm of the window size | |||
(the size of the history buffer). It should be in the range 8..15 for th | (the size of the history buffer). It should be in the range 8..15 for t | |||
is | his | |||
version of the library. Larger values of this parameter result in better | version of the library. Larger values of this parameter result in bette | |||
compression at the expense of memory usage. The default value is 15 if | r | |||
compression at the expense of memory usage. The default value is 15 if | ||||
deflateInit is used instead. | deflateInit is used instead. | |||
windowBits can also be -8..-15 for raw deflate. In this case, -windowB | windowBits can also be -8..-15 for raw deflate. In this case, -window | |||
its | Bits | |||
determines the window size. deflate() will then generate raw deflate dat | determines the window size. deflate() will then generate raw deflate da | |||
a | ta | |||
with no zlib header or trailer, and will not compute an adler32 check va lue. | with no zlib header or trailer, and will not compute an adler32 check va lue. | |||
windowBits can also be greater than 15 for optional gzip encoding. Add | windowBits can also be greater than 15 for optional gzip encoding. Ad d | |||
16 to windowBits to write a simple gzip header and trailer around the | 16 to windowBits to write a simple gzip header and trailer around the | |||
compressed data instead of a zlib wrapper. The gzip header will have no | compressed data instead of a zlib wrapper. The gzip header will have no | |||
file name, no extra data, no comment, no modification time (set to zero) | file name, no extra data, no comment, no modification time (set to zero) | |||
, | , no | |||
no header crc, and the operating system will be set to 255 (unknown). I | header crc, and the operating system will be set to 255 (unknown). If a | |||
f a | ||||
gzip stream is being written, strm->adler is a crc32 instead of an adler 32. | gzip stream is being written, strm->adler is a crc32 instead of an adler 32. | |||
The memLevel parameter specifies how much memory should be allocated | The memLevel parameter specifies how much memory should be allocated | |||
for the internal compression state. memLevel=1 uses minimum memory but | for the internal compression state. memLevel=1 uses minimum memory but | |||
is slow and reduces compression ratio; memLevel=9 uses maximum memory | is | |||
for optimal speed. The default value is 8. See zconf.h for total memory | slow and reduces compression ratio; memLevel=9 uses maximum memory for | |||
usage as a function of windowBits and memLevel. | optimal speed. The default value is 8. See zconf.h for total memory us | |||
age | ||||
as a function of windowBits and memLevel. | ||||
The strategy parameter is used to tune the compression algorithm. Use the | The strategy parameter is used to tune the compression algorithm. Use the | |||
value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced b y a | value Z_DEFAULT_STRATEGY for normal data, Z_FILTERED for data produced b y a | |||
filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no | filter (or predictor), Z_HUFFMAN_ONLY to force Huffman encoding only (no | |||
string match), or Z_RLE to limit match distances to one (run-length | string match), or Z_RLE to limit match distances to one (run-length | |||
encoding). Filtered data consists mostly of small values with a somewhat | encoding). Filtered data consists mostly of small values with a somewha | |||
random distribution. In this case, the compression algorithm is tuned to | t | |||
compress them better. The effect of Z_FILTERED is to force more Huffman | random distribution. In this case, the compression algorithm is tuned t | |||
o | ||||
compress them better. The effect of Z_FILTERED is to force more Huffman | ||||
coding and less string matching; it is somewhat intermediate between | coding and less string matching; it is somewhat intermediate between | |||
Z_DEFAULT and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost as fast as | Z_DEFAULT_STRATEGY and Z_HUFFMAN_ONLY. Z_RLE is designed to be almost a | |||
Z_HUFFMAN_ONLY, but give better compression for PNG image data. The stra | s | |||
tegy | fast as Z_HUFFMAN_ONLY, but give better compression for PNG image data. | |||
parameter only affects the compression ratio but not the correctness of | The | |||
the | strategy parameter only affects the compression ratio but not the | |||
compressed output even if it is not set appropriately. Z_FIXED prevents | correctness of the compressed output even if it is not set appropriately | |||
the | . | |||
use of dynamic Huffman codes, allowing for a simpler decoder for special | Z_FIXED prevents the use of dynamic Huffman codes, allowing for a simple | |||
applications. | r | |||
decoder for special applications. | ||||
deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not en | deflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not eno | |||
ough | ugh | |||
memory, Z_STREAM_ERROR if a parameter is invalid (such as an invalid | memory, Z_STREAM_ERROR if any parameter is invalid (such as an invalid | |||
method). msg is set to null if there is no error message. deflateInit2 | method), or Z_VERSION_ERROR if the zlib library version (zlib_version) i | |||
does | s | |||
not perform any compression: this will be done by deflate(). | incompatible with the version assumed by the caller (ZLIB_VERSION). msg | |||
is | ||||
set to null if there is no error message. deflateInit2 does not perform | ||||
any | ||||
compression: this will be done by deflate(). | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, | ZEXTERN int ZEXPORT deflateSetDictionary OF((z_streamp strm, | |||
const Bytef *dictionary, | const Bytef *dictionary, | |||
uInt dictLength)); | uInt dictLength)); | |||
/* | /* | |||
Initializes the compression dictionary from the given byte sequence | Initializes the compression dictionary from the given byte sequence | |||
without producing any compressed output. This function must be called | without producing any compressed output. This function must be called | |||
immediately after deflateInit, deflateInit2 or deflateReset, before any | immediately after deflateInit, deflateInit2 or deflateReset, before any | |||
call of deflate. The compressor and decompressor must use exactly the sa | call | |||
me | of deflate. The compressor and decompressor must use exactly the same | |||
dictionary (see inflateSetDictionary). | dictionary (see inflateSetDictionary). | |||
The dictionary should consist of strings (byte sequences) that are lik ely | The dictionary should consist of strings (byte sequences) that are lik ely | |||
to be encountered later in the data to be compressed, with the most comm only | to be encountered later in the data to be compressed, with the most comm only | |||
used strings preferably put towards the end of the dictionary. Using a | used strings preferably put towards the end of the dictionary. Using a | |||
dictionary is most useful when the data to be compressed is short and ca n be | dictionary is most useful when the data to be compressed is short and ca n be | |||
predicted with good accuracy; the data can then be compressed better tha n | predicted with good accuracy; the data can then be compressed better tha n | |||
with the default empty dictionary. | with the default empty dictionary. | |||
Depending on the size of the compression data structures selected by | Depending on the size of the compression data structures selected by | |||
deflateInit or deflateInit2, a part of the dictionary may in effect be | deflateInit or deflateInit2, a part of the dictionary may in effect be | |||
discarded, for example if the dictionary is larger than the window size | discarded, for example if the dictionary is larger than the window size | |||
in | provided in deflateInit or deflateInit2. Thus the strings most likely t | |||
deflate or deflate2. Thus the strings most likely to be useful should be | o be | |||
put at the end of the dictionary, not at the front. In addition, the | useful should be put at the end of the dictionary, not at the front. In | |||
current implementation of deflate will use at most the window size minus | addition, the current implementation of deflate will use at most the win | |||
262 bytes of the provided dictionary. | dow | |||
size minus 262 bytes of the provided dictionary. | ||||
Upon return of this function, strm->adler is set to the adler32 value | Upon return of this function, strm->adler is set to the adler32 value | |||
of the dictionary; the decompressor may later use this value to determin e | of the dictionary; the decompressor may later use this value to determin e | |||
which dictionary has been used by the compressor. (The adler32 value | which dictionary has been used by the compressor. (The adler32 value | |||
applies to the whole dictionary even if only a subset of the dictionary is | applies to the whole dictionary even if only a subset of the dictionary is | |||
actually used by the compressor.) If a raw deflate was requested, then t he | actually used by the compressor.) If a raw deflate was requested, then t he | |||
adler32 value is not computed and strm->adler is not set. | adler32 value is not computed and strm->adler is not set. | |||
deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a | deflateSetDictionary returns Z_OK if success, or Z_STREAM_ERROR if a | |||
parameter is invalid (such as NULL dictionary) or the stream state is | parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is | |||
inconsistent (for example if deflate has already been called for this st ream | inconsistent (for example if deflate has already been called for this st ream | |||
or if the compression method is bsort). deflateSetDictionary does not | or if the compression method is bsort). deflateSetDictionary does not | |||
perform any compression: this will be done by deflate(). | perform any compression: this will be done by deflate(). | |||
*/ | */ | |||
ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, | ZEXTERN int ZEXPORT deflateCopy OF((z_streamp dest, | |||
z_streamp source)); | z_streamp source)); | |||
/* | /* | |||
Sets the destination stream as a complete copy of the source stream. | Sets the destination stream as a complete copy of the source stream. | |||
This function can be useful when several compression strategies will b e | This function can be useful when several compression strategies will b e | |||
tried, for example when there are several ways of pre-processing the inp ut | tried, for example when there are several ways of pre-processing the inp ut | |||
data with a filter. The streams that will be discarded should then be fr eed | data with a filter. The streams that will be discarded should then be f reed | |||
by calling deflateEnd. Note that deflateCopy duplicates the internal | by calling deflateEnd. Note that deflateCopy duplicates the internal | |||
compression state which can be quite large, so this strategy is slow and | compression state which can be quite large, so this strategy is slow and | |||
can consume lots of memory. | can | |||
consume lots of memory. | ||||
deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not | deflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not | |||
enough memory, Z_STREAM_ERROR if the source stream state was inconsisten t | enough memory, Z_STREAM_ERROR if the source stream state was inconsisten t | |||
(such as zalloc being NULL). msg is left unchanged in both source and | (such as zalloc being Z_NULL). msg is left unchanged in both source and | |||
destination. | destination. | |||
*/ | */ | |||
ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); | ZEXTERN int ZEXPORT deflateReset OF((z_streamp strm)); | |||
/* | /* | |||
This function is equivalent to deflateEnd followed by deflateInit, | This function is equivalent to deflateEnd followed by deflateInit, | |||
but does not free and reallocate all the internal compression state. | but does not free and reallocate all the internal compression state. Th | |||
The stream will keep the same compression level and any other attributes | e | |||
that may have been set by deflateInit2. | stream will keep the same compression level and any other attributes tha | |||
t | ||||
may have been set by deflateInit2. | ||||
deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source | deflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source | |||
stream state was inconsistent (such as zalloc or state being NULL). | stream state was inconsistent (such as zalloc or state being Z_NULL). | |||
*/ | */ | |||
ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, | ZEXTERN int ZEXPORT deflateParams OF((z_streamp strm, | |||
int level, | int level, | |||
int strategy)); | int strategy)); | |||
/* | /* | |||
Dynamically update the compression level and compression strategy. Th e | Dynamically update the compression level and compression strategy. Th e | |||
interpretation of level and strategy is as in deflateInit2. This can be | interpretation of level and strategy is as in deflateInit2. This can be | |||
used to switch between compression and straight copy of the input data, or | used to switch between compression and straight copy of the input data, or | |||
to switch to a different kind of input data requiring a different | to switch to a different kind of input data requiring a different strate | |||
strategy. If the compression level is changed, the input available so fa | gy. | |||
r | If the compression level is changed, the input available so far is | |||
is compressed with the old level (and may be flushed); the new level wil | compressed with the old level (and may be flushed); the new level will t | |||
l | ake | |||
take effect only at the next call of deflate(). | effect only at the next call of deflate(). | |||
Before the call of deflateParams, the stream state must be set as for | Before the call of deflateParams, the stream state must be set as for | |||
a call of deflate(), since the currently available input may have to | a call of deflate(), since the currently available input may have to be | |||
be compressed and flushed. In particular, strm->avail_out must be non-ze | compressed and flushed. In particular, strm->avail_out must be non-zero | |||
ro. | . | |||
deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source | deflateParams returns Z_OK if success, Z_STREAM_ERROR if the source | |||
stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR | stream state was inconsistent or if a parameter was invalid, Z_BUF_ERROR | |||
if strm->avail_out was zero. | if | |||
strm->avail_out was zero. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, | ZEXTERN int ZEXPORT deflateTune OF((z_streamp strm, | |||
int good_length, | int good_length, | |||
int max_lazy, | int max_lazy, | |||
int nice_length, | int nice_length, | |||
int max_chain)); | int max_chain)); | |||
/* | /* | |||
Fine tune deflate's internal compression parameters. This should only be | Fine tune deflate's internal compression parameters. This should only be | |||
used by someone who understands the algorithm used by zlib's deflate for | used by someone who understands the algorithm used by zlib's deflate for | |||
skipping to change at line 647 | skipping to change at line 684 | |||
max_lazy, good_length, nice_length, and max_chain parameters. | max_lazy, good_length, nice_length, and max_chain parameters. | |||
deflateTune() can be called after deflateInit() or deflateInit2(), and | deflateTune() can be called after deflateInit() or deflateInit2(), and | |||
returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream . | returns Z_OK on success, or Z_STREAM_ERROR for an invalid deflate stream . | |||
*/ | */ | |||
ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, | ZEXTERN uLong ZEXPORT deflateBound OF((z_streamp strm, | |||
uLong sourceLen)); | uLong sourceLen)); | |||
/* | /* | |||
deflateBound() returns an upper bound on the compressed size after | deflateBound() returns an upper bound on the compressed size after | |||
deflation of sourceLen bytes. It must be called after deflateInit() | deflation of sourceLen bytes. It must be called after deflateInit() or | |||
or deflateInit2(). This would be used to allocate an output buffer | deflateInit2(), and after deflateSetHeader(), if used. This would be us | |||
for deflation in a single pass, and so would be called before deflate(). | ed | |||
to allocate an output buffer for deflation in a single pass, and so woul | ||||
d be | ||||
called before deflate(). | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, | ZEXTERN int ZEXPORT deflatePrime OF((z_streamp strm, | |||
int bits, | int bits, | |||
int value)); | int value)); | |||
/* | /* | |||
deflatePrime() inserts bits in the deflate output stream. The intent | deflatePrime() inserts bits in the deflate output stream. The intent | |||
is that this function is used to start off the deflate output with the | is that this function is used to start off the deflate output with the b | |||
bits leftover from a previous deflate stream when appending to it. As su | its | |||
ch, | leftover from a previous deflate stream when appending to it. As such, | |||
this function can only be used for raw deflate, and must be used before t | this | |||
he | function can only be used for raw deflate, and must be used before the f | |||
first deflate() call after a deflateInit2() or deflateReset(). bits must | irst | |||
be | deflate() call after a deflateInit2() or deflateReset(). bits must be l | |||
less than or equal to 16, and that many of the least significant bits of | ess | |||
value will be inserted in the output. | than or equal to 16, and that many of the least significant bits of valu | |||
e | ||||
will be inserted in the output. | ||||
deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source | deflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source | |||
stream state was inconsistent. | stream state was inconsistent. | |||
*/ | */ | |||
ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, | ZEXTERN int ZEXPORT deflateSetHeader OF((z_streamp strm, | |||
gz_headerp head)); | gz_headerp head)); | |||
/* | /* | |||
deflateSetHeader() provides gzip header information for when a gzip | deflateSetHeader() provides gzip header information for when a gzip | |||
stream is requested by deflateInit2(). deflateSetHeader() may be called | stream is requested by deflateInit2(). deflateSetHeader() may be called | |||
after deflateInit2() or deflateReset() and before the first call of | after deflateInit2() or deflateReset() and before the first call of | |||
deflate(). The text, time, os, extra field, name, and comment informati on | deflate(). The text, time, os, extra field, name, and comment informati on | |||
in the provided gz_header structure are written to the gzip header (xfla g is | in the provided gz_header structure are written to the gzip header (xfla g is | |||
ignored -- the extra flags are set according to the compression level). The | ignored -- the extra flags are set according to the compression level). The | |||
caller must assure that, if not Z_NULL, name and comment are terminated with | caller must assure that, if not Z_NULL, name and comment are terminated with | |||
a zero byte, and that if extra is not Z_NULL, that extra_len bytes are | a zero byte, and that if extra is not Z_NULL, that extra_len bytes are | |||
available there. If hcrc is true, a gzip header crc is included. Note that | available there. If hcrc is true, a gzip header crc is included. Note that | |||
the current versions of the command-line version of gzip (up through ver sion | the current versions of the command-line version of gzip (up through ver sion | |||
1.3.x) do not support header crc's, and will report that it is a "multi- part | 1.3.x) do not support header crc's, and will report that it is a "multi- part | |||
gzip file" and give up. | gzip file" and give up. | |||
If deflateSetHeader is not used, the default gzip header has text fal se, | If deflateSetHeader is not used, the default gzip header has text fals e, | |||
the time set to zero, and os set to 255, with no extra, name, or comment | the time set to zero, and os set to 255, with no extra, name, or comment | |||
fields. The gzip header is returned to the default state by deflateRese t(). | fields. The gzip header is returned to the default state by deflateRese t(). | |||
deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the so urce | deflateSetHeader returns Z_OK if success, or Z_STREAM_ERROR if the sou rce | |||
stream state was inconsistent. | stream state was inconsistent. | |||
*/ | */ | |||
/* | /* | |||
ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, | ZEXTERN int ZEXPORT inflateInit2 OF((z_streamp strm, | |||
int windowBits)); | int windowBits)); | |||
This is another version of inflateInit with an extra parameter. The | This is another version of inflateInit with an extra parameter. The | |||
fields next_in, avail_in, zalloc, zfree and opaque must be initialized | fields next_in, avail_in, zalloc, zfree and opaque must be initialized | |||
before by the caller. | before by the caller. | |||
The windowBits parameter is the base two logarithm of the maximum wind ow | The windowBits parameter is the base two logarithm of the maximum wind ow | |||
size (the size of the history buffer). It should be in the range 8..15 for | size (the size of the history buffer). It should be in the range 8..15 for | |||
this version of the library. The default value is 15 if inflateInit is u | this version of the library. The default value is 15 if inflateInit is | |||
sed | used | |||
instead. windowBits must be greater than or equal to the windowBits valu | instead. windowBits must be greater than or equal to the windowBits val | |||
e | ue | |||
provided to deflateInit2() while compressing, or it must be equal to 15 if | provided to deflateInit2() while compressing, or it must be equal to 15 if | |||
deflateInit2() was not used. If a compressed stream with a larger window | deflateInit2() was not used. If a compressed stream with a larger windo w | |||
size is given as input, inflate() will return with the error code | size is given as input, inflate() will return with the error code | |||
Z_DATA_ERROR instead of trying to allocate a larger window. | Z_DATA_ERROR instead of trying to allocate a larger window. | |||
windowBits can also be -8..-15 for raw inflate. In this case, -windowB | windowBits can also be zero to request that inflate use the window siz | |||
its | e in | |||
determines the window size. inflate() will then process raw deflate data | the zlib header of the compressed stream. | |||
, | ||||
windowBits can also be -8..-15 for raw inflate. In this case, -window | ||||
Bits | ||||
determines the window size. inflate() will then process raw deflate dat | ||||
a, | ||||
not looking for a zlib or gzip header, not generating a check value, and not | not looking for a zlib or gzip header, not generating a check value, and not | |||
looking for any check values for comparison at the end of the stream. Th is | looking for any check values for comparison at the end of the stream. T his | |||
is for use with other formats that use the deflate compressed data forma t | is for use with other formats that use the deflate compressed data forma t | |||
such as zip. Those formats provide their own check values. If a custom | such as zip. Those formats provide their own check values. If a custom | |||
format is developed using the raw deflate format for compressed data, it is | format is developed using the raw deflate format for compressed data, it is | |||
recommended that a check value such as an adler32 or a crc32 be applied to | recommended that a check value such as an adler32 or a crc32 be applied to | |||
the uncompressed data as is done in the zlib, gzip, and zip formats. Fo r | the uncompressed data as is done in the zlib, gzip, and zip formats. Fo r | |||
most applications, the zlib format should be used as is. Note that comme nts | most applications, the zlib format should be used as is. Note that comm ents | |||
above on the use in deflateInit2() applies to the magnitude of windowBit s. | above on the use in deflateInit2() applies to the magnitude of windowBit s. | |||
windowBits can also be greater than 15 for optional gzip decoding. Add | windowBits can also be greater than 15 for optional gzip decoding. Ad d | |||
32 to windowBits to enable zlib and gzip decoding with automatic header | 32 to windowBits to enable zlib and gzip decoding with automatic header | |||
detection, or add 16 to decode only the gzip format (the zlib format wil l | detection, or add 16 to decode only the gzip format (the zlib format wil l | |||
return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler | return a Z_DATA_ERROR). If a gzip stream is being decoded, strm->adler | |||
is | is a | |||
a crc32 instead of an adler32. | crc32 instead of an adler32. | |||
inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not eno ugh | inflateInit2 returns Z_OK if success, Z_MEM_ERROR if there was not eno ugh | |||
memory, Z_STREAM_ERROR if a parameter is invalid (such as a null strm). | memory, Z_VERSION_ERROR if the zlib library version is incompatible with | |||
msg | the | |||
is set to null if there is no error message. inflateInit2 does not perf | version assumed by the caller, or Z_STREAM_ERROR if the parameters are | |||
orm | invalid, such as a null pointer to the structure. msg is set to null if | |||
any decompression apart from reading the zlib header if present: this wi | there is no error message. inflateInit2 does not perform any decompress | |||
ll | ion | |||
be done by inflate(). (So next_in and avail_in may be modified, but next | apart from possibly reading the zlib header if present: actual decompres | |||
_out | sion | |||
and avail_out are unchanged.) | will be done by inflate(). (So next_in and avail_in may be modified, bu | |||
t | ||||
next_out and avail_out are unused and unchanged.) The current implementa | ||||
tion | ||||
of inflateInit2() does not process any header information -- that is | ||||
deferred until inflate() is called. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, | ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, | |||
const Bytef *dictionary, | const Bytef *dictionary, | |||
uInt dictLength)); | uInt dictLength)); | |||
/* | /* | |||
Initializes the decompression dictionary from the given uncompressed b yte | Initializes the decompression dictionary from the given uncompressed b yte | |||
sequence. This function must be called immediately after a call of infla | sequence. This function must be called immediately after a call of infl | |||
te, | ate, | |||
if that call returned Z_NEED_DICT. The dictionary chosen by the compress | if that call returned Z_NEED_DICT. The dictionary chosen by the compres | |||
or | sor | |||
can be determined from the adler32 value returned by that call of inflat e. | can be determined from the adler32 value returned by that call of inflat e. | |||
The compressor and decompressor must use exactly the same dictionary (se e | The compressor and decompressor must use exactly the same dictionary (se e | |||
deflateSetDictionary). For raw inflate, this function can be called | deflateSetDictionary). For raw inflate, this function can be called | |||
immediately after inflateInit2() or inflateReset() and before any call o f | immediately after inflateInit2() or inflateReset() and before any call o f | |||
inflate() to set the dictionary. The application must insure that the | inflate() to set the dictionary. The application must insure that the | |||
dictionary that was used for compression is provided. | dictionary that was used for compression is provided. | |||
inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a | inflateSetDictionary returns Z_OK if success, Z_STREAM_ERROR if a | |||
parameter is invalid (such as NULL dictionary) or the stream state is | parameter is invalid (e.g. dictionary being Z_NULL) or the stream state is | |||
inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the | inconsistent, Z_DATA_ERROR if the given dictionary doesn't match the | |||
expected one (incorrect adler32 value). inflateSetDictionary does not | expected one (incorrect adler32 value). inflateSetDictionary does not | |||
perform any decompression: this will be done by subsequent calls of | perform any decompression: this will be done by subsequent calls of | |||
inflate(). | inflate(). | |||
*/ | */ | |||
ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); | ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); | |||
/* | /* | |||
Skips invalid compressed data until a full flush point (see above the | Skips invalid compressed data until a full flush point (see above the | |||
description of deflate with Z_FULL_FLUSH) can be found, or until all | description of deflate with Z_FULL_FLUSH) can be found, or until all | |||
available input is skipped. No output is provided. | available input is skipped. No output is provided. | |||
inflateSync returns Z_OK if a full flush point has been found, Z_BUF_ER | inflateSync returns Z_OK if a full flush point has been found, Z_BUF_E | |||
ROR | RROR | |||
if no more input was provided, Z_DATA_ERROR if no flush point has been fo | if no more input was provided, Z_DATA_ERROR if no flush point has been | |||
und, | found, or Z_STREAM_ERROR if the stream structure was inconsistent. In t | |||
or Z_STREAM_ERROR if the stream structure was inconsistent. In the succes | he | |||
s | success case, the application may save the current current value of tota | |||
case, the application may save the current current value of total_in whic | l_in | |||
h | which indicates where valid compressed data was found. In the error cas | |||
indicates where valid compressed data was found. In the error case, the | e, | |||
application may repeatedly call inflateSync, providing more input each ti | the application may repeatedly call inflateSync, providing more input ea | |||
me, | ch | |||
until success or end of the input data. | time, until success or end of the input data. | |||
*/ | */ | |||
ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, | ZEXTERN int ZEXPORT inflateCopy OF((z_streamp dest, | |||
z_streamp source)); | z_streamp source)); | |||
/* | /* | |||
Sets the destination stream as a complete copy of the source stream. | Sets the destination stream as a complete copy of the source stream. | |||
This function can be useful when randomly accessing a large stream. T he | This function can be useful when randomly accessing a large stream. T he | |||
first pass through the stream can periodically record the inflate state, | first pass through the stream can periodically record the inflate state, | |||
allowing restarting inflate at those points when randomly accessing the | allowing restarting inflate at those points when randomly accessing the | |||
stream. | stream. | |||
inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not | inflateCopy returns Z_OK if success, Z_MEM_ERROR if there was not | |||
enough memory, Z_STREAM_ERROR if the source stream state was inconsisten t | enough memory, Z_STREAM_ERROR if the source stream state was inconsisten t | |||
(such as zalloc being NULL). msg is left unchanged in both source and | (such as zalloc being Z_NULL). msg is left unchanged in both source and | |||
destination. | destination. | |||
*/ | */ | |||
ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); | ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); | |||
/* | /* | |||
This function is equivalent to inflateEnd followed by inflateInit, | This function is equivalent to inflateEnd followed by inflateInit, | |||
but does not free and reallocate all the internal decompression state. | but does not free and reallocate all the internal decompression state. | |||
The stream will keep attributes that may have been set by inflateInit2. | The | |||
stream will keep attributes that may have been set by inflateInit2. | ||||
inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source | inflateReset returns Z_OK if success, or Z_STREAM_ERROR if the source | |||
stream state was inconsistent (such as zalloc or state being NULL). | stream state was inconsistent (such as zalloc or state being Z_NULL). | |||
*/ | ||||
ZEXTERN int ZEXPORT inflateReset2 OF((z_streamp strm, | ||||
int windowBits)); | ||||
/* | ||||
This function is the same as inflateReset, but it also permits changin | ||||
g | ||||
the wrap and window size requests. The windowBits parameter is interpre | ||||
ted | ||||
the same as it is for inflateInit2. | ||||
inflateReset2 returns Z_OK if success, or Z_STREAM_ERROR if the source | ||||
stream state was inconsistent (such as zalloc or state being Z_NULL), or | ||||
if | ||||
the windowBits parameter is invalid. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, | ZEXTERN int ZEXPORT inflatePrime OF((z_streamp strm, | |||
int bits, | int bits, | |||
int value)); | int value)); | |||
/* | /* | |||
This function inserts bits in the inflate input stream. The intent is | This function inserts bits in the inflate input stream. The intent is | |||
that this function is used to start inflating at a bit position in the | that this function is used to start inflating at a bit position in the | |||
middle of a byte. The provided bits will be used before any bytes are us | middle of a byte. The provided bits will be used before any bytes are u | |||
ed | sed | |||
from next_in. This function should only be used with raw inflate, and | from next_in. This function should only be used with raw inflate, and | |||
should be used before the first inflate() call after inflateInit2() or | should be used before the first inflate() call after inflateInit2() or | |||
inflateReset(). bits must be less than or equal to 16, and that many of | inflateReset(). bits must be less than or equal to 16, and that many of | |||
the | the | |||
least significant bits of value will be inserted in the input. | least significant bits of value will be inserted in the input. | |||
inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source | If bits is negative, then the input stream bit buffer is emptied. The | |||
n | ||||
inflatePrime() can be called again to put bits in the buffer. This is u | ||||
sed | ||||
to clear out bits leftover after feeding inflate a block description pri | ||||
or | ||||
to feeding inflate codes. | ||||
inflatePrime returns Z_OK if success, or Z_STREAM_ERROR if the source | ||||
stream state was inconsistent. | stream state was inconsistent. | |||
*/ | */ | |||
ZEXTERN long ZEXPORT inflateMark OF((z_streamp strm)); | ||||
/* | ||||
This function returns two values, one in the lower 16 bits of the retu | ||||
rn | ||||
value, and the other in the remaining upper bits, obtained by shifting t | ||||
he | ||||
return value down 16 bits. If the upper value is -1 and the lower value | ||||
is | ||||
zero, then inflate() is currently decoding information outside of a bloc | ||||
k. | ||||
If the upper value is -1 and the lower value is non-zero, then inflate i | ||||
s in | ||||
the middle of a stored block, with the lower value equaling the number o | ||||
f | ||||
bytes from the input remaining to copy. If the upper value is not -1, t | ||||
hen | ||||
it is the number of bits back from the current bit position in the input | ||||
of | ||||
the code (literal or length/distance pair) currently being processed. I | ||||
n | ||||
that case the lower value is the number of bytes already emitted for tha | ||||
t | ||||
code. | ||||
A code is being processed if inflate is waiting for more input to comp | ||||
lete | ||||
decoding of the code, or if it has completed decoding but is waiting for | ||||
more output space to write the literal or match data. | ||||
inflateMark() is used to mark locations in the input data for random | ||||
access, which may be at bit positions, and to note those cases where the | ||||
output of a code may span boundaries of random access blocks. The curre | ||||
nt | ||||
location in the input stream can be determined from avail_in and data_ty | ||||
pe | ||||
as noted in the description for the Z_BLOCK flush parameter for inflate. | ||||
inflateMark returns the value noted above or -1 << 16 if the provided | ||||
source stream state was inconsistent. | ||||
*/ | ||||
ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, | ZEXTERN int ZEXPORT inflateGetHeader OF((z_streamp strm, | |||
gz_headerp head)); | gz_headerp head)); | |||
/* | /* | |||
inflateGetHeader() requests that gzip header information be stored in the | inflateGetHeader() requests that gzip header information be stored in the | |||
provided gz_header structure. inflateGetHeader() may be called after | provided gz_header structure. inflateGetHeader() may be called after | |||
inflateInit2() or inflateReset(), and before the first call of inflate() . | inflateInit2() or inflateReset(), and before the first call of inflate() . | |||
As inflate() processes the gzip stream, head->done is zero until the hea der | As inflate() processes the gzip stream, head->done is zero until the hea der | |||
is completed, at which time head->done is set to one. If a zlib stream is | is completed, at which time head->done is set to one. If a zlib stream is | |||
being decoded, then head->done is set to -1 to indicate that there will be | being decoded, then head->done is set to -1 to indicate that there will be | |||
no gzip header information forthcoming. Note that Z_BLOCK can be used t | no gzip header information forthcoming. Note that Z_BLOCK or Z_TREES ca | |||
o | n be | |||
force inflate() to return immediately after header processing is complet | used to force inflate() to return immediately after header processing is | |||
e | complete and before any actual data is decompressed. | |||
and before any actual data is decompressed. | ||||
The text, time, xflags, and os fields are filled in with the gzip hea der | The text, time, xflags, and os fields are filled in with the gzip head er | |||
contents. hcrc is set to true if there is a header CRC. (The header CR C | contents. hcrc is set to true if there is a header CRC. (The header CR C | |||
was valid if done is set to one.) If extra is not Z_NULL, then extra_ma x | was valid if done is set to one.) If extra is not Z_NULL, then extra_max | |||
contains the maximum number of bytes to write to extra. Once done is tr ue, | contains the maximum number of bytes to write to extra. Once done is tr ue, | |||
extra_len contains the actual extra field length, and extra contains the | extra_len contains the actual extra field length, and extra contains the | |||
extra field, or that field truncated if extra_max is less than extra_len . | extra field, or that field truncated if extra_max is less than extra_len . | |||
If name is not Z_NULL, then up to name_max characters are written there, | If name is not Z_NULL, then up to name_max characters are written there, | |||
terminated with a zero unless the length is greater than name_max. If | terminated with a zero unless the length is greater than name_max. If | |||
comment is not Z_NULL, then up to comm_max characters are written there, | comment is not Z_NULL, then up to comm_max characters are written there, | |||
terminated with a zero unless the length is greater than comm_max. When | terminated with a zero unless the length is greater than comm_max. When | |||
any of extra, name, or comment are not Z_NULL and the respective field i | any | |||
s | of extra, name, or comment are not Z_NULL and the respective field is no | |||
not present in the header, then that field is set to Z_NULL to signal it | t | |||
s | present in the header, then that field is set to Z_NULL to signal its | |||
absence. This allows the use of deflateSetHeader() with the returned | absence. This allows the use of deflateSetHeader() with the returned | |||
structure to duplicate the header. However if those fields are set to | structure to duplicate the header. However if those fields are set to | |||
allocated memory, then the application will need to save those pointers | allocated memory, then the application will need to save those pointers | |||
elsewhere so that they can be eventually freed. | elsewhere so that they can be eventually freed. | |||
If inflateGetHeader is not used, then the header information is simpl y | If inflateGetHeader is not used, then the header information is simply | |||
discarded. The header is always checked for validity, including the hea der | discarded. The header is always checked for validity, including the hea der | |||
CRC if present. inflateReset() will reset the process to discard the he ader | CRC if present. inflateReset() will reset the process to discard the he ader | |||
information. The application would need to call inflateGetHeader() agai n to | information. The application would need to call inflateGetHeader() agai n to | |||
retrieve the header from the next gzip stream. | retrieve the header from the next gzip stream. | |||
inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the so urce | inflateGetHeader returns Z_OK if success, or Z_STREAM_ERROR if the sou rce | |||
stream state was inconsistent. | stream state was inconsistent. | |||
*/ | */ | |||
/* | /* | |||
ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, | ZEXTERN int ZEXPORT inflateBackInit OF((z_streamp strm, int windowBits, | |||
unsigned char FAR *window)); | unsigned char FAR *window)); | |||
Initialize the internal stream state for decompression using inflateBa ck() | Initialize the internal stream state for decompression using inflateBa ck() | |||
calls. The fields zalloc, zfree and opaque in strm must be initialized | calls. The fields zalloc, zfree and opaque in strm must be initialized | |||
before the call. If zalloc and zfree are Z_NULL, then the default libra ry- | before the call. If zalloc and zfree are Z_NULL, then the default libra ry- | |||
derived memory allocation routines are used. windowBits is the base two | derived memory allocation routines are used. windowBits is the base two | |||
logarithm of the window size, in the range 8..15. window is a caller | logarithm of the window size, in the range 8..15. window is a caller | |||
supplied buffer of that size. Except for special applications where it is | supplied buffer of that size. Except for special applications where it is | |||
assured that deflate was used with small window sizes, windowBits must b e 15 | assured that deflate was used with small window sizes, windowBits must b e 15 | |||
and a 32K byte window must be supplied to be able to decompress general | and a 32K byte window must be supplied to be able to decompress general | |||
deflate streams. | deflate streams. | |||
See inflateBack() for the usage of these routines. | See inflateBack() for the usage of these routines. | |||
inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of | inflateBackInit will return Z_OK on success, Z_STREAM_ERROR if any of | |||
the paramaters are invalid, Z_MEM_ERROR if the internal state could not | the paramaters are invalid, Z_MEM_ERROR if the internal state could not | |||
be allocated, or Z_VERSION_ERROR if the version of the library does not | be | |||
match the version of the header file. | allocated, or Z_VERSION_ERROR if the version of the library does not mat | |||
ch | ||||
the version of the header file. | ||||
*/ | */ | |||
typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); | typedef unsigned (*in_func) OF((void FAR *, unsigned char FAR * FAR *)); | |||
typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); | typedef int (*out_func) OF((void FAR *, unsigned char FAR *, unsigned)); | |||
ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, | ZEXTERN int ZEXPORT inflateBack OF((z_streamp strm, | |||
in_func in, void FAR *in_desc, | in_func in, void FAR *in_desc, | |||
out_func out, void FAR *out_desc)); | out_func out, void FAR *out_desc)); | |||
/* | /* | |||
inflateBack() does a raw inflate with a single call using a call-back | inflateBack() does a raw inflate with a single call using a call-back | |||
interface for input and output. This is more efficient than inflate() f or | interface for input and output. This is more efficient than inflate() f or | |||
file i/o applications in that it avoids copying between the output and t he | file i/o applications in that it avoids copying between the output and t he | |||
sliding window by simply making the window itself the output buffer. Th is | sliding window by simply making the window itself the output buffer. Th is | |||
function trusts the application to not change the output buffer passed b y | function trusts the application to not change the output buffer passed b y | |||
the output function, at least until inflateBack() returns. | the output function, at least until inflateBack() returns. | |||
inflateBackInit() must be called first to allocate the internal state | inflateBackInit() must be called first to allocate the internal state | |||
and to initialize the state with the user-provided window buffer. | and to initialize the state with the user-provided window buffer. | |||
inflateBack() may then be used multiple times to inflate a complete, raw | inflateBack() may then be used multiple times to inflate a complete, raw | |||
deflate stream with each call. inflateBackEnd() is then called to free | deflate stream with each call. inflateBackEnd() is then called to free | |||
the allocated state. | the | |||
allocated state. | ||||
A raw deflate stream is one with no zlib or gzip header or trailer. | A raw deflate stream is one with no zlib or gzip header or trailer. | |||
This routine would normally be used in a utility that reads zip or gzip | This routine would normally be used in a utility that reads zip or gzip | |||
files and writes out uncompressed files. The utility would decode the | files and writes out uncompressed files. The utility would decode the | |||
header and process the trailer on its own, hence this routine expects | header and process the trailer on its own, hence this routine expects on | |||
only the raw deflate stream to decompress. This is different from the | ly | |||
normal behavior of inflate(), which expects either a zlib or gzip header | the raw deflate stream to decompress. This is different from the normal | |||
and | behavior of inflate(), which expects either a zlib or gzip header and | |||
trailer around the deflate stream. | trailer around the deflate stream. | |||
inflateBack() uses two subroutines supplied by the caller that are the n | inflateBack() uses two subroutines supplied by the caller that are the n | |||
called by inflateBack() for input and output. inflateBack() calls those | called by inflateBack() for input and output. inflateBack() calls those | |||
routines until it reads a complete deflate stream and writes out all of the | routines until it reads a complete deflate stream and writes out all of the | |||
uncompressed data, or until it encounters an error. The function's | uncompressed data, or until it encounters an error. The function's | |||
parameters and return types are defined above in the in_func and out_fun c | parameters and return types are defined above in the in_func and out_fun c | |||
typedefs. inflateBack() will call in(in_desc, &buf) which should return the | typedefs. inflateBack() will call in(in_desc, &buf) which should return the | |||
number of bytes of provided input, and a pointer to that input in buf. If | number of bytes of provided input, and a pointer to that input in buf. If | |||
there is no input available, in() must return zero--buf is ignored in th at | there is no input available, in() must return zero--buf is ignored in th at | |||
skipping to change at line 927 | skipping to change at line 1017 | |||
inflateBackInit(), which is also the buffer that out() uses to write fro m. | inflateBackInit(), which is also the buffer that out() uses to write fro m. | |||
The length written by out() will be at most the window size. Any non-ze ro | The length written by out() will be at most the window size. Any non-ze ro | |||
amount of input may be provided by in(). | amount of input may be provided by in(). | |||
For convenience, inflateBack() can be provided input on the first call by | For convenience, inflateBack() can be provided input on the first call by | |||
setting strm->next_in and strm->avail_in. If that input is exhausted, t hen | setting strm->next_in and strm->avail_in. If that input is exhausted, t hen | |||
in() will be called. Therefore strm->next_in must be initialized before | in() will be called. Therefore strm->next_in must be initialized before | |||
calling inflateBack(). If strm->next_in is Z_NULL, then in() will be ca lled | calling inflateBack(). If strm->next_in is Z_NULL, then in() will be ca lled | |||
immediately for input. If strm->next_in is not Z_NULL, then strm->avail _in | immediately for input. If strm->next_in is not Z_NULL, then strm->avail _in | |||
must also be initialized, and then if strm->avail_in is not zero, input will | must also be initialized, and then if strm->avail_in is not zero, input will | |||
initially be taken from strm->next_in[0 .. strm->avail_in - 1]. | initially be taken from strm->next_in[0 .. strm->avail_in - 1]. | |||
The in_desc and out_desc parameters of inflateBack() is passed as the | The in_desc and out_desc parameters of inflateBack() is passed as the | |||
first parameter of in() and out() respectively when they are called. Th ese | first parameter of in() and out() respectively when they are called. Th ese | |||
descriptors can be optionally used to pass any information that the call er- | descriptors can be optionally used to pass any information that the call er- | |||
supplied in() and out() functions need to do their job. | supplied in() and out() functions need to do their job. | |||
On return, inflateBack() will set strm->next_in and strm->avail_in to | On return, inflateBack() will set strm->next_in and strm->avail_in to | |||
pass back any unused input that was provided by the last in() call. The | pass back any unused input that was provided by the last in() call. The | |||
return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERR OR | return values of inflateBack() can be Z_STREAM_END on success, Z_BUF_ERR OR | |||
if in() or out() returned an error, Z_DATA_ERROR if there was a format | if in() or out() returned an error, Z_DATA_ERROR if there was a format e | |||
error in the deflate stream (in which case strm->msg is set to indicate | rror | |||
the | in the deflate stream (in which case strm->msg is set to indicate the na | |||
nature of the error), or Z_STREAM_ERROR if the stream was not properly | ture | |||
initialized. In the case of Z_BUF_ERROR, an input or output error can b | of the error), or Z_STREAM_ERROR if the stream was not properly initiali | |||
e | zed. | |||
distinguished using strm->next_in which will be Z_NULL only if in() retu | In the case of Z_BUF_ERROR, an input or output error can be distinguishe | |||
rned | d | |||
an error. If strm->next is not Z_NULL, then the Z_BUF_ERROR was due to | using strm->next_in which will be Z_NULL only if in() returned an error. | |||
out() returning non-zero. (in() will always be called before out(), so | If | |||
strm->next_in is assured to be defined if out() returns non-zero.) Note | strm->next_in is not Z_NULL, then the Z_BUF_ERROR was due to out() retur | |||
that inflateBack() cannot return Z_OK. | ning | |||
non-zero. (in() will always be called before out(), so strm->next_in is | ||||
assured to be defined if out() returns non-zero.) Note that inflateBack( | ||||
) | ||||
cannot return Z_OK. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); | ZEXTERN int ZEXPORT inflateBackEnd OF((z_streamp strm)); | |||
/* | /* | |||
All memory allocated by inflateBackInit() is freed. | All memory allocated by inflateBackInit() is freed. | |||
inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the str eam | inflateBackEnd() returns Z_OK on success, or Z_STREAM_ERROR if the str eam | |||
state was inconsistent. | state was inconsistent. | |||
*/ | */ | |||
skipping to change at line 1000 | skipping to change at line 1090 | |||
25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! | 25: 0 = *nprintf, 1 = *printf -- 1 means gzprintf() not secure! | |||
26: 0 = returns value, 1 = void -- 1 means inferred string length retu rned | 26: 0 = returns value, 1 = void -- 1 means inferred string length retu rned | |||
Remainder: | Remainder: | |||
27-31: 0 (reserved) | 27-31: 0 (reserved) | |||
*/ | */ | |||
/* utility functions */ | /* utility functions */ | |||
/* | /* | |||
The following utility functions are implemented on top of the | The following utility functions are implemented on top of the basic | |||
basic stream-oriented functions. To simplify the interface, some | stream-oriented functions. To simplify the interface, some default opti | |||
default options are assumed (compression level and memory usage, | ons | |||
standard memory allocation functions). The source code of these | are assumed (compression level and memory usage, standard memory allocat | |||
utility functions can easily be modified if you need special options. | ion | |||
functions). The source code of these utility functions can be modified | ||||
if | ||||
you need special options. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, | ZEXTERN int ZEXPORT compress OF((Bytef *dest, uLongf *destLen, | |||
const Bytef *source, uLong sourceLen)); | const Bytef *source, uLong sourceLen)); | |||
/* | /* | |||
Compresses the source buffer into the destination buffer. sourceLen i s | Compresses the source buffer into the destination buffer. sourceLen i s | |||
the byte length of the source buffer. Upon entry, destLen is the total | the byte length of the source buffer. Upon entry, destLen is the total | |||
size of the destination buffer, which must be at least the value returne | size | |||
d | of the destination buffer, which must be at least the value returned by | |||
by compressBound(sourceLen). Upon exit, destLen is the actual size of th | compressBound(sourceLen). Upon exit, destLen is the actual size of the | |||
e | ||||
compressed buffer. | compressed buffer. | |||
This function can be used to compress a whole file at once if the | ||||
input file is mmap'ed. | ||||
compress returns Z_OK if success, Z_MEM_ERROR if there was not | compress returns Z_OK if success, Z_MEM_ERROR if there was not | |||
enough memory, Z_BUF_ERROR if there was not enough room in the output | enough memory, Z_BUF_ERROR if there was not enough room in the output | |||
buffer. | buffer. | |||
*/ | */ | |||
ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, | ZEXTERN int ZEXPORT compress2 OF((Bytef *dest, uLongf *destLen, | |||
const Bytef *source, uLong sourceLen, | const Bytef *source, uLong sourceLen, | |||
int level)); | int level)); | |||
/* | /* | |||
Compresses the source buffer into the destination buffer. The level | Compresses the source buffer into the destination buffer. The level | |||
parameter has the same meaning as in deflateInit. sourceLen is the byte | parameter has the same meaning as in deflateInit. sourceLen is the byte | |||
length of the source buffer. Upon entry, destLen is the total size of th e | length of the source buffer. Upon entry, destLen is the total size of t he | |||
destination buffer, which must be at least the value returned by | destination buffer, which must be at least the value returned by | |||
compressBound(sourceLen). Upon exit, destLen is the actual size of the | compressBound(sourceLen). Upon exit, destLen is the actual size of the | |||
compressed buffer. | compressed buffer. | |||
compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough | compress2 returns Z_OK if success, Z_MEM_ERROR if there was not enough | |||
memory, Z_BUF_ERROR if there was not enough room in the output buffer, | memory, Z_BUF_ERROR if there was not enough room in the output buffer, | |||
Z_STREAM_ERROR if the level parameter is invalid. | Z_STREAM_ERROR if the level parameter is invalid. | |||
*/ | */ | |||
ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); | ZEXTERN uLong ZEXPORT compressBound OF((uLong sourceLen)); | |||
/* | /* | |||
compressBound() returns an upper bound on the compressed size after | compressBound() returns an upper bound on the compressed size after | |||
compress() or compress2() on sourceLen bytes. It would be used before | compress() or compress2() on sourceLen bytes. It would be used before a | |||
a compress() or compress2() call to allocate the destination buffer. | compress() or compress2() call to allocate the destination buffer. | |||
*/ | */ | |||
ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, | ZEXTERN int ZEXPORT uncompress OF((Bytef *dest, uLongf *destLen, | |||
const Bytef *source, uLong sourceLen)); | const Bytef *source, uLong sourceLen)); | |||
/* | /* | |||
Decompresses the source buffer into the destination buffer. sourceLen is | Decompresses the source buffer into the destination buffer. sourceLen is | |||
the byte length of the source buffer. Upon entry, destLen is the total | the byte length of the source buffer. Upon entry, destLen is the total | |||
size of the destination buffer, which must be large enough to hold the | size | |||
entire uncompressed data. (The size of the uncompressed data must have | of the destination buffer, which must be large enough to hold the entire | |||
been saved previously by the compressor and transmitted to the decompres | uncompressed data. (The size of the uncompressed data must have been sa | |||
sor | ved | |||
by some mechanism outside the scope of this compression library.) | previously by the compressor and transmitted to the decompressor by some | |||
Upon exit, destLen is the actual size of the compressed buffer. | mechanism outside the scope of this compression library.) Upon exit, des | |||
This function can be used to decompress a whole file at once if the | tLen | |||
input file is mmap'ed. | is the actual size of the uncompressed buffer. | |||
uncompress returns Z_OK if success, Z_MEM_ERROR if there was not | uncompress returns Z_OK if success, Z_MEM_ERROR if there was not | |||
enough memory, Z_BUF_ERROR if there was not enough room in the output | enough memory, Z_BUF_ERROR if there was not enough room in the output | |||
buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. | buffer, or Z_DATA_ERROR if the input data was corrupted or incomplete. | |||
*/ | */ | |||
typedef voidp gzFile; | /* gzip file access functions */ | |||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); | ||||
/* | /* | |||
Opens a gzip (.gz) file for reading or writing. The mode parameter | This library supports reading and writing files in gzip (.gz) format w | |||
is as in fopen ("rb" or "wb") but can also include a compression level | ith | |||
("wb9") or a strategy: 'f' for filtered data as in "wb6f", 'h' for | an interface similar to that of stdio, using the functions that start wi | |||
Huffman only compression as in "wb1h", or 'R' for run-length encoding | th | |||
as in "wb1R". (See the description of deflateInit2 for more information | "gz". The gzip format is different from the zlib format. gzip is a gzi | |||
about the strategy parameter.) | p | |||
wrapper, documented in RFC 1952, wrapped around a deflate stream. | ||||
*/ | ||||
typedef voidp gzFile; /* opaque gzip file descriptor */ | ||||
/* | ||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *path, const char *mode)); | ||||
Opens a gzip (.gz) file for reading or writing. The mode parameter is | ||||
as | ||||
in fopen ("rb" or "wb") but can also include a compression level ("wb9") | ||||
or | ||||
a strategy: 'f' for filtered data as in "wb6f", 'h' for Huffman-only | ||||
compression as in "wb1h", 'R' for run-length encoding as in "wb1R", or ' | ||||
F' | ||||
for fixed code compression as in "wb9F". (See the description of | ||||
deflateInit2 for more information about the strategy parameter.) Also "a | ||||
" | ||||
can be used instead of "w" to request that the gzip stream that will be | ||||
written be appended to the file. "+" will result in an error, since rea | ||||
ding | ||||
and writing to the same gzip file is not supported. | ||||
gzopen can be used to read a file which is not in gzip format; in this | gzopen can be used to read a file which is not in gzip format; in this | |||
case gzread will directly read from the file without decompression. | case gzread will directly read from the file without decompression. | |||
gzopen returns NULL if the file could not be opened or if there was | gzopen returns NULL if the file could not be opened, if there was | |||
insufficient memory to allocate the (de)compression state; errno | insufficient memory to allocate the gzFile state, or if an invalid mode | |||
can be checked to distinguish the two cases (if errno is zero, the | was | |||
zlib error is Z_MEM_ERROR). */ | specified (an 'r', 'w', or 'a' was not provided, or '+' was provided). | |||
errno can be checked to determine if the reason gzopen failed was that t | ||||
he | ||||
file could not be opened. | ||||
*/ | ||||
ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); | ZEXTERN gzFile ZEXPORT gzdopen OF((int fd, const char *mode)); | |||
/* | /* | |||
gzdopen() associates a gzFile with the file descriptor fd. File | gzdopen associates a gzFile with the file descriptor fd. File descrip | |||
descriptors are obtained from calls like open, dup, creat, pipe or | tors | |||
fileno (in the file has been previously opened with fopen). | are obtained from calls like open, dup, creat, pipe or fileno (if the fi | |||
The mode parameter is as in gzopen. | le | |||
The next call of gzclose on the returned gzFile will also close the | has been previously opened with fopen). The mode parameter is as in gzo | |||
file descriptor fd, just like fclose(fdopen(fd), mode) closes the file | pen. | |||
descriptor fd. If you want to keep fd open, use gzdopen(dup(fd), mode). | ||||
gzdopen returns NULL if there was insufficient memory to allocate | The next call of gzclose on the returned gzFile will also close the fi | |||
the (de)compression state. | le | |||
descriptor fd, just like fclose(fdopen(fd, mode)) closes the file descri | ||||
ptor | ||||
fd. If you want to keep fd open, use fd = dup(fd_keep); gz = gzdopen(fd | ||||
, | ||||
mode);. The duplicated descriptor should be saved to avoid a leak, sinc | ||||
e | ||||
gzdopen does not close fd if it fails. | ||||
gzdopen returns NULL if there was insufficient memory to allocate the | ||||
gzFile state, if an invalid mode was specified (an 'r', 'w', or 'a' was | ||||
not | ||||
provided, or '+' was provided), or if fd is -1. The file descriptor is | ||||
not | ||||
used until the next gz* read, write, seek, or close operation, so gzdope | ||||
n | ||||
will not detect if fd is invalid (unless fd is -1). | ||||
*/ | ||||
ZEXTERN int ZEXPORT gzbuffer OF((gzFile file, unsigned size)); | ||||
/* | ||||
Set the internal buffer size used by this library's functions. The | ||||
default buffer size is 8192 bytes. This function must be called after | ||||
gzopen() or gzdopen(), and before any other calls that read or write the | ||||
file. The buffer memory allocation is always deferred to the first read | ||||
or | ||||
write. Two buffers are allocated, either both of the specified size whe | ||||
n | ||||
writing, or one of the specified size and the other twice that size when | ||||
reading. A larger buffer size of, for example, 64K or 128K bytes will | ||||
noticeably increase the speed of decompression (reading). | ||||
The new buffer size also affects the maximum length for gzprintf(). | ||||
gzbuffer() returns 0 on success, or -1 on failure, such as being calle | ||||
d | ||||
too late. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); | ZEXTERN int ZEXPORT gzsetparams OF((gzFile file, int level, int strategy)); | |||
/* | /* | |||
Dynamically update the compression level or strategy. See the descript ion | Dynamically update the compression level or strategy. See the descrip tion | |||
of deflateInit2 for the meaning of these parameters. | of deflateInit2 for the meaning of these parameters. | |||
gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not | gzsetparams returns Z_OK if success, or Z_STREAM_ERROR if the file was not | |||
opened for writing. | opened for writing. | |||
*/ | */ | |||
ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); | ZEXTERN int ZEXPORT gzread OF((gzFile file, voidp buf, unsigned len)); | |||
/* | /* | |||
Reads the given number of uncompressed bytes from the compressed file. | Reads the given number of uncompressed bytes from the compressed file. | |||
If the input file was not in gzip format, gzread copies the given number | If | |||
of bytes into the buffer. | the input file was not in gzip format, gzread copies the given number of | |||
gzread returns the number of uncompressed bytes actually read (0 for | bytes into the buffer. | |||
end of file, -1 for error). */ | ||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, | After reaching the end of a gzip stream in the input, gzread will cont | |||
voidpc buf, unsigned len)); | inue | |||
to read, looking for another gzip stream, or failing that, reading the r | ||||
est | ||||
of the input file directly without decompression. The entire input file | ||||
will be read if gzread is called until it returns less than the requeste | ||||
d | ||||
len. | ||||
gzread returns the number of uncompressed bytes actually read, less th | ||||
an | ||||
len for end of file, or -1 for error. | ||||
*/ | ||||
ZEXTERN int ZEXPORT gzwrite OF((gzFile file, | ||||
voidpc buf, unsigned len)); | ||||
/* | /* | |||
Writes the given number of uncompressed bytes into the compressed file . | Writes the given number of uncompressed bytes into the compressed file . | |||
gzwrite returns the number of uncompressed bytes actually written | gzwrite returns the number of uncompressed bytes written or 0 in case of | |||
(0 in case of error). | error. | |||
*/ | */ | |||
ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)) ; | ZEXTERN int ZEXPORTVA gzprintf OF((gzFile file, const char *format, ...)); | |||
/* | /* | |||
Converts, formats, and writes the args to the compressed file under | Converts, formats, and writes the arguments to the compressed file und | |||
control of the format string, as in fprintf. gzprintf returns the number | er | |||
of | control of the format string, as in fprintf. gzprintf returns the numbe | |||
uncompressed bytes actually written (0 in case of error). The number of | r of | |||
uncompressed bytes written is limited to 4095. The caller should assure | uncompressed bytes actually written, or 0 in case of error. The number | |||
that | of | |||
this limit is not exceeded. If it is exceeded, then gzprintf() will retu | uncompressed bytes written is limited to 8191, or one less than the buff | |||
rn | er | |||
return an error (0) with nothing written. In this case, there may also b | size given to gzbuffer(). The caller should assure that this limit is n | |||
e a | ot | |||
buffer overflow with unpredictable consequences, which is possible only | exceeded. If it is exceeded, then gzprintf() will return an error (0) w | |||
if | ith | |||
zlib was compiled with the insecure functions sprintf() or vsprintf() | nothing written. In this case, there may also be a buffer overflow with | |||
because the secure snprintf() or vsnprintf() functions were not availabl | unpredictable consequences, which is possible only if zlib was compiled | |||
e. | with | |||
the insecure functions sprintf() or vsprintf() because the secure snprin | ||||
tf() | ||||
or vsnprintf() functions were not available. This can be determined usi | ||||
ng | ||||
zlibCompileFlags(). | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); | ZEXTERN int ZEXPORT gzputs OF((gzFile file, const char *s)); | |||
/* | /* | |||
Writes the given null-terminated string to the compressed file, exclu ding | Writes the given null-terminated string to the compressed file, exclud ing | |||
the terminating null character. | the terminating null character. | |||
gzputs returns the number of characters written, or -1 in case of err | ||||
or. | gzputs returns the number of characters written, or -1 in case of erro | |||
r. | ||||
*/ | */ | |||
ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); | ZEXTERN char * ZEXPORT gzgets OF((gzFile file, char *buf, int len)); | |||
/* | /* | |||
Reads bytes from the compressed file until len-1 characters are read, | Reads bytes from the compressed file until len-1 characters are read, | |||
or | or a | |||
a newline character is read and transferred to buf, or an end-of-file | newline character is read and transferred to buf, or an end-of-file | |||
condition is encountered. The string is then terminated with a null | condition is encountered. If any characters are read or if len == 1, th | |||
character. | e | |||
gzgets returns buf, or Z_NULL in case of error. | string is terminated with a null character. If no characters are read d | |||
ue | ||||
to an end-of-file or len < 1, then the buffer is left untouched. | ||||
gzgets returns buf which is a null-terminated string, or it returns NU | ||||
LL | ||||
for end-of-file or in case of error. If there was an error, the content | ||||
s at | ||||
buf are indeterminate. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); | ZEXTERN int ZEXPORT gzputc OF((gzFile file, int c)); | |||
/* | /* | |||
Writes c, converted to an unsigned char, into the compressed file. | Writes c, converted to an unsigned char, into the compressed file. gz | |||
gzputc returns the value that was written, or -1 in case of error. | putc | |||
returns the value that was written, or -1 in case of error. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); | ZEXTERN int ZEXPORT gzgetc OF((gzFile file)); | |||
/* | /* | |||
Reads one byte from the compressed file. gzgetc returns this byte | Reads one byte from the compressed file. gzgetc returns this byte or | |||
or -1 in case of end of file or error. | -1 | |||
in case of end of file or error. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); | ZEXTERN int ZEXPORT gzungetc OF((int c, gzFile file)); | |||
/* | /* | |||
Push one character back onto the stream to be read again later. | Push one character back onto the stream to be read as the first charac | |||
Only one character of push-back is allowed. gzungetc() returns the | ter | |||
character pushed, or -1 on failure. gzungetc() will fail if a | on the next read. At least one character of push-back is allowed. | |||
character has been pushed but not read yet, or if c is -1. The pushed | gzungetc() returns the character pushed, or -1 on failure. gzungetc() w | |||
character will be discarded if the stream is repositioned with gzseek() | ill | |||
or gzrewind(). | fail if c is -1, and may fail if a character has been pushed but not rea | |||
d | ||||
yet. If gzungetc is used immediately after gzopen or gzdopen, at least | ||||
the | ||||
output buffer size of pushed characters is allowed. (See gzbuffer above | ||||
.) | ||||
The pushed character will be discarded if the stream is repositioned wit | ||||
h | ||||
gzseek() or gzrewind(). | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); | ZEXTERN int ZEXPORT gzflush OF((gzFile file, int flush)); | |||
/* | /* | |||
Flushes all pending output into the compressed file. The parameter | Flushes all pending output into the compressed file. The parameter fl | |||
flush is as in the deflate() function. The return value is the zlib | ush | |||
error number (see function gzerror below). gzflush returns Z_OK if | is as in the deflate() function. The return value is the zlib error num | |||
the flush parameter is Z_FINISH and all output could be flushed. | ber | |||
gzflush should be called only when strictly necessary because it can | (see function gzerror below). gzflush is only permitted when writing. | |||
degrade compression. | ||||
If the flush parameter is Z_FINISH, the remaining data is written and | ||||
the | ||||
gzip stream is completed in the output. If gzwrite() is called again, a | ||||
new | ||||
gzip stream will be started in the output. gzread() is able to read suc | ||||
h | ||||
concatented gzip streams. | ||||
gzflush should be called only when strictly necessary because it will | ||||
degrade compression if called too often. | ||||
*/ | */ | |||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, | ||||
z_off_t offset, int whence)); | ||||
/* | /* | |||
Sets the starting position for the next gzread or gzwrite on the | ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile file, | |||
given compressed file. The offset represents a number of bytes in the | z_off_t offset, int whence)); | |||
uncompressed data stream. The whence parameter is defined as in lseek(2) | ||||
; | Sets the starting position for the next gzread or gzwrite on the given | |||
compressed file. The offset represents a number of bytes in the | ||||
uncompressed data stream. The whence parameter is defined as in lseek(2 | ||||
); | ||||
the value SEEK_END is not supported. | the value SEEK_END is not supported. | |||
If the file is opened for reading, this function is emulated but can b e | If the file is opened for reading, this function is emulated but can b e | |||
extremely slow. If the file is opened for writing, only forward seeks ar e | extremely slow. If the file is opened for writing, only forward seeks a re | |||
supported; gzseek then compresses a sequence of zeroes up to the new | supported; gzseek then compresses a sequence of zeroes up to the new | |||
starting position. | starting position. | |||
gzseek returns the resulting offset location as measured in bytes fro m | gzseek returns the resulting offset location as measured in bytes from | |||
the beginning of the uncompressed stream, or -1 in case of error, in | the beginning of the uncompressed stream, or -1 in case of error, in | |||
particular if the file is opened for writing and the new starting positi on | particular if the file is opened for writing and the new starting positi on | |||
would be before the current position. | would be before the current position. | |||
*/ | */ | |||
ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); | ZEXTERN int ZEXPORT gzrewind OF((gzFile file)); | |||
/* | /* | |||
Rewinds the given file. This function is supported only for reading. | Rewinds the given file. This function is supported only for reading. | |||
gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) | gzrewind(file) is equivalent to (int)gzseek(file, 0L, SEEK_SET) | |||
*/ | */ | |||
/* | ||||
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); | ZEXTERN z_off_t ZEXPORT gztell OF((gzFile file)); | |||
Returns the starting position for the next gzread or gzwrite on the gi | ||||
ven | ||||
compressed file. This position represents a number of bytes in the | ||||
uncompressed data stream, and is zero when starting, even if appending o | ||||
r | ||||
reading a gzip stream from the middle of a file using gzdopen(). | ||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) | ||||
*/ | ||||
/* | /* | |||
Returns the starting position for the next gzread or gzwrite on the | ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile file)); | |||
given compressed file. This position represents a number of bytes in the | ||||
uncompressed data stream. | ||||
gztell(file) is equivalent to gzseek(file, 0L, SEEK_CUR) | Returns the current offset in the file being read or written. This of | |||
fset | ||||
includes the count of bytes that precede the gzip stream, for example wh | ||||
en | ||||
appending or when using gzdopen() for reading. When reading, the offset | ||||
does not include as yet unused buffered input. This information can be | ||||
used | ||||
for a progress indicator. On error, gzoffset() returns -1. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT gzeof OF((gzFile file)); | ZEXTERN int ZEXPORT gzeof OF((gzFile file)); | |||
/* | /* | |||
Returns 1 when EOF has previously been detected reading the given | Returns true (1) if the end-of-file indicator has been set while readi | |||
input stream, otherwise zero. | ng, | |||
false (0) otherwise. Note that the end-of-file indicator is set only if | ||||
the | ||||
read tried to go past the end of the input, but came up short. Therefor | ||||
e, | ||||
just like feof(), gzeof() may return false even if there is no more data | ||||
to | ||||
read, in the event that the last read request was for the exact number o | ||||
f | ||||
bytes remaining in the input file. This will happen if the input file s | ||||
ize | ||||
is an exact multiple of the buffer size. | ||||
If gzeof() returns true, then the read functions will return no more d | ||||
ata, | ||||
unless the end-of-file indicator is reset by gzclearerr() and the input | ||||
file | ||||
has grown since the previous end of file was detected. | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); | ZEXTERN int ZEXPORT gzdirect OF((gzFile file)); | |||
/* | /* | |||
Returns 1 if file is being read directly without decompression, otherw | Returns true (1) if file is being copied directly while reading, or fa | |||
ise | lse | |||
zero. | (0) if file is a gzip stream being decompressed. This state can change | |||
from | ||||
false to true while reading the input file if the end of a gzip stream i | ||||
s | ||||
reached, but is followed by data that is not another gzip stream. | ||||
If the input file is empty, gzdirect() will return true, since the inp | ||||
ut | ||||
does not contain a gzip stream. | ||||
If gzdirect() is used immediately after gzopen() or gzdopen() it will | ||||
cause buffers to be allocated to allow reading the file to determine if | ||||
it | ||||
is a gzip file. Therefore if gzbuffer() is used, it should be called be | ||||
fore | ||||
gzdirect(). | ||||
*/ | */ | |||
ZEXTERN int ZEXPORT gzclose OF((gzFile file)); | ZEXTERN int ZEXPORT gzclose OF((gzFile file)); | |||
/* | /* | |||
Flushes all pending output if necessary, closes the compressed file | Flushes all pending output if necessary, closes the compressed file an | |||
and deallocates all the (de)compression state. The return value is the z | d | |||
lib | deallocates the (de)compression state. Note that once file is closed, y | |||
error number (see function gzerror below). | ou | |||
cannot call gzerror with file, since its structures have been deallocate | ||||
d. | ||||
gzclose must not be called more than once on the same file, just as free | ||||
must not be called more than once on the same allocation. | ||||
gzclose will return Z_STREAM_ERROR if file is not valid, Z_ERRNO on a | ||||
file operation error, or Z_OK on success. | ||||
*/ | ||||
ZEXTERN int ZEXPORT gzclose_r OF((gzFile file)); | ||||
ZEXTERN int ZEXPORT gzclose_w OF((gzFile file)); | ||||
/* | ||||
Same as gzclose(), but gzclose_r() is only for use when reading, and | ||||
gzclose_w() is only for use when writing or appending. The advantage to | ||||
using these instead of gzclose() is that they avoid linking in zlib | ||||
compression or decompression code that is not used when only reading or | ||||
only | ||||
writing respectively. If gzclose() is used, then both compression and | ||||
decompression code will be included the application when linking to a st | ||||
atic | ||||
zlib library. | ||||
*/ | */ | |||
ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); | ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); | |||
/* | /* | |||
Returns the error message for the last error which occurred on the | Returns the error message for the last error which occurred on the giv | |||
given compressed file. errnum is set to zlib error number. If an | en | |||
error occurred in the file system and not in the compression library, | compressed file. errnum is set to zlib error number. If an error occur | |||
errnum is set to Z_ERRNO and the application may consult errno | red | |||
to get the exact error code. | in the file system and not in the compression library, errnum is set to | |||
Z_ERRNO and the application may consult errno to get the exact error cod | ||||
e. | ||||
The application must not modify the returned string. Future calls to | ||||
this function may invalidate the previously returned string. If file is | ||||
closed, then the string previously returned by gzerror will no longer be | ||||
available. | ||||
gzerror() should be used to distinguish errors from end-of-file for th | ||||
ose | ||||
functions above that do not distinguish those cases in their return valu | ||||
es. | ||||
*/ | */ | |||
ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); | ZEXTERN void ZEXPORT gzclearerr OF((gzFile file)); | |||
/* | /* | |||
Clears the error and end-of-file flags for file. This is analogous to | Clears the error and end-of-file flags for file. This is analogous to | |||
the | the | |||
clearerr() function in stdio. This is useful for continuing to read a gz | clearerr() function in stdio. This is useful for continuing to read a g | |||
ip | zip | |||
file that is being written concurrently. | file that is being written concurrently. | |||
*/ | */ | |||
/* checksum functions */ | /* checksum functions */ | |||
/* | /* | |||
These functions are not related to compression but are exported | These functions are not related to compression but are exported | |||
anyway because they might be useful in applications using the | anyway because they might be useful in applications using the compressio | |||
compression library. | n | |||
library. | ||||
*/ | */ | |||
ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)) ; | ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)) ; | |||
/* | /* | |||
Update a running Adler-32 checksum with the bytes buf[0..len-1] and | Update a running Adler-32 checksum with the bytes buf[0..len-1] and | |||
return the updated checksum. If buf is NULL, this function returns | return the updated checksum. If buf is Z_NULL, this function returns th | |||
the required initial value for the checksum. | e | |||
An Adler-32 checksum is almost as reliable as a CRC32 but can be compute | required initial value for the checksum. | |||
d | ||||
much faster. Usage example: | An Adler-32 checksum is almost as reliable as a CRC32 but can be compu | |||
ted | ||||
much faster. | ||||
Usage example: | ||||
uLong adler = adler32(0L, Z_NULL, 0); | uLong adler = adler32(0L, Z_NULL, 0); | |||
while (read_buffer(buffer, length) != EOF) { | while (read_buffer(buffer, length) != EOF) { | |||
adler = adler32(adler, buffer, length); | adler = adler32(adler, buffer, length); | |||
} | } | |||
if (adler != original_adler) error(); | if (adler != original_adler) error(); | |||
*/ | */ | |||
/* | ||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, | ZEXTERN uLong ZEXPORT adler32_combine OF((uLong adler1, uLong adler2, | |||
z_off_t len2)); | z_off_t len2)); | |||
/* | ||||
Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 | Combine two Adler-32 checksums into one. For two sequences of bytes, seq1 | |||
and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for | and seq2 with lengths len1 and len2, Adler-32 checksums were calculated for | |||
each, adler1 and adler2. adler32_combine() returns the Adler-32 checksu m of | each, adler1 and adler2. adler32_combine() returns the Adler-32 checksu m of | |||
seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. | seq1 and seq2 concatenated, requiring only adler1, adler2, and len2. | |||
*/ | */ | |||
ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); | ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); | |||
/* | /* | |||
Update a running CRC-32 with the bytes buf[0..len-1] and return the | Update a running CRC-32 with the bytes buf[0..len-1] and return the | |||
updated CRC-32. If buf is NULL, this function returns the required initi | updated CRC-32. If buf is Z_NULL, this function returns the required | |||
al | initial value for the for the crc. Pre- and post-conditioning (one's | |||
value for the for the crc. Pre- and post-conditioning (one's complement) | complement) is performed within this function so it shouldn't be done by | |||
is | the | |||
performed within this function so it shouldn't be done by the applicatio | application. | |||
n. | ||||
Usage example: | Usage example: | |||
uLong crc = crc32(0L, Z_NULL, 0); | uLong crc = crc32(0L, Z_NULL, 0); | |||
while (read_buffer(buffer, length) != EOF) { | while (read_buffer(buffer, length) != EOF) { | |||
crc = crc32(crc, buffer, length); | crc = crc32(crc, buffer, length); | |||
} | } | |||
if (crc != original_crc) error(); | if (crc != original_crc) error(); | |||
*/ | */ | |||
/* | ||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len 2)); | ZEXTERN uLong ZEXPORT crc32_combine OF((uLong crc1, uLong crc2, z_off_t len 2)); | |||
/* | ||||
Combine two CRC-32 check values into one. For two sequences of bytes, | Combine two CRC-32 check values into one. For two sequences of bytes, | |||
seq1 and seq2 with lengths len1 and len2, CRC-32 check values were | seq1 and seq2 with lengths len1 and len2, CRC-32 check values were | |||
calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 | calculated for each, crc1 and crc2. crc32_combine() returns the CRC-32 | |||
check value of seq1 and seq2 concatenated, requiring only crc1, crc2, an d | check value of seq1 and seq2 concatenated, requiring only crc1, crc2, an d | |||
len2. | len2. | |||
*/ | */ | |||
/* various hacks, don't look :) */ | /* various hacks, don't look :) */ | |||
/* deflateInit and inflateInit are macros to allow checking the zlib versio n | /* deflateInit and inflateInit are macros to allow checking the zlib versio n | |||
skipping to change at line 1338 | skipping to change at line 1549 | |||
deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) | deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) | |||
#define inflateInit(strm) \ | #define inflateInit(strm) \ | |||
inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) | inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) | |||
#define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ | #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ | |||
deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ | deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ | |||
(strategy), ZLIB_VERSION, sizeof(z_stream)) | (strategy), ZLIB_VERSION, sizeof(z_stream)) | |||
#define inflateInit2(strm, windowBits) \ | #define inflateInit2(strm, windowBits) \ | |||
inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) | inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) | |||
#define inflateBackInit(strm, windowBits, window) \ | #define inflateBackInit(strm, windowBits, window) \ | |||
inflateBackInit_((strm), (windowBits), (window), \ | inflateBackInit_((strm), (windowBits), (window), \ | |||
ZLIB_VERSION, sizeof(z_stream)) | ZLIB_VERSION, sizeof(z_stream)) | |||
/* provide 64-bit offset functions if _LARGEFILE64_SOURCE defined, and/or | ||||
* change the regular functions to 64 bits if _FILE_OFFSET_BITS is 64 (if | ||||
* both are true, the application gets the *64 functions, and the regular | ||||
* functions are changed to 64 bits) -- in case these are set on systems | ||||
* without large file support, _LFS64_LARGEFILE must also be true | ||||
*/ | ||||
#if defined(_LARGEFILE64_SOURCE) && _LFS64_LARGEFILE-0 | ||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); | ||||
ZEXTERN z_off64_t ZEXPORT gzseek64 OF((gzFile, z_off64_t, int)); | ||||
ZEXTERN z_off64_t ZEXPORT gztell64 OF((gzFile)); | ||||
ZEXTERN z_off64_t ZEXPORT gzoffset64 OF((gzFile)); | ||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off64_t)); | ||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off64_t)); | ||||
#endif | ||||
#if !defined(ZLIB_INTERNAL) && _FILE_OFFSET_BITS-0 == 64 && _LFS64_LARGEFIL | ||||
E-0 | ||||
#ifdef gzopen | ||||
#undef gzopen | ||||
#endif | ||||
#ifdef gzseek | ||||
#undef gzseek | ||||
#endif | ||||
#ifdef gztell | ||||
#undef gztell | ||||
#endif | ||||
#ifdef gzoffset | ||||
#undef gzoffset | ||||
#endif | ||||
#ifdef adler32_combine | ||||
#undef adler32_combine | ||||
#endif | ||||
#ifdef crc32_combine | ||||
#undef crc32_combine | ||||
#endif | ||||
# define gzopen gzopen64 | ||||
# define gzseek gzseek64 | ||||
# define gztell gztell64 | ||||
# define gzoffset gzoffset64 | ||||
# define adler32_combine adler32_combine64 | ||||
# define crc32_combine crc32_combine64 | ||||
# ifdef _LARGEFILE64_SOURCE | ||||
ZEXTERN gzFile ZEXPORT gzopen64 OF((const char *, const char *)); | ||||
ZEXTERN z_off_t ZEXPORT gzseek64 OF((gzFile, z_off_t, int)); | ||||
ZEXTERN z_off_t ZEXPORT gztell64 OF((gzFile)); | ||||
ZEXTERN z_off_t ZEXPORT gzoffset64 OF((gzFile)); | ||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); | ||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); | ||||
# endif | ||||
#else | ||||
ZEXTERN gzFile ZEXPORT gzopen OF((const char *, const char *)); | ||||
ZEXTERN z_off_t ZEXPORT gzseek OF((gzFile, z_off_t, int)); | ||||
ZEXTERN z_off_t ZEXPORT gztell OF((gzFile)); | ||||
ZEXTERN z_off_t ZEXPORT gzoffset OF((gzFile)); | ||||
ZEXTERN uLong ZEXPORT adler32_combine OF((uLong, uLong, z_off_t)); | ||||
ZEXTERN uLong ZEXPORT crc32_combine OF((uLong, uLong, z_off_t)); | ||||
#endif | ||||
/* hack for buggy compilers */ | ||||
#if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) | #if !defined(ZUTIL_H) && !defined(NO_DUMMY_DECL) | |||
struct internal_state {int dummy;}; /* hack for buggy compilers */ | struct internal_state {int dummy;}; | |||
#endif | #endif | |||
/* undocumented functions */ | ||||
ZEXTERN const char * ZEXPORT zError OF((int)); | ZEXTERN const char * ZEXPORT zError OF((int)); | |||
ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); | ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp)); | |||
ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); | ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); | |||
ZEXTERN int ZEXPORT inflateUndermine OF((z_streamp, int)); | ||||
#ifdef __cplusplus | #ifdef __cplusplus | |||
} | } | |||
#endif | #endif | |||
#endif /* ZLIB_H */ | #endif /* ZLIB_H */ | |||
End of changes. 187 change blocks. | ||||
539 lines changed or deleted | 995 lines changed or added | |||
zutil.h | zutil.h | |||
---|---|---|---|---|
/* zutil.h -- internal interface and configuration of the compression libra ry | /* zutil.h -- internal interface and configuration of the compression libra ry | |||
* Copyright (C) 1995-2005 Jean-loup Gailly. | * Copyright (C) 1995-2010 Jean-loup Gailly. | |||
* For conditions of distribution and use, see copyright notice in zlib.h | * For conditions of distribution and use, see copyright notice in zlib.h | |||
*/ | */ | |||
/* WARNING: this file should *not* be used by applications. It is | /* WARNING: this file should *not* be used by applications. It is | |||
part of the implementation of the compression library and is | part of the implementation of the compression library and is | |||
subject to change. Applications should only use zlib.h. | subject to change. Applications should only use zlib.h. | |||
*/ | */ | |||
/* @(#) $Id$ */ | /* @(#) $Id$ */ | |||
#ifndef ZUTIL_H | #ifndef ZUTIL_H | |||
#define ZUTIL_H | #define ZUTIL_H | |||
#define ZLIB_INTERNAL | #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) && !defined(NO_VIZ) | |||
# define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) | ||||
#else | ||||
# define ZLIB_INTERNAL | ||||
#endif | ||||
#include "zlib.h" | #include "zlib.h" | |||
#ifdef STDC | #ifdef STDC | |||
# ifndef _WIN32_WCE | # if !(defined(_WIN32_WCE) && defined(_MSC_VER)) | |||
# include <stddef.h> | # include <stddef.h> | |||
# endif | # endif | |||
# include <string.h> | # include <string.h> | |||
# include <stdlib.h> | # include <stdlib.h> | |||
#endif | #endif | |||
#ifdef NO_ERRNO_H | ||||
# ifdef _WIN32_WCE | ||||
/* The Microsoft C Run-Time Library for Windows CE doesn't have | ||||
* errno. We define it as a global variable to simplify porting. | ||||
* Its value is always 0 and should not be used. We rename it to | ||||
* avoid conflict with other libraries that use the same workaround. | ||||
*/ | ||||
# define errno z_errno | ||||
# endif | ||||
extern int errno; | ||||
#else | ||||
# ifndef _WIN32_WCE | ||||
# include <errno.h> | ||||
# endif | ||||
#endif | ||||
#ifndef local | #ifndef local | |||
# define local static | # define local static | |||
#endif | #endif | |||
/* compile with -Dlocal if your debugger can't find static symbols */ | /* compile with -Dlocal if your debugger can't find static symbols */ | |||
typedef unsigned char uch; | typedef unsigned char uch; | |||
typedef uch FAR uchf; | typedef uch FAR uchf; | |||
typedef unsigned short ush; | typedef unsigned short ush; | |||
typedef ush FAR ushf; | typedef ush FAR ushf; | |||
skipping to change at line 92 | skipping to change at line 82 | |||
#define MAX_MATCH 258 | #define MAX_MATCH 258 | |||
/* The minimum and maximum match lengths */ | /* The minimum and maximum match lengths */ | |||
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ | #define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */ | |||
/* target dependencies */ | /* target dependencies */ | |||
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) | #if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32)) | |||
# define OS_CODE 0x00 | # define OS_CODE 0x00 | |||
# if defined(__TURBOC__) || defined(__BORLANDC__) | # if defined(__TURBOC__) || defined(__BORLANDC__) | |||
# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) | # if (__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__)) | |||
/* Allow compilation with ANSI keywords only enabled */ | /* Allow compilation with ANSI keywords only enabled */ | |||
void _Cdecl farfree( void *block ); | void _Cdecl farfree( void *block ); | |||
void *_Cdecl farmalloc( unsigned long nbytes ); | void *_Cdecl farmalloc( unsigned long nbytes ); | |||
# else | # else | |||
# include <alloc.h> | # include <alloc.h> | |||
# endif | # endif | |||
# else /* MSC or DJGPP */ | # else /* MSC or DJGPP */ | |||
# include <malloc.h> | # include <malloc.h> | |||
# endif | # endif | |||
#endif | #endif | |||
skipping to change at line 121 | skipping to change at line 111 | |||
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") | fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512") | |||
#endif | #endif | |||
#if defined(ATARI) || defined(atarist) | #if defined(ATARI) || defined(atarist) | |||
# define OS_CODE 0x05 | # define OS_CODE 0x05 | |||
#endif | #endif | |||
#ifdef OS2 | #ifdef OS2 | |||
# define OS_CODE 0x06 | # define OS_CODE 0x06 | |||
# ifdef M_I86 | # ifdef M_I86 | |||
#include <malloc.h> | # include <malloc.h> | |||
# endif | # endif | |||
#endif | #endif | |||
#if defined(MACOS) || defined(TARGET_OS_MAC) | #if defined(MACOS) || defined(TARGET_OS_MAC) | |||
# define OS_CODE 0x07 | # define OS_CODE 0x07 | |||
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_o s | # if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_o s | |||
# include <unix.h> /* for fdopen */ | # include <unix.h> /* for fdopen */ | |||
# else | # else | |||
# ifndef fdopen | # ifndef fdopen | |||
# define fdopen(fd,mode) NULL /* No fdopen() */ | # define fdopen(fd,mode) NULL /* No fdopen() */ | |||
skipping to change at line 154 | skipping to change at line 144 | |||
#endif | #endif | |||
#ifdef __50SERIES /* Prime/PRIMOS */ | #ifdef __50SERIES /* Prime/PRIMOS */ | |||
# define OS_CODE 0x0f | # define OS_CODE 0x0f | |||
#endif | #endif | |||
#if defined(_BEOS_) || defined(RISCOS) | #if defined(_BEOS_) || defined(RISCOS) | |||
# define fdopen(fd,mode) NULL /* No fdopen() */ | # define fdopen(fd,mode) NULL /* No fdopen() */ | |||
#endif | #endif | |||
#if (defined(_MSC_VER) && (_MSC_VER > 600)) | #if (defined(_MSC_VER) && (_MSC_VER > 600)) && !defined __INTERIX | |||
# if defined(_WIN32_WCE) | # if defined(_WIN32_WCE) | |||
# define fdopen(fd,mode) NULL /* No fdopen() */ | # define fdopen(fd,mode) NULL /* No fdopen() */ | |||
# ifndef _PTRDIFF_T_DEFINED | # ifndef _PTRDIFF_T_DEFINED | |||
typedef int ptrdiff_t; | typedef int ptrdiff_t; | |||
# define _PTRDIFF_T_DEFINED | # define _PTRDIFF_T_DEFINED | |||
# endif | # endif | |||
# else | # else | |||
# define fdopen(fd,type) _fdopen(fd,type) | # define fdopen(fd,type) _fdopen(fd,type) | |||
# endif | # endif | |||
#endif | #endif | |||
#if defined(__BORLANDC__) | ||||
#pragma warn -8004 | ||||
#pragma warn -8008 | ||||
#pragma warn -8066 | ||||
#endif | ||||
/* provide prototypes for these when building zlib without LFS */ | ||||
#if !defined(_LARGEFILE64_SOURCE) || _LFS64_LARGEFILE-0 == 0 | ||||
ZEXTERN uLong ZEXPORT adler32_combine64 OF((uLong, uLong, z_off_t)); | ||||
ZEXTERN uLong ZEXPORT crc32_combine64 OF((uLong, uLong, z_off_t)); | ||||
#endif | ||||
/* common defaults */ | /* common defaults */ | |||
#ifndef OS_CODE | #ifndef OS_CODE | |||
# define OS_CODE 0x03 /* assume Unix */ | # define OS_CODE 0x03 /* assume Unix */ | |||
#endif | #endif | |||
#ifndef F_OPEN | #ifndef F_OPEN | |||
# define F_OPEN(name, mode) fopen((name), (mode)) | # define F_OPEN(name, mode) fopen((name), (mode)) | |||
#endif | #endif | |||
skipping to change at line 199 | skipping to change at line 201 | |||
# ifdef MSDOS | # ifdef MSDOS | |||
/* vsnprintf may exist on some MS-DOS compilers (DJGPP?), | /* vsnprintf may exist on some MS-DOS compilers (DJGPP?), | |||
but for now we just assume it doesn't. */ | but for now we just assume it doesn't. */ | |||
# define NO_vsnprintf | # define NO_vsnprintf | |||
# endif | # endif | |||
# ifdef __TURBOC__ | # ifdef __TURBOC__ | |||
# define NO_vsnprintf | # define NO_vsnprintf | |||
# endif | # endif | |||
# ifdef WIN32 | # ifdef WIN32 | |||
/* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ | /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */ | |||
# if defined _MSC_VER && _MSC_VER < 1300 | # if !defined(vsnprintf) && !defined(NO_vsnprintf) | |||
# if !defined(vsnprintf) && !defined(NO_vsnprintf) | # if !defined(_MSC_VER) || ( defined(_MSC_VER) && _MSC_VER < 1500 ) | |||
# define vsnprintf _vsnprintf | # define vsnprintf _vsnprintf | |||
# endif | # endif | |||
# else | # endif | |||
# define HAVE_VSNPRINTF | ||||
# endif | ||||
# endif | # endif | |||
# ifdef __SASC | # ifdef __SASC | |||
# define NO_vsnprintf | # define NO_vsnprintf | |||
# endif | # endif | |||
#endif | #endif | |||
#ifdef VMS | #ifdef VMS | |||
# define NO_vsnprintf | # define NO_vsnprintf | |||
#endif | #endif | |||
#if defined(pyr) | #if defined(pyr) | |||
skipping to change at line 239 | skipping to change at line 239 | |||
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */ | # ifdef SMALL_MEDIUM /* MSDOS small or medium model */ | |||
# define zmemcpy _fmemcpy | # define zmemcpy _fmemcpy | |||
# define zmemcmp _fmemcmp | # define zmemcmp _fmemcmp | |||
# define zmemzero(dest, len) _fmemset(dest, 0, len) | # define zmemzero(dest, len) _fmemset(dest, 0, len) | |||
# else | # else | |||
# define zmemcpy memcpy | # define zmemcpy memcpy | |||
# define zmemcmp memcmp | # define zmemcmp memcmp | |||
# define zmemzero(dest, len) memset(dest, 0, len) | # define zmemzero(dest, len) memset(dest, 0, len) | |||
# endif | # endif | |||
#else | #else | |||
extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len)); | void ZLIB_INTERNAL zmemcpy OF((Bytef* dest, const Bytef* source, uInt le | |||
extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len)); | n)); | |||
extern void zmemzero OF((Bytef* dest, uInt len)); | int ZLIB_INTERNAL zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len | |||
)); | ||||
void ZLIB_INTERNAL zmemzero OF((Bytef* dest, uInt len)); | ||||
#endif | #endif | |||
/* Diagnostic functions */ | /* Diagnostic functions */ | |||
#ifdef DEBUG | #ifdef DEBUG | |||
# include <stdio.h> | # include <stdio.h> | |||
extern int z_verbose; | extern int ZLIB_INTERNAL z_verbose; | |||
extern void z_error OF((char *m)); | extern void ZLIB_INTERNAL z_error OF((char *m)); | |||
# define Assert(cond,msg) {if(!(cond)) z_error(msg);} | # define Assert(cond,msg) {if(!(cond)) z_error(msg);} | |||
# define Trace(x) {if (z_verbose>=0) fprintf x ;} | # define Trace(x) {if (z_verbose>=0) fprintf x ;} | |||
# define Tracev(x) {if (z_verbose>0) fprintf x ;} | # define Tracev(x) {if (z_verbose>0) fprintf x ;} | |||
# define Tracevv(x) {if (z_verbose>1) fprintf x ;} | # define Tracevv(x) {if (z_verbose>1) fprintf x ;} | |||
# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} | # define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;} | |||
# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} | # define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;} | |||
#else | #else | |||
# define Assert(cond,msg) | # define Assert(cond,msg) | |||
# define Trace(x) | # define Trace(x) | |||
# define Tracev(x) | # define Tracev(x) | |||
# define Tracevv(x) | # define Tracevv(x) | |||
# define Tracec(c,x) | # define Tracec(c,x) | |||
# define Tracecv(c,x) | # define Tracecv(c,x) | |||
#endif | #endif | |||
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size)); | voidpf ZLIB_INTERNAL zcalloc OF((voidpf opaque, unsigned items, | |||
void zcfree OF((voidpf opaque, voidpf ptr)); | unsigned size)); | |||
void ZLIB_INTERNAL zcfree OF((voidpf opaque, voidpf ptr)); | ||||
#define ZALLOC(strm, items, size) \ | #define ZALLOC(strm, items, size) \ | |||
(*((strm)->zalloc))((strm)->opaque, (items), (size)) | (*((strm)->zalloc))((strm)->opaque, (items), (size)) | |||
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr )) | #define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr )) | |||
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);} | #define TRY_FREE(s, p) {if (p) ZFREE(s, p);} | |||
#endif /* ZUTIL_H */ | #endif /* ZUTIL_H */ | |||
End of changes. 12 change blocks. | ||||
35 lines changed or deleted | 38 lines changed or added | |||