mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-09 21:25:19 -05:00
Set svn:eol-style on files from the rbutil directory and its subdirectories.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@17462 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
850c4f98ba
commit
9c54187678
18 changed files with 17708 additions and 17708 deletions
|
|
@ -1,48 +1,48 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* __________ __ ___.
|
* __________ __ ___.
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 by Dominik Riebeling
|
* Copyright (C) 2008 by Dominik Riebeling
|
||||||
* $Id$
|
* $Id$
|
||||||
*
|
*
|
||||||
* All files in this archive are subject to the GNU General Public License.
|
* All files in this archive are subject to the GNU General Public License.
|
||||||
* See the file COPYING in the source tree root for full license agreement.
|
* See the file COPYING in the source tree root for full license agreement.
|
||||||
*
|
*
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "rbunzip.h"
|
#include "rbunzip.h"
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
|
|
||||||
UnZip::ErrorCode RbUnZip::extractArchive(const QString& dest)
|
UnZip::ErrorCode RbUnZip::extractArchive(const QString& dest)
|
||||||
{
|
{
|
||||||
QStringList files = this->fileList();
|
QStringList files = this->fileList();
|
||||||
UnZip::ErrorCode error = Ok;
|
UnZip::ErrorCode error = Ok;
|
||||||
m_abortunzip = false;
|
m_abortunzip = false;
|
||||||
|
|
||||||
int total = files.size();
|
int total = files.size();
|
||||||
for(int i = 0; i < total; i++) {
|
for(int i = 0; i < total; i++) {
|
||||||
qDebug() << __func__ << files.at(i);
|
qDebug() << __func__ << files.at(i);
|
||||||
error = this->extractFile(files.at(i), dest, UnZip::ExtractPaths);
|
error = this->extractFile(files.at(i), dest, UnZip::ExtractPaths);
|
||||||
emit unzipProgress(i + 1, total);
|
emit unzipProgress(i + 1, total);
|
||||||
QCoreApplication::processEvents(); // update UI
|
QCoreApplication::processEvents(); // update UI
|
||||||
if(m_abortunzip)
|
if(m_abortunzip)
|
||||||
error = SkipAll;
|
error = SkipAll;
|
||||||
if(error != Ok)
|
if(error != Ok)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RbUnZip::abortUnzip(void)
|
void RbUnZip::abortUnzip(void)
|
||||||
{
|
{
|
||||||
m_abortunzip = true;
|
m_abortunzip = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,2 +1,2 @@
|
||||||
1 24 MOVEABLE PURE "rbutilqt.manifest"
|
1 24 MOVEABLE PURE "rbutilqt.manifest"
|
||||||
RBUTIL_ICON ICON DISCARDABLE "icons/rockbox.ico"
|
RBUTIL_ICON ICON DISCARDABLE "icons/rockbox.ico"
|
||||||
|
|
|
||||||
|
|
@ -1,67 +1,67 @@
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* __________ __ ___.
|
* __________ __ ___.
|
||||||
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
* Open \______ \ ____ ____ | | _\_ |__ _______ ___
|
||||||
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
* Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
|
||||||
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
* Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
|
||||||
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
* Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
|
||||||
* \/ \/ \/ \/ \/
|
* \/ \/ \/ \/ \/
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008 by Dominik Wenger
|
* Copyright (C) 2008 by Dominik Wenger
|
||||||
* $Id: rbzip.cpp 17129 2008-04-15 21:25:57Z bluebrother $
|
* $Id: rbzip.cpp 17129 2008-04-15 21:25:57Z bluebrother $
|
||||||
*
|
*
|
||||||
* All files in this archive are subject to the GNU General Public License.
|
* All files in this archive are subject to the GNU General Public License.
|
||||||
* See the file COPYING in the source tree root for full license agreement.
|
* See the file COPYING in the source tree root for full license agreement.
|
||||||
*
|
*
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include "rbzip.h"
|
#include "rbzip.h"
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
|
|
||||||
|
|
||||||
Zip::ErrorCode RbZip::createZip(QString zip,QString dir,ProgressloggerInterface *dp)
|
Zip::ErrorCode RbZip::createZip(QString zip,QString dir,ProgressloggerInterface *dp)
|
||||||
{
|
{
|
||||||
m_logger = dp;
|
m_logger = dp;
|
||||||
Zip::ErrorCode error = Ok;
|
Zip::ErrorCode error = Ok;
|
||||||
m_curEntry = 1;
|
m_curEntry = 1;
|
||||||
int numEntrys=0;
|
int numEntrys=0;
|
||||||
|
|
||||||
m_logger->addItem(tr("Creating Backup: %1").arg(zip),LOGINFO);
|
m_logger->addItem(tr("Creating Backup: %1").arg(zip),LOGINFO);
|
||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents();
|
||||||
|
|
||||||
// get number of entrys in dir
|
// get number of entrys in dir
|
||||||
QDirIterator it(dir, QDirIterator::Subdirectories);
|
QDirIterator it(dir, QDirIterator::Subdirectories);
|
||||||
while (it.hasNext())
|
while (it.hasNext())
|
||||||
{
|
{
|
||||||
it.next();
|
it.next();
|
||||||
numEntrys++;
|
numEntrys++;
|
||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents();
|
||||||
}
|
}
|
||||||
m_logger->setProgressMax(numEntrys);
|
m_logger->setProgressMax(numEntrys);
|
||||||
|
|
||||||
//! create zip
|
//! create zip
|
||||||
error = Zip::createArchive(zip);
|
error = Zip::createArchive(zip);
|
||||||
if(error != Ok)
|
if(error != Ok)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
//! add the content
|
//! add the content
|
||||||
error = Zip::addDirectory(dir);
|
error = Zip::addDirectory(dir);
|
||||||
if(error != Ok)
|
if(error != Ok)
|
||||||
return error;
|
return error;
|
||||||
|
|
||||||
//! close zip
|
//! close zip
|
||||||
error = Zip::closeArchive();
|
error = Zip::closeArchive();
|
||||||
|
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
void RbZip::progress()
|
void RbZip::progress()
|
||||||
{
|
{
|
||||||
m_curEntry++;
|
m_curEntry++;
|
||||||
m_logger->setProgressValue(m_curEntry);
|
m_logger->setProgressValue(m_curEntry);
|
||||||
QCoreApplication::processEvents(); // update UI
|
QCoreApplication::processEvents(); // update UI
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,28 +15,28 @@
|
||||||
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
* This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
|
||||||
* KIND, either express or implied.
|
* KIND, either express or implied.
|
||||||
*
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifndef RBZIP_H
|
#ifndef RBZIP_H
|
||||||
#define RBZIP_H
|
#define RBZIP_H
|
||||||
|
|
||||||
#include <QtCore>
|
#include <QtCore>
|
||||||
#include "zip/zip.h"
|
#include "zip/zip.h"
|
||||||
|
|
||||||
#include "progressloggerinterface.h"
|
#include "progressloggerinterface.h"
|
||||||
|
|
||||||
class RbZip : public QObject, public Zip
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
public:
|
|
||||||
Zip::ErrorCode createZip(QString zip,QString dir,ProgressloggerInterface *dp);
|
|
||||||
|
|
||||||
virtual void progress();
|
class RbZip : public QObject, public Zip
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
Zip::ErrorCode createZip(QString zip,QString dir,ProgressloggerInterface *dp);
|
||||||
|
|
||||||
|
virtual void progress();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_curEntry;
|
int m_curEntry;
|
||||||
ProgressloggerInterface *m_logger;
|
ProgressloggerInterface *m_logger;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,144 +1,144 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Filename: unzip.h
|
** Filename: unzip.h
|
||||||
** Last updated [dd/mm/yyyy]: 28/01/2007
|
** Last updated [dd/mm/yyyy]: 28/01/2007
|
||||||
**
|
**
|
||||||
** pkzip 2.0 decompression.
|
** pkzip 2.0 decompression.
|
||||||
**
|
**
|
||||||
** Some of the code has been inspired by other open source projects,
|
** Some of the code has been inspired by other open source projects,
|
||||||
** (mainly Info-Zip and Gilles Vollant's minizip).
|
** (mainly Info-Zip and Gilles Vollant's minizip).
|
||||||
** Compression and decompression actually uses the zlib library.
|
** Compression and decompression actually uses the zlib library.
|
||||||
**
|
**
|
||||||
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
||||||
**
|
**
|
||||||
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
||||||
**
|
**
|
||||||
** This file may be distributed and/or modified under the terms of the
|
** This file may be distributed and/or modified under the terms of the
|
||||||
** GNU General Public License version 2 as published by the Free Software
|
** GNU General Public License version 2 as published by the Free Software
|
||||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||||
** packaging of this file.
|
** packaging of this file.
|
||||||
**
|
**
|
||||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
**
|
**
|
||||||
** See the file LICENSE.GPL that came with this software distribution or
|
** See the file LICENSE.GPL that came with this software distribution or
|
||||||
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
||||||
**
|
**
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
#ifndef OSDAB_UNZIP__H
|
#ifndef OSDAB_UNZIP__H
|
||||||
#define OSDAB_UNZIP__H
|
#define OSDAB_UNZIP__H
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
#include <QDateTime>
|
#include <QDateTime>
|
||||||
|
|
||||||
#include <zlib/zlib.h>
|
#include <zlib/zlib.h>
|
||||||
|
|
||||||
class UnzipPrivate;
|
class UnzipPrivate;
|
||||||
class QIODevice;
|
class QIODevice;
|
||||||
class QFile;
|
class QFile;
|
||||||
class QDir;
|
class QDir;
|
||||||
class QStringList;
|
class QStringList;
|
||||||
class QString;
|
class QString;
|
||||||
|
|
||||||
|
|
||||||
class UnZip
|
class UnZip
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum ErrorCode
|
enum ErrorCode
|
||||||
{
|
{
|
||||||
Ok,
|
Ok,
|
||||||
ZlibInit,
|
ZlibInit,
|
||||||
ZlibError,
|
ZlibError,
|
||||||
OpenFailed,
|
OpenFailed,
|
||||||
PartiallyCorrupted,
|
PartiallyCorrupted,
|
||||||
Corrupted,
|
Corrupted,
|
||||||
WrongPassword,
|
WrongPassword,
|
||||||
NoOpenArchive,
|
NoOpenArchive,
|
||||||
FileNotFound,
|
FileNotFound,
|
||||||
ReadFailed,
|
ReadFailed,
|
||||||
WriteFailed,
|
WriteFailed,
|
||||||
SeekFailed,
|
SeekFailed,
|
||||||
CreateDirFailed,
|
CreateDirFailed,
|
||||||
InvalidDevice,
|
InvalidDevice,
|
||||||
InvalidArchive,
|
InvalidArchive,
|
||||||
HeaderConsistencyError,
|
HeaderConsistencyError,
|
||||||
|
|
||||||
Skip, SkipAll // internal use only
|
Skip, SkipAll // internal use only
|
||||||
};
|
};
|
||||||
|
|
||||||
enum ExtractionOption
|
enum ExtractionOption
|
||||||
{
|
{
|
||||||
//! Extracts paths (default)
|
//! Extracts paths (default)
|
||||||
ExtractPaths = 0x0001,
|
ExtractPaths = 0x0001,
|
||||||
//! Ignores paths and extracts all the files to the same directory
|
//! Ignores paths and extracts all the files to the same directory
|
||||||
SkipPaths = 0x0002
|
SkipPaths = 0x0002
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(ExtractionOptions, ExtractionOption)
|
Q_DECLARE_FLAGS(ExtractionOptions, ExtractionOption)
|
||||||
|
|
||||||
enum CompressionMethod
|
enum CompressionMethod
|
||||||
{
|
{
|
||||||
NoCompression, Deflated, UnknownCompression
|
NoCompression, Deflated, UnknownCompression
|
||||||
};
|
};
|
||||||
|
|
||||||
enum FileType
|
enum FileType
|
||||||
{
|
{
|
||||||
File, Directory
|
File, Directory
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef struct ZipEntry
|
typedef struct ZipEntry
|
||||||
{
|
{
|
||||||
ZipEntry();
|
ZipEntry();
|
||||||
|
|
||||||
QString filename;
|
QString filename;
|
||||||
QString comment;
|
QString comment;
|
||||||
|
|
||||||
quint32 compressedSize;
|
quint32 compressedSize;
|
||||||
quint32 uncompressedSize;
|
quint32 uncompressedSize;
|
||||||
quint32 crc32;
|
quint32 crc32;
|
||||||
|
|
||||||
QDateTime lastModified;
|
QDateTime lastModified;
|
||||||
|
|
||||||
CompressionMethod compression;
|
CompressionMethod compression;
|
||||||
FileType type;
|
FileType type;
|
||||||
|
|
||||||
bool encrypted;
|
bool encrypted;
|
||||||
};
|
};
|
||||||
|
|
||||||
UnZip();
|
UnZip();
|
||||||
virtual ~UnZip();
|
virtual ~UnZip();
|
||||||
|
|
||||||
bool isOpen() const;
|
bool isOpen() const;
|
||||||
|
|
||||||
ErrorCode openArchive(const QString& filename);
|
ErrorCode openArchive(const QString& filename);
|
||||||
ErrorCode openArchive(QIODevice* device);
|
ErrorCode openArchive(QIODevice* device);
|
||||||
void closeArchive();
|
void closeArchive();
|
||||||
|
|
||||||
QString archiveComment() const;
|
QString archiveComment() const;
|
||||||
|
|
||||||
QString formatError(UnZip::ErrorCode c) const;
|
QString formatError(UnZip::ErrorCode c) const;
|
||||||
|
|
||||||
bool contains(const QString& file) const;
|
bool contains(const QString& file) const;
|
||||||
|
|
||||||
QStringList fileList() const;
|
QStringList fileList() const;
|
||||||
QList<ZipEntry> entryList() const;
|
QList<ZipEntry> entryList() const;
|
||||||
|
|
||||||
ErrorCode extractAll(const QString& dirname, ExtractionOptions options = ExtractPaths);
|
ErrorCode extractAll(const QString& dirname, ExtractionOptions options = ExtractPaths);
|
||||||
ErrorCode extractAll(const QDir& dir, ExtractionOptions options = ExtractPaths);
|
ErrorCode extractAll(const QDir& dir, ExtractionOptions options = ExtractPaths);
|
||||||
|
|
||||||
ErrorCode extractFile(const QString& filename, const QString& dirname, ExtractionOptions options = ExtractPaths);
|
ErrorCode extractFile(const QString& filename, const QString& dirname, ExtractionOptions options = ExtractPaths);
|
||||||
ErrorCode extractFile(const QString& filename, const QDir& dir, ExtractionOptions options = ExtractPaths);
|
ErrorCode extractFile(const QString& filename, const QDir& dir, ExtractionOptions options = ExtractPaths);
|
||||||
ErrorCode extractFile(const QString& filename, QIODevice* device, ExtractionOptions options = ExtractPaths);
|
ErrorCode extractFile(const QString& filename, QIODevice* device, ExtractionOptions options = ExtractPaths);
|
||||||
|
|
||||||
ErrorCode extractFiles(const QStringList& filenames, const QString& dirname, ExtractionOptions options = ExtractPaths);
|
ErrorCode extractFiles(const QStringList& filenames, const QString& dirname, ExtractionOptions options = ExtractPaths);
|
||||||
ErrorCode extractFiles(const QStringList& filenames, const QDir& dir, ExtractionOptions options = ExtractPaths);
|
ErrorCode extractFiles(const QStringList& filenames, const QDir& dir, ExtractionOptions options = ExtractPaths);
|
||||||
|
|
||||||
void setPassword(const QString& pwd);
|
void setPassword(const QString& pwd);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UnzipPrivate* d;
|
UnzipPrivate* d;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(UnZip::ExtractionOptions)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(UnZip::ExtractionOptions)
|
||||||
|
|
||||||
#endif // OSDAB_UNZIP__H
|
#endif // OSDAB_UNZIP__H
|
||||||
|
|
|
||||||
|
|
@ -1,112 +1,112 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Filename: unzip_p.h
|
** Filename: unzip_p.h
|
||||||
** Last updated [dd/mm/yyyy]: 28/01/2007
|
** Last updated [dd/mm/yyyy]: 28/01/2007
|
||||||
**
|
**
|
||||||
** pkzip 2.0 decompression.
|
** pkzip 2.0 decompression.
|
||||||
**
|
**
|
||||||
** Some of the code has been inspired by other open source projects,
|
** Some of the code has been inspired by other open source projects,
|
||||||
** (mainly Info-Zip and Gilles Vollant's minizip).
|
** (mainly Info-Zip and Gilles Vollant's minizip).
|
||||||
** Compression and decompression actually uses the zlib library.
|
** Compression and decompression actually uses the zlib library.
|
||||||
**
|
**
|
||||||
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
||||||
**
|
**
|
||||||
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
||||||
**
|
**
|
||||||
** This file may be distributed and/or modified under the terms of the
|
** This file may be distributed and/or modified under the terms of the
|
||||||
** GNU General Public License version 2 as published by the Free Software
|
** GNU General Public License version 2 as published by the Free Software
|
||||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||||
** packaging of this file.
|
** packaging of this file.
|
||||||
**
|
**
|
||||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
**
|
**
|
||||||
** See the file LICENSE.GPL that came with this software distribution or
|
** See the file LICENSE.GPL that came with this software distribution or
|
||||||
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
||||||
**
|
**
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
//
|
//
|
||||||
// W A R N I N G
|
// W A R N I N G
|
||||||
// -------------
|
// -------------
|
||||||
//
|
//
|
||||||
// This file is not part of the Zip/UnZip API. It exists purely as an
|
// This file is not part of the Zip/UnZip API. It exists purely as an
|
||||||
// implementation detail. This header file may change from version to
|
// implementation detail. This header file may change from version to
|
||||||
// version without notice, or even be removed.
|
// version without notice, or even be removed.
|
||||||
//
|
//
|
||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef OSDAB_UNZIP_P__H
|
#ifndef OSDAB_UNZIP_P__H
|
||||||
#define OSDAB_UNZIP_P__H
|
#define OSDAB_UNZIP_P__H
|
||||||
|
|
||||||
#include "unzip.h"
|
#include "unzip.h"
|
||||||
#include "zipentry_p.h"
|
#include "zipentry_p.h"
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
|
|
||||||
// zLib authors suggest using larger buffers (128K or 256K) for (de)compression (especially for inflate())
|
// zLib authors suggest using larger buffers (128K or 256K) for (de)compression (especially for inflate())
|
||||||
// we use a 256K buffer here - if you want to use this code on a pre-iceage mainframe please change it ;)
|
// we use a 256K buffer here - if you want to use this code on a pre-iceage mainframe please change it ;)
|
||||||
#define UNZIP_READ_BUFFER (256*1024)
|
#define UNZIP_READ_BUFFER (256*1024)
|
||||||
|
|
||||||
class UnzipPrivate
|
class UnzipPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UnzipPrivate();
|
UnzipPrivate();
|
||||||
|
|
||||||
// Replace this with whatever else you use to store/retrieve the password.
|
// Replace this with whatever else you use to store/retrieve the password.
|
||||||
QString password;
|
QString password;
|
||||||
|
|
||||||
bool skipAllEncrypted;
|
bool skipAllEncrypted;
|
||||||
|
|
||||||
QMap<QString,ZipEntryP*>* headers;
|
QMap<QString,ZipEntryP*>* headers;
|
||||||
|
|
||||||
QIODevice* device;
|
QIODevice* device;
|
||||||
|
|
||||||
char buffer1[UNZIP_READ_BUFFER];
|
char buffer1[UNZIP_READ_BUFFER];
|
||||||
char buffer2[UNZIP_READ_BUFFER];
|
char buffer2[UNZIP_READ_BUFFER];
|
||||||
|
|
||||||
unsigned char* uBuffer;
|
unsigned char* uBuffer;
|
||||||
const quint32* crcTable;
|
const quint32* crcTable;
|
||||||
|
|
||||||
// Central Directory (CD) offset
|
// Central Directory (CD) offset
|
||||||
quint32 cdOffset;
|
quint32 cdOffset;
|
||||||
// End of Central Directory (EOCD) offset
|
// End of Central Directory (EOCD) offset
|
||||||
quint32 eocdOffset;
|
quint32 eocdOffset;
|
||||||
|
|
||||||
// Number of entries in the Central Directory (as to the EOCD record)
|
// Number of entries in the Central Directory (as to the EOCD record)
|
||||||
quint16 cdEntryCount;
|
quint16 cdEntryCount;
|
||||||
|
|
||||||
// The number of detected entries that have been skipped because of a non compatible format
|
// The number of detected entries that have been skipped because of a non compatible format
|
||||||
quint16 unsupportedEntryCount;
|
quint16 unsupportedEntryCount;
|
||||||
|
|
||||||
QString comment;
|
QString comment;
|
||||||
|
|
||||||
UnZip::ErrorCode openArchive(QIODevice* device);
|
UnZip::ErrorCode openArchive(QIODevice* device);
|
||||||
|
|
||||||
UnZip::ErrorCode seekToCentralDirectory();
|
UnZip::ErrorCode seekToCentralDirectory();
|
||||||
UnZip::ErrorCode parseCentralDirectoryRecord();
|
UnZip::ErrorCode parseCentralDirectoryRecord();
|
||||||
UnZip::ErrorCode parseLocalHeaderRecord(const QString& path, ZipEntryP& entry);
|
UnZip::ErrorCode parseLocalHeaderRecord(const QString& path, ZipEntryP& entry);
|
||||||
|
|
||||||
void closeArchive();
|
void closeArchive();
|
||||||
|
|
||||||
UnZip::ErrorCode extractFile(const QString& path, ZipEntryP& entry, const QDir& dir, UnZip::ExtractionOptions options);
|
UnZip::ErrorCode extractFile(const QString& path, ZipEntryP& entry, const QDir& dir, UnZip::ExtractionOptions options);
|
||||||
UnZip::ErrorCode extractFile(const QString& path, ZipEntryP& entry, QIODevice* device, UnZip::ExtractionOptions options);
|
UnZip::ErrorCode extractFile(const QString& path, ZipEntryP& entry, QIODevice* device, UnZip::ExtractionOptions options);
|
||||||
|
|
||||||
UnZip::ErrorCode testPassword(quint32* keys, const QString& file, const ZipEntryP& header);
|
UnZip::ErrorCode testPassword(quint32* keys, const QString& file, const ZipEntryP& header);
|
||||||
bool testKeys(const ZipEntryP& header, quint32* keys);
|
bool testKeys(const ZipEntryP& header, quint32* keys);
|
||||||
|
|
||||||
bool createDirectory(const QString& path);
|
bool createDirectory(const QString& path);
|
||||||
|
|
||||||
inline void decryptBytes(quint32* keys, char* buffer, qint64 read);
|
inline void decryptBytes(quint32* keys, char* buffer, qint64 read);
|
||||||
|
|
||||||
inline quint32 getULong(const unsigned char* data, quint32 offset) const;
|
inline quint32 getULong(const unsigned char* data, quint32 offset) const;
|
||||||
inline quint64 getULLong(const unsigned char* data, quint32 offset) const;
|
inline quint64 getULLong(const unsigned char* data, quint32 offset) const;
|
||||||
inline quint16 getUShort(const unsigned char* data, quint32 offset) const;
|
inline quint16 getUShort(const unsigned char* data, quint32 offset) const;
|
||||||
inline int decryptByte(quint32 key2) const;
|
inline int decryptByte(quint32 key2) const;
|
||||||
inline void updateKeys(quint32* keys, int c) const;
|
inline void updateKeys(quint32* keys, int c) const;
|
||||||
inline void initKeys(const QString& pwd, quint32* keys) const;
|
inline void initKeys(const QString& pwd, quint32* keys) const;
|
||||||
|
|
||||||
inline QDateTime convertDateTime(const unsigned char date[2], const unsigned char time[2]) const;
|
inline QDateTime convertDateTime(const unsigned char date[2], const unsigned char time[2]) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // OSDAB_UNZIP_P__H
|
#endif // OSDAB_UNZIP_P__H
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,115 +1,115 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Filename: zip.h
|
** Filename: zip.h
|
||||||
** Last updated [dd/mm/yyyy]: 01/02/2007
|
** Last updated [dd/mm/yyyy]: 01/02/2007
|
||||||
**
|
**
|
||||||
** pkzip 2.0 file compression.
|
** pkzip 2.0 file compression.
|
||||||
**
|
**
|
||||||
** Some of the code has been inspired by other open source projects,
|
** Some of the code has been inspired by other open source projects,
|
||||||
** (mainly Info-Zip and Gilles Vollant's minizip).
|
** (mainly Info-Zip and Gilles Vollant's minizip).
|
||||||
** Compression and decompression actually uses the zlib library.
|
** Compression and decompression actually uses the zlib library.
|
||||||
**
|
**
|
||||||
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
||||||
**
|
**
|
||||||
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
||||||
**
|
**
|
||||||
** This file may be distributed and/or modified under the terms of the
|
** This file may be distributed and/or modified under the terms of the
|
||||||
** GNU General Public License version 2 as published by the Free Software
|
** GNU General Public License version 2 as published by the Free Software
|
||||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||||
** packaging of this file.
|
** packaging of this file.
|
||||||
**
|
**
|
||||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
**
|
**
|
||||||
** See the file LICENSE.GPL that came with this software distribution or
|
** See the file LICENSE.GPL that came with this software distribution or
|
||||||
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
||||||
**
|
**
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
#ifndef OSDAB_ZIP__H
|
#ifndef OSDAB_ZIP__H
|
||||||
#define OSDAB_ZIP__H
|
#define OSDAB_ZIP__H
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QMap>
|
#include <QMap>
|
||||||
|
|
||||||
#include <zlib/zlib.h>
|
#include <zlib/zlib.h>
|
||||||
|
|
||||||
class ZipPrivate;
|
class ZipPrivate;
|
||||||
|
|
||||||
class QIODevice;
|
class QIODevice;
|
||||||
class QFile;
|
class QFile;
|
||||||
class QDir;
|
class QDir;
|
||||||
class QStringList;
|
class QStringList;
|
||||||
class QString;
|
class QString;
|
||||||
|
|
||||||
|
|
||||||
class Zip
|
class Zip
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
enum ErrorCode
|
enum ErrorCode
|
||||||
{
|
{
|
||||||
Ok,
|
Ok,
|
||||||
ZlibInit,
|
ZlibInit,
|
||||||
ZlibError,
|
ZlibError,
|
||||||
FileExists,
|
FileExists,
|
||||||
OpenFailed,
|
OpenFailed,
|
||||||
NoOpenArchive,
|
NoOpenArchive,
|
||||||
FileNotFound,
|
FileNotFound,
|
||||||
ReadFailed,
|
ReadFailed,
|
||||||
WriteFailed,
|
WriteFailed,
|
||||||
SeekFailed
|
SeekFailed
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CompressionLevel
|
enum CompressionLevel
|
||||||
{
|
{
|
||||||
Store,
|
Store,
|
||||||
Deflate1 = 1, Deflate2, Deflate3, Deflate4,
|
Deflate1 = 1, Deflate2, Deflate3, Deflate4,
|
||||||
Deflate5, Deflate6, Deflate7, Deflate8, Deflate9,
|
Deflate5, Deflate6, Deflate7, Deflate8, Deflate9,
|
||||||
AutoCPU, AutoMIME, AutoFull
|
AutoCPU, AutoMIME, AutoFull
|
||||||
};
|
};
|
||||||
|
|
||||||
enum CompressionOption
|
enum CompressionOption
|
||||||
{
|
{
|
||||||
//! Does not preserve absolute paths in the zip file when adding a file/directory (default)
|
//! Does not preserve absolute paths in the zip file when adding a file/directory (default)
|
||||||
RelativePaths = 0x0001,
|
RelativePaths = 0x0001,
|
||||||
//! Preserve absolute paths
|
//! Preserve absolute paths
|
||||||
AbsolutePaths = 0x0002,
|
AbsolutePaths = 0x0002,
|
||||||
//! Do not store paths. All the files are put in the (evtl. user defined) root of the zip file
|
//! Do not store paths. All the files are put in the (evtl. user defined) root of the zip file
|
||||||
IgnorePaths = 0x0004
|
IgnorePaths = 0x0004
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(CompressionOptions, CompressionOption)
|
Q_DECLARE_FLAGS(CompressionOptions, CompressionOption)
|
||||||
|
|
||||||
Zip();
|
Zip();
|
||||||
virtual ~Zip();
|
virtual ~Zip();
|
||||||
|
|
||||||
bool isOpen() const;
|
bool isOpen() const;
|
||||||
|
|
||||||
void setPassword(const QString& pwd);
|
void setPassword(const QString& pwd);
|
||||||
void clearPassword();
|
void clearPassword();
|
||||||
QString password() const;
|
QString password() const;
|
||||||
|
|
||||||
ErrorCode createArchive(const QString& file, bool overwrite = true);
|
ErrorCode createArchive(const QString& file, bool overwrite = true);
|
||||||
ErrorCode createArchive(QIODevice* device);
|
ErrorCode createArchive(QIODevice* device);
|
||||||
|
|
||||||
QString archiveComment() const;
|
QString archiveComment() const;
|
||||||
void setArchiveComment(const QString& comment);
|
void setArchiveComment(const QString& comment);
|
||||||
|
|
||||||
ErrorCode addDirectoryContents(const QString& path, CompressionLevel level = AutoFull);
|
ErrorCode addDirectoryContents(const QString& path, CompressionLevel level = AutoFull);
|
||||||
ErrorCode addDirectoryContents(const QString& path, const QString& root, CompressionLevel level = AutoFull);
|
ErrorCode addDirectoryContents(const QString& path, const QString& root, CompressionLevel level = AutoFull);
|
||||||
|
|
||||||
ErrorCode addDirectory(const QString& path, CompressionOptions options = RelativePaths, CompressionLevel level = AutoFull);
|
ErrorCode addDirectory(const QString& path, CompressionOptions options = RelativePaths, CompressionLevel level = AutoFull);
|
||||||
ErrorCode addDirectory(const QString& path, const QString& root, CompressionLevel level = AutoFull);
|
ErrorCode addDirectory(const QString& path, const QString& root, CompressionLevel level = AutoFull);
|
||||||
ErrorCode addDirectory(const QString& path, const QString& root, CompressionOptions options = RelativePaths, CompressionLevel level = AutoFull);
|
ErrorCode addDirectory(const QString& path, const QString& root, CompressionOptions options = RelativePaths, CompressionLevel level = AutoFull);
|
||||||
|
|
||||||
ErrorCode closeArchive();
|
ErrorCode closeArchive();
|
||||||
|
|
||||||
QString formatError(ErrorCode c) const;
|
QString formatError(ErrorCode c) const;
|
||||||
|
|
||||||
virtual void progress() {}
|
virtual void progress() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ZipPrivate* d;
|
ZipPrivate* d;
|
||||||
};
|
};
|
||||||
|
|
||||||
Q_DECLARE_OPERATORS_FOR_FLAGS(Zip::CompressionOptions)
|
Q_DECLARE_OPERATORS_FOR_FLAGS(Zip::CompressionOptions)
|
||||||
|
|
||||||
#endif // OSDAB_ZIP__H
|
#endif // OSDAB_ZIP__H
|
||||||
|
|
|
||||||
|
|
@ -1,93 +1,93 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Filename: zip_p.h
|
** Filename: zip_p.h
|
||||||
** Last updated [dd/mm/yyyy]: 28/01/2007
|
** Last updated [dd/mm/yyyy]: 28/01/2007
|
||||||
**
|
**
|
||||||
** pkzip 2.0 file compression.
|
** pkzip 2.0 file compression.
|
||||||
**
|
**
|
||||||
** Some of the code has been inspired by other open source projects,
|
** Some of the code has been inspired by other open source projects,
|
||||||
** (mainly Info-Zip and Gilles Vollant's minizip).
|
** (mainly Info-Zip and Gilles Vollant's minizip).
|
||||||
** Compression and decompression actually uses the zlib library.
|
** Compression and decompression actually uses the zlib library.
|
||||||
**
|
**
|
||||||
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
||||||
**
|
**
|
||||||
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
||||||
**
|
**
|
||||||
** This file may be distributed and/or modified under the terms of the
|
** This file may be distributed and/or modified under the terms of the
|
||||||
** GNU General Public License version 2 as published by the Free Software
|
** GNU General Public License version 2 as published by the Free Software
|
||||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||||
** packaging of this file.
|
** packaging of this file.
|
||||||
**
|
**
|
||||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
**
|
**
|
||||||
** See the file LICENSE.GPL that came with this software distribution or
|
** See the file LICENSE.GPL that came with this software distribution or
|
||||||
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
||||||
**
|
**
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
//
|
//
|
||||||
// W A R N I N G
|
// W A R N I N G
|
||||||
// -------------
|
// -------------
|
||||||
//
|
//
|
||||||
// This file is not part of the Zip/UnZip API. It exists purely as an
|
// This file is not part of the Zip/UnZip API. It exists purely as an
|
||||||
// implementation detail. This header file may change from version to
|
// implementation detail. This header file may change from version to
|
||||||
// version without notice, or even be removed.
|
// version without notice, or even be removed.
|
||||||
//
|
//
|
||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef OSDAB_ZIP_P__H
|
#ifndef OSDAB_ZIP_P__H
|
||||||
#define OSDAB_ZIP_P__H
|
#define OSDAB_ZIP_P__H
|
||||||
|
|
||||||
#include "zip.h"
|
#include "zip.h"
|
||||||
#include "zipentry_p.h"
|
#include "zipentry_p.h"
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
zLib authors suggest using larger buffers (128K or 256K) for (de)compression (especially for inflate())
|
zLib authors suggest using larger buffers (128K or 256K) for (de)compression (especially for inflate())
|
||||||
we use a 256K buffer here - if you want to use this code on a pre-iceage mainframe please change it ;)
|
we use a 256K buffer here - if you want to use this code on a pre-iceage mainframe please change it ;)
|
||||||
*/
|
*/
|
||||||
#define ZIP_READ_BUFFER (256*1024)
|
#define ZIP_READ_BUFFER (256*1024)
|
||||||
|
|
||||||
class ZipPrivate
|
class ZipPrivate
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ZipPrivate();
|
ZipPrivate();
|
||||||
virtual ~ZipPrivate();
|
virtual ~ZipPrivate();
|
||||||
|
|
||||||
QMap<QString,ZipEntryP*>* headers;
|
QMap<QString,ZipEntryP*>* headers;
|
||||||
|
|
||||||
QIODevice* device;
|
QIODevice* device;
|
||||||
|
|
||||||
char buffer1[ZIP_READ_BUFFER];
|
char buffer1[ZIP_READ_BUFFER];
|
||||||
char buffer2[ZIP_READ_BUFFER];
|
char buffer2[ZIP_READ_BUFFER];
|
||||||
|
|
||||||
unsigned char* uBuffer;
|
unsigned char* uBuffer;
|
||||||
|
|
||||||
const quint32* crcTable;
|
const quint32* crcTable;
|
||||||
|
|
||||||
QString comment;
|
QString comment;
|
||||||
QString password;
|
QString password;
|
||||||
|
|
||||||
Zip::ErrorCode createArchive(QIODevice* device);
|
Zip::ErrorCode createArchive(QIODevice* device);
|
||||||
Zip::ErrorCode closeArchive();
|
Zip::ErrorCode closeArchive();
|
||||||
void reset();
|
void reset();
|
||||||
|
|
||||||
bool zLibInit();
|
bool zLibInit();
|
||||||
|
|
||||||
Zip::ErrorCode createEntry(const QFileInfo& file, const QString& root, Zip::CompressionLevel level);
|
Zip::ErrorCode createEntry(const QFileInfo& file, const QString& root, Zip::CompressionLevel level);
|
||||||
Zip::CompressionLevel detectCompressionByMime(const QString& ext);
|
Zip::CompressionLevel detectCompressionByMime(const QString& ext);
|
||||||
|
|
||||||
inline void encryptBytes(quint32* keys, char* buffer, qint64 read);
|
inline void encryptBytes(quint32* keys, char* buffer, qint64 read);
|
||||||
|
|
||||||
inline void setULong(quint32 v, char* buffer, unsigned int offset);
|
inline void setULong(quint32 v, char* buffer, unsigned int offset);
|
||||||
inline void updateKeys(quint32* keys, int c) const;
|
inline void updateKeys(quint32* keys, int c) const;
|
||||||
inline void initKeys(quint32* keys) const;
|
inline void initKeys(quint32* keys) const;
|
||||||
inline int decryptByte(quint32 key2) const;
|
inline int decryptByte(quint32 key2) const;
|
||||||
|
|
||||||
inline QString extractRoot(const QString& p);
|
inline QString extractRoot(const QString& p);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // OSDAB_ZIP_P__H
|
#endif // OSDAB_ZIP_P__H
|
||||||
|
|
|
||||||
|
|
@ -1,78 +1,78 @@
|
||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
** Filename: ZipEntryP.h
|
** Filename: ZipEntryP.h
|
||||||
** Last updated [dd/mm/yyyy]: 28/01/2007
|
** Last updated [dd/mm/yyyy]: 28/01/2007
|
||||||
**
|
**
|
||||||
** Wrapper for a ZIP local header.
|
** Wrapper for a ZIP local header.
|
||||||
**
|
**
|
||||||
** Some of the code has been inspired by other open source projects,
|
** Some of the code has been inspired by other open source projects,
|
||||||
** (mainly Info-Zip and Gilles Vollant's minizip).
|
** (mainly Info-Zip and Gilles Vollant's minizip).
|
||||||
** Compression and decompression actually uses the zlib library.
|
** Compression and decompression actually uses the zlib library.
|
||||||
**
|
**
|
||||||
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
** Copyright (C) 2007 Angius Fabrizio. All rights reserved.
|
||||||
**
|
**
|
||||||
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
** This file is part of the OSDaB project (http://osdab.sourceforge.net/).
|
||||||
**
|
**
|
||||||
** This file may be distributed and/or modified under the terms of the
|
** This file may be distributed and/or modified under the terms of the
|
||||||
** GNU General Public License version 2 as published by the Free Software
|
** GNU General Public License version 2 as published by the Free Software
|
||||||
** Foundation and appearing in the file LICENSE.GPL included in the
|
** Foundation and appearing in the file LICENSE.GPL included in the
|
||||||
** packaging of this file.
|
** packaging of this file.
|
||||||
**
|
**
|
||||||
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
||||||
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
||||||
**
|
**
|
||||||
** See the file LICENSE.GPL that came with this software distribution or
|
** See the file LICENSE.GPL that came with this software distribution or
|
||||||
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
** visit http://www.gnu.org/copyleft/gpl.html for GPL licensing information.
|
||||||
**
|
**
|
||||||
**********************************************************************/
|
**********************************************************************/
|
||||||
|
|
||||||
//
|
//
|
||||||
// W A R N I N G
|
// W A R N I N G
|
||||||
// -------------
|
// -------------
|
||||||
//
|
//
|
||||||
// This file is not part of the Zip/UnZip API. It exists purely as an
|
// This file is not part of the Zip/UnZip API. It exists purely as an
|
||||||
// implementation detail. This header file may change from version to
|
// implementation detail. This header file may change from version to
|
||||||
// version without notice, or even be removed.
|
// version without notice, or even be removed.
|
||||||
//
|
//
|
||||||
// We mean it.
|
// We mean it.
|
||||||
//
|
//
|
||||||
|
|
||||||
#ifndef OSDAB_ZIPENTRY_P__H
|
#ifndef OSDAB_ZIPENTRY_P__H
|
||||||
#define OSDAB_ZIPENTRY_P__H
|
#define OSDAB_ZIPENTRY_P__H
|
||||||
|
|
||||||
#include <QtGlobal>
|
#include <QtGlobal>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
class ZipEntryP
|
class ZipEntryP
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ZipEntryP()
|
ZipEntryP()
|
||||||
{
|
{
|
||||||
lhOffset = 0;
|
lhOffset = 0;
|
||||||
dataOffset = 0;
|
dataOffset = 0;
|
||||||
gpFlag[0] = gpFlag[1] = 0;
|
gpFlag[0] = gpFlag[1] = 0;
|
||||||
compMethod = 0;
|
compMethod = 0;
|
||||||
modTime[0] = modTime[1] = 0;
|
modTime[0] = modTime[1] = 0;
|
||||||
modDate[0] = modDate[1] = 0;
|
modDate[0] = modDate[1] = 0;
|
||||||
crc = 0;
|
crc = 0;
|
||||||
szComp = szUncomp = 0;
|
szComp = szUncomp = 0;
|
||||||
lhEntryChecked = false;
|
lhEntryChecked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
quint32 lhOffset; // Offset of the local header record for this entry
|
quint32 lhOffset; // Offset of the local header record for this entry
|
||||||
quint32 dataOffset; // Offset of the file data for this entry
|
quint32 dataOffset; // Offset of the file data for this entry
|
||||||
unsigned char gpFlag[2]; // General purpose flag
|
unsigned char gpFlag[2]; // General purpose flag
|
||||||
quint16 compMethod; // Compression method
|
quint16 compMethod; // Compression method
|
||||||
unsigned char modTime[2]; // Last modified time
|
unsigned char modTime[2]; // Last modified time
|
||||||
unsigned char modDate[2]; // Last modified date
|
unsigned char modDate[2]; // Last modified date
|
||||||
quint32 crc; // CRC32
|
quint32 crc; // CRC32
|
||||||
quint32 szComp; // Compressed file size
|
quint32 szComp; // Compressed file size
|
||||||
quint32 szUncomp; // Uncompressed file size
|
quint32 szUncomp; // Uncompressed file size
|
||||||
QString comment; // File comment
|
QString comment; // File comment
|
||||||
|
|
||||||
bool lhEntryChecked; // Is true if the local header record for this entry has been parsed
|
bool lhEntryChecked; // Is true if the local header record for this entry has been parsed
|
||||||
|
|
||||||
inline bool isEncrypted() const { return gpFlag[0] & 0x01; }
|
inline bool isEncrypted() const { return gpFlag[0] & 0x01; }
|
||||||
inline bool hasDataDescriptor() const { return gpFlag[0] & 0x08; }
|
inline bool hasDataDescriptor() const { return gpFlag[0] & 0x08; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // OSDAB_ZIPENTRY_P__H
|
#endif // OSDAB_ZIPENTRY_P__H
|
||||||
|
|
|
||||||
|
|
@ -1,326 +1,326 @@
|
||||||
/* zconf.h -- configuration of the zlib compression library
|
/* zconf.h -- configuration of the zlib compression library
|
||||||
* Copyright (C) 1995-2004 Jean-loup Gailly.
|
* Copyright (C) 1995-2004 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 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.
|
||||||
*/
|
*/
|
||||||
#ifdef Z_PREFIX
|
#ifdef Z_PREFIX
|
||||||
# define deflateInit_ z_deflateInit_
|
# define deflateInit_ z_deflateInit_
|
||||||
# define deflate z_deflate
|
# define deflate z_deflate
|
||||||
# define deflateEnd z_deflateEnd
|
# define deflateEnd z_deflateEnd
|
||||||
# define inflateInit_ z_inflateInit_
|
# define inflateInit_ z_inflateInit_
|
||||||
# define inflate z_inflate
|
# define inflate z_inflate
|
||||||
# define inflateEnd z_inflateEnd
|
# define inflateEnd z_inflateEnd
|
||||||
# define deflateInit2_ z_deflateInit2_
|
# define deflateInit2_ z_deflateInit2_
|
||||||
# define deflateSetDictionary z_deflateSetDictionary
|
# define deflateSetDictionary z_deflateSetDictionary
|
||||||
# define deflateCopy z_deflateCopy
|
# define deflateCopy z_deflateCopy
|
||||||
# define deflateReset z_deflateReset
|
# define deflateReset z_deflateReset
|
||||||
# define deflateParams z_deflateParams
|
# define deflateParams z_deflateParams
|
||||||
# define deflateBound z_deflateBound
|
# define deflateBound z_deflateBound
|
||||||
# define deflatePrime z_deflatePrime
|
# define deflatePrime z_deflatePrime
|
||||||
# define inflateInit2_ z_inflateInit2_
|
# define inflateInit2_ z_inflateInit2_
|
||||||
# define inflateSetDictionary z_inflateSetDictionary
|
# define inflateSetDictionary z_inflateSetDictionary
|
||||||
# define inflateSync z_inflateSync
|
# define inflateSync z_inflateSync
|
||||||
# define inflateSyncPoint z_inflateSyncPoint
|
# define inflateSyncPoint z_inflateSyncPoint
|
||||||
# define inflateCopy z_inflateCopy
|
# define inflateCopy z_inflateCopy
|
||||||
# define inflateReset z_inflateReset
|
# define inflateReset z_inflateReset
|
||||||
# define inflateBack z_inflateBack
|
# define inflateBack z_inflateBack
|
||||||
# define inflateBackEnd z_inflateBackEnd
|
# define inflateBackEnd z_inflateBackEnd
|
||||||
# define compress z_compress
|
# define compress z_compress
|
||||||
# define compress2 z_compress2
|
# define compress2 z_compress2
|
||||||
# define compressBound z_compressBound
|
# define compressBound z_compressBound
|
||||||
# define uncompress z_uncompress
|
# define uncompress z_uncompress
|
||||||
# define adler32 z_adler32
|
# define adler32 z_adler32
|
||||||
# define crc32 z_crc32
|
# define crc32 z_crc32
|
||||||
# define get_crc_table z_get_crc_table
|
# define get_crc_table z_get_crc_table
|
||||||
# define zError z_zError
|
# define zError z_zError
|
||||||
|
|
||||||
# define Byte z_Byte
|
# define Byte z_Byte
|
||||||
# define uInt z_uInt
|
# define uInt z_uInt
|
||||||
# define uLong z_uLong
|
# define uLong z_uLong
|
||||||
# define Bytef z_Bytef
|
# define Bytef z_Bytef
|
||||||
# define charf z_charf
|
# define charf z_charf
|
||||||
# define intf z_intf
|
# define intf z_intf
|
||||||
# define uIntf z_uIntf
|
# define uIntf z_uIntf
|
||||||
# define uLongf z_uLongf
|
# define uLongf z_uLongf
|
||||||
# define voidpf z_voidpf
|
# define voidpf z_voidpf
|
||||||
# define voidp z_voidp
|
# define voidp z_voidp
|
||||||
#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__)) && !defined(WIN32)
|
#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
|
||||||
# define WIN32
|
# define WIN32
|
||||||
#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
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
* Compile with -DMAXSEG_64K if the alloc function cannot allocate more
|
||||||
* than 64k bytes at a time (needed on systems with 16-bit int).
|
* than 64k bytes at a time (needed on systems with 16-bit int).
|
||||||
*/
|
*/
|
||||||
#ifdef SYS16BIT
|
#ifdef SYS16BIT
|
||||||
# define MAXSEG_64K
|
# define MAXSEG_64K
|
||||||
#endif
|
#endif
|
||||||
#ifdef MSDOS
|
#ifdef MSDOS
|
||||||
# define UNALIGNED_OK
|
# define UNALIGNED_OK
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef __STDC_VERSION__
|
#ifdef __STDC_VERSION__
|
||||||
# ifndef STDC
|
# ifndef STDC
|
||||||
# define STDC
|
# define STDC
|
||||||
# endif
|
# endif
|
||||||
# if __STDC_VERSION__ >= 199901L
|
# if __STDC_VERSION__ >= 199901L
|
||||||
# ifndef STDC99
|
# ifndef STDC99
|
||||||
# define STDC99
|
# define STDC99
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
#if !defined(STDC) && (defined(__STDC__) || defined(__cplusplus))
|
||||||
# define STDC
|
# define STDC
|
||||||
#endif
|
#endif
|
||||||
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
#if !defined(STDC) && (defined(__GNUC__) || defined(__BORLANDC__))
|
||||||
# define STDC
|
# define STDC
|
||||||
#endif
|
#endif
|
||||||
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
#if !defined(STDC) && (defined(MSDOS) || defined(WINDOWS) || defined(WIN32))
|
||||||
# define STDC
|
# define STDC
|
||||||
#endif
|
#endif
|
||||||
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
#if !defined(STDC) && (defined(OS2) || defined(__HOS_AIX__))
|
||||||
# define STDC
|
# define STDC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
#if defined(__OS400__) && !defined(STDC) /* iSeries (formerly AS/400). */
|
||||||
# define STDC
|
# define STDC
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef STDC
|
#ifndef STDC
|
||||||
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
|
||||||
# define const /* note: need a more gentle solution here */
|
# define const /* note: need a more gentle solution here */
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Some Mac compilers merge all .h files incorrectly: */
|
/* Some Mac compilers merge all .h files incorrectly: */
|
||||||
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
#if defined(__MWERKS__)||defined(applec)||defined(THINK_C)||defined(__SC__)
|
||||||
# define NO_DUMMY_DECL
|
# define NO_DUMMY_DECL
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Maximum value for memLevel in deflateInit2 */
|
/* Maximum value for memLevel in deflateInit2 */
|
||||||
#ifndef MAX_MEM_LEVEL
|
#ifndef MAX_MEM_LEVEL
|
||||||
# ifdef MAXSEG_64K
|
# ifdef MAXSEG_64K
|
||||||
# define MAX_MEM_LEVEL 8
|
# define MAX_MEM_LEVEL 8
|
||||||
# else
|
# else
|
||||||
# define MAX_MEM_LEVEL 9
|
# define MAX_MEM_LEVEL 9
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
/* Maximum value for windowBits in deflateInit2 and inflateInit2.
|
||||||
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
* WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
|
||||||
* created by gzip. (Files created by minigzip can still be extracted by
|
* created by gzip. (Files created by minigzip can still be extracted by
|
||||||
* gzip.)
|
* gzip.)
|
||||||
*/
|
*/
|
||||||
#ifndef MAX_WBITS
|
#ifndef MAX_WBITS
|
||||||
# define MAX_WBITS 15 /* 32K LZ77 window */
|
# define MAX_WBITS 15 /* 32K LZ77 window */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The memory requirements for deflate are (in bytes):
|
/* The memory requirements for deflate are (in bytes):
|
||||||
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
(1 << (windowBits+2)) + (1 << (memLevel+9))
|
||||||
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
that is: 128K for windowBits=15 + 128K for memLevel = 8 (default values)
|
||||||
plus a few kilobytes for small objects. For example, if you want to reduce
|
plus a few kilobytes for small objects. For example, if you want to reduce
|
||||||
the default memory requirements from 256K to 128K, compile with
|
the default memory requirements from 256K to 128K, compile with
|
||||||
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
|
||||||
Of course this will generally degrade compression (there's no free lunch).
|
Of course this will generally degrade compression (there's no free lunch).
|
||||||
|
|
||||||
The memory requirements for inflate are (in bytes) 1 << windowBits
|
The memory requirements for inflate are (in bytes) 1 << windowBits
|
||||||
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
that is, 32K for windowBits=15 (default value) plus a few kilobytes
|
||||||
for small objects.
|
for small objects.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
/* Type declarations */
|
/* Type declarations */
|
||||||
|
|
||||||
#ifndef OF /* function prototypes */
|
#ifndef OF /* function prototypes */
|
||||||
# ifdef STDC
|
# ifdef STDC
|
||||||
# define OF(args) args
|
# define OF(args) args
|
||||||
# else
|
# else
|
||||||
# define OF(args) ()
|
# define OF(args) ()
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* The following definitions for FAR are needed only for MSDOS mixed
|
/* The following definitions for FAR are needed only for MSDOS mixed
|
||||||
* model programming (small or medium model with some far allocations).
|
* model programming (small or medium model with some far allocations).
|
||||||
* This was tested only with MSC; for other MSDOS compilers you may have
|
* This was tested only with MSC; for other MSDOS compilers you may have
|
||||||
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
* to define NO_MEMCPY in zutil.h. If you don't need the mixed model,
|
||||||
* just define FAR to be empty.
|
* just define FAR to be empty.
|
||||||
*/
|
*/
|
||||||
#ifdef SYS16BIT
|
#ifdef SYS16BIT
|
||||||
# if defined(M_I86SM) || defined(M_I86MM)
|
# if defined(M_I86SM) || defined(M_I86MM)
|
||||||
/* MSC small or medium model */
|
/* MSC small or medium model */
|
||||||
# define SMALL_MEDIUM
|
# define SMALL_MEDIUM
|
||||||
# ifdef _MSC_VER
|
# ifdef _MSC_VER
|
||||||
# define FAR _far
|
# define FAR _far
|
||||||
# else
|
# else
|
||||||
# define FAR far
|
# define FAR far
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
# if (defined(__SMALL__) || defined(__MEDIUM__))
|
||||||
/* Turbo C small or medium model */
|
/* Turbo C small or medium model */
|
||||||
# define SMALL_MEDIUM
|
# define SMALL_MEDIUM
|
||||||
# ifdef __BORLANDC__
|
# ifdef __BORLANDC__
|
||||||
# define FAR _far
|
# define FAR _far
|
||||||
# else
|
# else
|
||||||
# define FAR far
|
# define FAR far
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(WINDOWS) || defined(WIN32)
|
#if defined(WINDOWS) || defined(WIN32)
|
||||||
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
/* If building or using zlib as a DLL, define ZLIB_DLL.
|
||||||
* This is not mandatory, but it offers a little performance increase.
|
* This is not mandatory, but it offers a little performance increase.
|
||||||
*/
|
*/
|
||||||
# ifdef ZLIB_DLL
|
# ifdef ZLIB_DLL
|
||||||
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
# if defined(WIN32) && (!defined(__BORLANDC__) || (__BORLANDC__ >= 0x500))
|
||||||
# ifdef ZLIB_INTERNAL
|
# ifdef ZLIB_INTERNAL
|
||||||
# define ZEXTERN extern __declspec(dllexport)
|
# define ZEXTERN extern __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define ZEXTERN extern __declspec(dllimport)
|
# define ZEXTERN extern __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
# endif /* ZLIB_DLL */
|
# endif /* ZLIB_DLL */
|
||||||
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
/* If building or using zlib with the WINAPI/WINAPIV calling convention,
|
||||||
* define ZLIB_WINAPI.
|
* define ZLIB_WINAPI.
|
||||||
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
* Caution: the standard ZLIB1.DLL is NOT compiled using ZLIB_WINAPI.
|
||||||
*/
|
*/
|
||||||
# ifdef ZLIB_WINAPI
|
# ifdef ZLIB_WINAPI
|
||||||
# ifdef FAR
|
# ifdef FAR
|
||||||
# undef FAR
|
# undef FAR
|
||||||
# endif
|
# endif
|
||||||
# include <windows.h>
|
# include <windows.h>
|
||||||
/* No need for _export, use ZLIB.DEF instead. */
|
/* No need for _export, use ZLIB.DEF instead. */
|
||||||
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
/* For complete Windows compatibility, use WINAPI, not __stdcall. */
|
||||||
# define ZEXPORT WINAPI
|
# define ZEXPORT WINAPI
|
||||||
# ifdef WIN32
|
# ifdef WIN32
|
||||||
# define ZEXPORTVA WINAPIV
|
# define ZEXPORTVA WINAPIV
|
||||||
# else
|
# else
|
||||||
# define ZEXPORTVA FAR CDECL
|
# define ZEXPORTVA FAR CDECL
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined (__BEOS__)
|
#if defined (__BEOS__)
|
||||||
# ifdef ZLIB_DLL
|
# ifdef ZLIB_DLL
|
||||||
# ifdef ZLIB_INTERNAL
|
# ifdef ZLIB_INTERNAL
|
||||||
# define ZEXPORT __declspec(dllexport)
|
# define ZEXPORT __declspec(dllexport)
|
||||||
# define ZEXPORTVA __declspec(dllexport)
|
# define ZEXPORTVA __declspec(dllexport)
|
||||||
# else
|
# else
|
||||||
# define ZEXPORT __declspec(dllimport)
|
# define ZEXPORT __declspec(dllimport)
|
||||||
# define ZEXPORTVA __declspec(dllimport)
|
# define ZEXPORTVA __declspec(dllimport)
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef ZEXTERN
|
#ifndef ZEXTERN
|
||||||
# define ZEXTERN extern
|
# define ZEXTERN extern
|
||||||
#endif
|
#endif
|
||||||
#ifndef ZEXPORT
|
#ifndef ZEXPORT
|
||||||
# define ZEXPORT
|
# define ZEXPORT
|
||||||
#endif
|
#endif
|
||||||
#ifndef ZEXPORTVA
|
#ifndef ZEXPORTVA
|
||||||
# define ZEXPORTVA
|
# define ZEXPORTVA
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef FAR
|
#ifndef FAR
|
||||||
# define FAR
|
# define FAR
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if !defined(__MACTYPES__)
|
#if !defined(__MACTYPES__)
|
||||||
typedef unsigned char Byte; /* 8 bits */
|
typedef unsigned char Byte; /* 8 bits */
|
||||||
#endif
|
#endif
|
||||||
typedef unsigned int uInt; /* 16 bits or more */
|
typedef unsigned int uInt; /* 16 bits or more */
|
||||||
typedef unsigned long uLong; /* 32 bits or more */
|
typedef unsigned long uLong; /* 32 bits or more */
|
||||||
|
|
||||||
#ifdef SMALL_MEDIUM
|
#ifdef SMALL_MEDIUM
|
||||||
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
/* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
|
||||||
# define Bytef Byte FAR
|
# define Bytef Byte FAR
|
||||||
#else
|
#else
|
||||||
typedef Byte FAR Bytef;
|
typedef Byte FAR Bytef;
|
||||||
#endif
|
#endif
|
||||||
typedef char FAR charf;
|
typedef char FAR charf;
|
||||||
typedef int FAR intf;
|
typedef int FAR intf;
|
||||||
typedef uInt FAR uIntf;
|
typedef uInt FAR uIntf;
|
||||||
typedef uLong FAR uLongf;
|
typedef uLong FAR uLongf;
|
||||||
|
|
||||||
#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 */
|
#if 0 /* HAVE_UNISTD_H -- this line is updated by ./configure */
|
||||||
# include <sys/types.h> /* for off_t */
|
# include <sys/types.h> /* for off_t */
|
||||||
# include <unistd.h> /* for SEEK_* and off_t */
|
# 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
|
||||||
# define z_off_t off_t
|
# define z_off_t off_t
|
||||||
#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(__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
|
# ifdef FAR
|
||||||
# undef FAR
|
# undef FAR
|
||||||
# endif
|
# 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 */
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load diff
Loading…
Add table
Add a link
Reference in a new issue