diff --git a/harbour/contrib/hbzlib/License.txt b/harbour/contrib/hbzlib/License.txt
deleted file mode 100644
index 0fd5e9833c..0000000000
--- a/harbour/contrib/hbzlib/License.txt
+++ /dev/null
@@ -1,73 +0,0 @@
-/** \page pageLic Licensing information
-
-ZipArchive library - creation, modification and decompression of "zip" format archives
-Copyright © 2000 - 2002 Tadeusz Dracz.
-E-Mail: \htmlonly tdracz@artpol-software.com
-Web: http://www.artpol-software.com \endhtmlonly
-
-This program is free software; you can redistribute it and/or
-modify it under the terms of the GNU General Public License
-as published by the Free Software Foundation; either version 2
-of the License, or (at your option) any later version.
-
-This library is distributed in the hope that it will be useful,
-but WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-See the GNU General Public License for more details.
-
-You should have received a copy of the GNU General Public
-License along with this library; if not, write to the Free Software
-Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-
-
-*************************************************************************
-An English version of the \ref pageGPL "GNU GPL" is in the gpl.txt file distributed with
-this project. Translations to other languages are available at:
-\htmlonly
-http://www.gnu.org/copyleft/gpl.html
-\endhtmlonly
-
-
-Distributing ZipArchive under GNU GPL implies ZipArchive can only be used
-with software that is licensed under conditions compliant with the GPL.
-Embedding in proprietary software requires an alternative license.
-
-
-\subsection s1 Alternative license for use with proprietary software
-
-
-If you want to distribute software in a commercial context that incorporates
-ZipArchive and you do not want to meet the conditions of GNU GPL
-(e.g. an obligation to provide a customer with the source code of your
-software that uses the ZipArchive library), you need to have a commercial license.
-- The commercial license provides you with the same rights as the GNU GPL, but in
-addition allows you to embed ZipArchive library in proprietary software without
-affecting the copyright of this software (it removes the GNU GPL obligation
-to publish the source code)
-- The license gives you royalty free distribution rights
-- The license does not allow you to transfer these rights
-- The license is granted per developer
-- You won't need to purchase an additional license for the future versions of the library
-
-
-The commercial license is available free of charge for using ZipArchive library in:
-- freeware software (freeware is software that is available free of charge, but which is copyrighted by the developer, who retains the right to control its redistribution and to sell it in the future)
- - excluded is software which is associated with an equipment that the same company manufactures and which has no practical usage value without it (e.g. software used for maintenace of machines) - unless the equipment is free as well (?)
- - if you decide to sell the software in the future - you will need to purchase the commercial license for using the ZipArchive library, unless it is distributed in the shareware way - see below
-- software distributed in the Shareware way (Shareware distribution gives users a chance to try software before buying it. If you try a Shareware program and continue using it, you are expected to register. Individual programs differ on details -- some request registration while others require it, some specify a maximum trial period.
-Copyright laws apply to both Shareware and commercial software and the copyright holder retains all rights, with the exception that copying and distributing the program for evaluation purposes is encouraged, subject to certain conditions. For example, some authors require written permission before a commercial disk vendor may copy their Shareware. )
- - excluded is software which price for a single copy is higher than the price of the ZipArchive library for a single developer
-
-Extended Licence for HBZLIB (library for zip compression in \htmlonly Harbour\endhtmlonly)
-You can create proprietary software using hbzlib respecting the follow:
-- ZipArchive library must be linked together with hbzlib
-- you cannot use ZipArchive as a dynamic library (DLL), it must be linked staticaly with the software
-- the commercial license for ZipArchive is free of charge, but these grants are valid only if the whole application is written with Harbour
-
-There is a fee for the commercial license for using the library in the software not falling into the mentioned categories.
-
-It is recommended that you should print two copies of the commercial license
-document after you receive it, sign them and send by post. One copy, signed by the author will be sent back to you.
-Please \htmlonly contact the author or visit the Artpol Software web site\endhtmlonly to find out more.
-
-*/
diff --git a/harbour/contrib/hbzlib/Linux/Makefile b/harbour/contrib/hbzlib/Linux/Makefile
deleted file mode 100644
index af73e9f967..0000000000
--- a/harbour/contrib/hbzlib/Linux/Makefile
+++ /dev/null
@@ -1,91 +0,0 @@
-# Makefile for ZipArchive library
-# Copyright (C) 2000-2002 Tadeusz Dracz
-# For conditions of distribution and use, see copyright notice in License.txt
-# To install to /usr/lib and /usr/include, type:
-# make install
-# to install to a different directory change prefix
-
-
-
-CC=g++
-CCC=cc
-
-#FLAGSD = -g
-FLAGSD =
-
-ZIPARCHLIB = libziparch.a
-
-ZIPPIELOCATION = stl/zippie/
-
-prefix = /usr
-libdir = ${prefix}/lib
-includedir = ${prefix}/include
-zipardir = $(includedir)/ziparchive
-
-AR=ar rc
-RANLIB=ranlib
-
-.SUFFIXES: .c .cpp
-.c.o:
- $(CCC) -c -I. -I$(HB_INC_INSTALL) -o $*.o $<
-.cpp.o:
- $(CC) $(FLAGSD) -I$(HB_INC_INSTALL) -c -I. $<
-
-OBJS = ZipArchive.o ZipAutoBuffer.o ZipCentralDir.o \
-ZipCompatibility.o ZipException.o ZipFile.o ZipFileHeader.o \
-ZipMemFile.o ZipPathComponent.o ZipPlatform.o ZipPlatformComm.o \
-ZipStorage.o ZipString.o zipnew.o zipcomp.o zip.o
-
-#OBJSZLIB = zlib/adler32.o zlib/compress.o zlib/crc32.o zlib/uncompr.o zlib/deflate.o zlib/trees.o \
-zlib/zutil.o zlib/inflate.o zlib/infblock.o zlib/inftrees.o zlib/infcodes.o zlib/infutil.o zlib/inffast.o
-
-OBJSZLIB =
-
-$(ZIPARCHLIB): $(OBJS) $(OBJSZLIB)
- $(AR) $@ $(OBJS) $(OBJSZLIB)
- -@ ($(RANLIB) $@ || true) >/dev/null 2>&1
-
-ZipArchive.o: ZipArchive.h
-ZipAutoBuffer.o: ZipAutoBuffer.h
-ZipCentralDir.o: ZipCentralDir.h
-ZipCompatibility.o: ZipCompatibility.h
-ZipException.o: ZipException.h
-ZipFile.o: ZipFile.h
-ZipFileHeader.o: ZipFileHeader.h
-ZipMemFile.o: ZipMemFile.h
-ZipPathComponent.o: ZipPathComponent.h
-ZipPlatform.o: ZipPlatform.h
-ZipStorage.o: ZipStorage.h
-ZipString.o: ZipString.h
-zipnew.o: hbzip2.h
-zipcomp.o: hbzip2.h
-zip.o: hbzip2.h
-
-clean:
- -rm -f *.o *~ $(ZIPARCHLIB)
-
-zippie:
-
- $(CC) -I$(zipardir) -I$(HB_INC_INSTALL) $(FLAGSD) -o zippie $(ZIPPIELOCATION)zippie.cpp $(ZIPPIELOCATION)CmdLine.cpp -lz -lstdc++ -lziparch
-# $(CC) -I$(zipardir) $(FLAGSD) -o zippie ZIPPIELOCATION)zippie.cpp $(ZIPPIELOCATION)CmdLine.cpp -lstdc++ -lziparch
-cleanzippie:
- -rm -f zippie
-
-install:
- -@if [ ! -d $(includedir) ]; then mkdir $(includedir); fi
- -@if [ ! -d $(libdir) ]; then mkdir $(libdir); fi
- -@if [ ! -d $(zipardir) ]; then mkdir $(zipardir); fi
- cp libziparch.a $(libdir)
- cp libziparch.a /usr/lib/xharbour
- chmod 755 $(libdir)/$(ZIPARCHLIB)
- chmod 755 /usr/lib/xharbour/libziparch.a
- cp *.h $(zipardir)
- chmod 644 $(zipardir)/*h
-
-uninstall:
- rm -f $(zipardir)/*h
- rm -f $(libdir)/$(ZIPARCHLIB)
- rmdir $(zipardir)
-
-
-
diff --git a/harbour/contrib/hbzlib/Linux/ZipFileMapping.h b/harbour/contrib/hbzlib/Linux/ZipFileMapping.h
deleted file mode 100644
index a38e6e9d11..0000000000
--- a/harbour/contrib/hbzlib/Linux/ZipFileMapping.h
+++ /dev/null
@@ -1,70 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-// $Workfile: ZipFileMapping.h $
-// $Archive: /ZipArchive_Linux/ZipFileMapping.h $
-// $Date$ $Author$
-////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyright 2000-2002 by Tadeusz Dracz (http://www.artpol-software.com/)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// For the licensing details see the file License.txt
-////////////////////////////////////////////////////////////////////////////////
-
-
-#if !defined(AFX_AUTOHANDLE_H__D68326EA_D7FA_4792_AB1F_68D09533E399__INCLUDED_)
-#define AFX_AUTOHANDLE_H__D68326EA_D7FA_4792_AB1F_68D09533E399__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include
-
-namespace ziparchv
-{
-
-
- struct CZipFileMapping
- {
- CZipFileMapping()
- {
- m_iSize = 0;
- m_pFileMap = NULL;
- }
- bool CreateMapping(CZipFile* pFile)
- {
- if (!pFile)
- return false;
- m_iSize = pFile->GetLength();
- m_pFileMap = mmap(0, m_iSize, PROT_READ|PROT_WRITE, MAP_SHARED, pFile->m_hFile, 0);
- return (m_pFileMap != NULL);
- }
- void RemoveMapping()
- {
-
- if (m_pFileMap)
- {
- munmap(m_pFileMap, m_iSize);
- m_pFileMap = NULL;
- }
- }
- ~CZipFileMapping()
- {
- RemoveMapping();
- }
- char* GetMappedMemory()
- {
- return reinterpret_cast (m_pFileMap);
- }
- protected:
- void* m_pFileMap;
- size_t m_iSize;
-
- };
-}
-
-#endif // !defined(AFX_AUTOHANDLE_H__D68326EA_D7FA_4792_AB1F_68D09533E399__INCLUDED_)
diff --git a/harbour/contrib/hbzlib/Linux/ZipPathComponent.cpp b/harbour/contrib/hbzlib/Linux/ZipPathComponent.cpp
deleted file mode 100644
index 69431d104b..0000000000
--- a/harbour/contrib/hbzlib/Linux/ZipPathComponent.cpp
+++ /dev/null
@@ -1,194 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-
-// $Workfile: ZipPathComponent.cpp $
-
-// $Archive: /ZipArchive_Linux/ZipPathComponent.cpp $
-
-// $Date$ $Author$
-
-////////////////////////////////////////////////////////////////////////////////
-
-// This source file is part of the ZipArchive library source distribution and
-
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-
-//
-
-// This program is free software; you can redistribute it and/or
-
-// modify it under the terms of the GNU General Public License
-
-// as published by the Free Software Foundation; either version 2
-
-// of the License, or (at your option) any later version.
-
-//
-
-// For the licensing details see the file License.txt
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-
-#include "stdafx.h"
-
-#include "zippathcomponent.h"
-
-
-
-//////////////////////////////////////////////////////////////////////
-
-// Construction/Destruction
-
-//////////////////////////////////////////////////////////////////////
-
-
-
-
-
-CZipPathComponent::~CZipPathComponent()
-
-{
-
-
-
-}
-
-
-
-void CZipPathComponent::SetFullPath(LPCTSTR lpszFullPath)
-
-{
-
-
-
- CZipString szTempPath(lpszFullPath);
-
- const CZipString szPrefix = _T("\\\\?\\unc\\");
-
- int i = -1, iLen = szPrefix.GetLength();
-
- if (iLen > szTempPath.GetLength())
-
- iLen = szTempPath.GetLength();
-
- CZipString szPossiblePrefix = szTempPath.Left(iLen);
-
- szPossiblePrefix.MakeLower(); // must perform case insensitive comparison
-
- while (++i < iLen && szPossiblePrefix[i] == szPrefix[i]);
-
- if (i == 2 || i == 4 || i == 8) // unc path, unicode path or unc path meeting windows file name conventions
-
- {
-
- m_szPrefix = szTempPath.Left(i);
-
- szTempPath = szTempPath.Mid(i);
-
- }
-
- else
-
- m_szPrefix.Empty();
-
-
-
-
-
- m_szDrive.Empty();
-
- m_szFileTitle.Empty();
-
- m_szDirectory.Empty();
-
- m_szFileExt.Empty();
-
- int p;
-
- for (p = szTempPath.GetLength() - 1; p >= 0; p--)
-
- if (szTempPath[p] == m_cSeparator)
-
- break;
-
-
-
- if (p != -1)
-
- {
-
- m_szDirectory = szTempPath.Left(p);
-
- if (p == szTempPath.GetLength() - 1 )
-
- return; // no filename present
-
- else
-
- p++;
-
- }
-
- else
-
- p = 0;
-
-
-
- // p points at the beginning of the filename
-
- m_szFileTitle = szTempPath.Mid(p);
-
- for (p = m_szFileTitle.GetLength() - 1; p >= 0; p--)
-
- if (m_szFileTitle[p] == _T('.'))
-
- break;
-
-
-
- if (p != -1)
-
- {
-
- m_szFileExt = m_szFileTitle.Mid(p+1);
-
- m_szFileTitle = m_szFileTitle.Left(p);
-
- }
-
-
-
-
-
-
-
-}
-
-
-
-
-
-CZipString CZipPathComponent::GetNoDrive() const
-
-{
-
- CZipString szPath = m_szDirectory;
-
- CZipString szFileName = GetFileName();
-
- if (!szFileName.IsEmpty() && !szPath.IsEmpty())
-
- szPath += m_cSeparator;
-
-
-
- szPath += szFileName;
-
- return szPath;
-
-}
-
-
-
diff --git a/harbour/contrib/hbzlib/Linux/ZipPlatform.cpp b/harbour/contrib/hbzlib/Linux/ZipPlatform.cpp
deleted file mode 100644
index ebc14abab6..0000000000
--- a/harbour/contrib/hbzlib/Linux/ZipPlatform.cpp
+++ /dev/null
@@ -1,546 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-
-// $Workfile: ZipPlatform.cpp $
-
-// $Archive: /ZipArchive_Linux/ZipPlatform.cpp $
-
-// $Date$ $Author$
-
-////////////////////////////////////////////////////////////////////////////////
-
-// This source file is part of the ZipArchive library source distribution and
-
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-
-//
-
-// This program is free software; you can redistribute it and/or
-
-// modify it under the terms of the GNU General Public License
-
-// as published by the Free Software Foundation; either version 2
-
-// of the License, or (at your option) any later version.
-
-//
-
-// For the licensing details see the file License.txt
-
-////////////////////////////////////////////////////////////////////////////////
-
-
-
-
-
-#include "stdafx.h"
-
-#include "zipplatform.h"
-
-#include "zipfileheader.h"
-
-#include "zipexception.h"
-
-#include "zipautobuffer.h"
-
-
-
-
-
-#include
-
-
-
-
-
-
-
-#include "zippathcomponent.h"
-
-
-
-
-
-#include "zipcompatibility.h"
-
-#include
-
-#include
-
-#include
-
-#include
-
-#include
-
-#include
-
-
-
-const TCHAR CZipPathComponent::m_cSeparator = _T('/');
-
-
-
-#ifndef _UTIMBUF_DEFINED
-
-#define _utimbuf utimbuf
-
-#endif
-
-
-
-//////////////////////////////////////////////////////////////////////
-
-// Construction/Destruction
-
-//////////////////////////////////////////////////////////////////////
-
-DWORD ZipPlatform::GetDeviceFreeSpace(LPCTSTR lpszPath)
-
-{
-
- struct statfs sStats;
-
- if (statfs(lpszPath, &sStats) == -1)
-
- return 0;
-
-
-
- return sStats.f_bsize * sStats.f_bavail;
-
-}
-
-
-
-bool ZipPlatform::GetFileSize(LPCTSTR lpszFileName, DWORD& dSize)
-
-{
-
- int f = open(lpszFileName, O_RDONLY);
-
- if (f == -1)
-
- return false;
-
- int iSize = lseek(f, 0, SEEK_END);
-
- close(f);
-
- if (iSize == -1)
-
- return false;
-
- dSize = (DWORD)iSize;
-
- return true;
-
-}
-
-
-
-CZipString ZipPlatform::GetTmpFileName(LPCTSTR lpszPath, DWORD iSizeNeeded)
-
-{
-
- TCHAR empty[] = _T(""), prefix [] = _T("zar");
-
- TCHAR* buf = NULL;
-
- CZipString tempPath;
-
- if (lpszPath)
-
- {
-
- // first try the user provided directory
-
- tempPath = lpszPath;
-
- if (ZipPlatform::GetDeviceFreeSpace(tempPath) < iSizeNeeded)
-
- tempPath.Empty();
-
- else
-
- {
-
- CZipPathComponent::AppendSeparator(tempPath);
-
- tempPath += prefix;
-
- tempPath += _T("XXXXXX");
-
- TCHAR* c = mktemp(tempPath.GetBuffer(tempPath.GetLength()));
-
- tempPath.ReleaseBuffer();
-
- if (c)
-
- return tempPath;
-
- else
-
- tempPath.Empty();
-
- }
-
- }
-
-
-
-
-
- TCHAR* v = tempnam(tempPath, prefix);
-
- tempPath = v;
-
- free(v);
-
-
-
- if (!tempPath.IsEmpty())
-
- {
-
- CZipPathComponent zpc(tempPath);
-
- if (ZipPlatform::GetDeviceFreeSpace(zpc.GetFilePath()) < iSizeNeeded)
-
- return empty;
-
- return tempPath;
-
- }
-
- else
-
- return empty;
-
-}
-
-
-
-bool ZipPlatform::GetCurrentDirectory(CZipString& sz)
-
-{
-
- char* pBuf = getcwd(NULL, 0);
-
- if (!pBuf)
-
- return false;
-
- sz = pBuf;
-
- free(pBuf);
-
- return true;
-
-}
-
-
-
-bool ZipPlatform::SetFileAttr(LPCTSTR lpFileName, DWORD uAttr)
-
-{
-
- return chmod(lpFileName, uAttr >> 16) == 0;
-
-
-
-}
-
-
-
-bool ZipPlatform::GetFileAttr(LPCTSTR lpFileName, DWORD& uAttr)
-
-{
-
- struct stat sStats;
-
- if (stat(lpFileName, &sStats) == -1)
-
- return false;
-
- uAttr = (sStats.st_mode & (S_IRWXU | S_IRWXG | S_IRWXO | S_IFMT)) << 16;
-
- return true;
-
-
-
-
-
-}
-
-
-
-bool ZipPlatform::GetFileModTime(LPCTSTR lpFileName, time_t & ttime)
-
-{
-
-
-
- struct stat st;
-
- if (stat(lpFileName, &st) != 0)
-
- return false;
-
-
-
- ttime = st.st_mtime;
-
- return ttime != -1;
-
-}
-
-
-
-bool ZipPlatform::SetFileModTime(LPCTSTR lpFileName, time_t ttime)
-
-{
-
- struct utimbuf ub;
-
- ub.actime = time(NULL);
-
- ub.modtime = ttime == -1 ? time(NULL) : ttime; // if wrong file time, set it to the current
-
- return utime(lpFileName, &ub) == 0;
-
-}
-
-
-
-
-
-bool ZipPlatform::ChangeDirectory(LPCTSTR lpDirectory)
-
-{
-
- return chdir(lpDirectory) == 0;
-
-}
-
-int ZipPlatform::FileExists(LPCTSTR lpszName)
-
-{
-
- struct stat st;
-
- if (stat(lpszName, &st) != 0)
-
- return 0;
-
- else
-
- {
-
- if (S_ISDIR(st.st_mode))
-
- return -1;
-
- else
-
- return 1;
-
- }
-
-
-
-
-
-
-
-}
-
-
-
-ZIPINLINE bool ZipPlatform::IsDriveRemovable(LPCTSTR lpszFilePath)
-
-{
-
- // not implemmented
-
- return true;
-
-}
-
-
-
-ZIPINLINE bool ZipPlatform::SetVolLabel(LPCTSTR lpszPath, LPCTSTR lpszLabel)
-
-{
-
- // not implemmented
-
- return true;
-
-}
-
-
-
-ZIPINLINE void ZipPlatform::AnsiOem(CZipAutoBuffer& buffer, bool bAnsiToOem)
-
-{
-
- // not implemmented
-
-}
-
-
-
-ZIPINLINE bool ZipPlatform::RemoveFile(LPCTSTR lpszFileName, bool bThrow)
-
-{
-
- if (unlink(lpszFileName) != 0)
-
- if (bThrow)
-
- CZipException::Throw(CZipException::notRemoved, lpszFileName);
-
- else
-
- return false;
-
- return true;
-
-
-
-
-
-}
-
-ZIPINLINE bool ZipPlatform::RenameFile( LPCTSTR lpszOldName, LPCTSTR lpszNewName , bool bThrow)
-
-{
-
-
-
- if (rename(lpszOldName, lpszNewName) != 0)
-
- if (bThrow)
-
- CZipException::Throw(CZipException::notRenamed, lpszOldName);
-
- else
-
- return false;
-
- return true;
-
-
-
-}
-
-ZIPINLINE bool ZipPlatform::IsDirectory(DWORD uAttr)
-
-{
-
- return S_ISDIR(uAttr >> 16) != 0;
-
-}
-
-ZIPINLINE bool ZipPlatform::CreateDirectory(LPCTSTR lpDirectory)
-
-{
-
- return mkdir(lpDirectory, S_IRUSR | S_IWUSR | S_IRGRP |S_IROTH) == 0;
-
-
-
-}
-
-
-
-ZIPINLINE DWORD ZipPlatform::GetDefaultAttributes()
-
-{
-
- return 0x81a40000;
-
-}
-
-
-
-ZIPINLINE DWORD ZipPlatform::GetDefaultDirAttributes()
-
-{
-
- return 0x41ff0010;
-
-}
-
-
-
-
-
-ZIPINLINE int ZipPlatform::GetSystemID()
-
-{
-
- return ZipCompatibility::zcUnix;
-
-}
-
-
-
-ZIPINLINE bool ZipPlatform::GetSystemCaseSensitivity()
-
-{
-
- return true;
-
-}
-
-
-
-
-
-bool ZipPlatform::TruncateFile(int iDes, DWORD iSize)
-
-{
-
- return ftruncate(iDes, iSize) == 0;
-
-
-
-}
-
-
-
-int ZipPlatform::OpenFile(LPCTSTR lpszFileName, UINT iMode, int iShareMode)
-
-{
-
- return open(lpszFileName, iMode, S_IRUSR | S_IWUSR | S_IRGRP |S_IROTH );
-
-}
-
-
-
-bool ZipPlatform::FlushFile(int iDes)
-
-{
-
- return fsync(iDes) == 0;
-
-}
-
-
-
-int ZipPlatform::GetFileSystemHandle(int iDes)
-
-{
-
- return iDes;
-
-}
-
-
-
-
-
-
-
diff --git a/harbour/contrib/hbzlib/ZipString.cpp b/harbour/contrib/hbzlib/ZipString.cpp
deleted file mode 100644
index e7c3b38f70..0000000000
--- a/harbour/contrib/hbzlib/ZipString.cpp
+++ /dev/null
@@ -1,25 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-// $Workfile: ZipString.cpp $
-// $Archive: /ZipArchive/ZipString.cpp $
-// $Date$ $Author$
-////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// For the licensing details see the file License.txt
-////////////////////////////////////////////////////////////////////////////////
-
-#include "zipstring.h"
-
-ZIPSTRINGCOMPARE GetCZipStrCompFunc(bool bCaseSensitive, bool bCollate)
-{
- if (bCollate)
- return bCaseSensitive ? & CZipString::Collate : & CZipString::CollateNoCase;
- else
- return bCaseSensitive ? & CZipString::Compare : & CZipString::CompareNoCase;
-}
diff --git a/harbour/contrib/hbzlib/doc/zip.txt b/harbour/contrib/hbzlib/doc/zip.txt
deleted file mode 100644
index 8e364f6f0a..0000000000
--- a/harbour/contrib/hbzlib/doc/zip.txt
+++ /dev/null
@@ -1,178 +0,0 @@
-/*
- * $DOC$
- * $FUNCNAME$
- * HB_ZIPFILE()
- * $CATEGORY$
- * ZIP FUNCTION
- * $ONELINER$
- * Create a zip file
- * $SYNTAX$
- * HB_ZIPFILE( , | , ,
- * , ) ---> lCompress
- * $ARGUMENTS$
- * Name of the zip file
- *
- * Name of a file to Compress, Drive and/or path
- * can be used
- *
- * An array containing files to compress, Drive and/or path
- * can be used
- *
- * Compression level ranging from 0 to 9
- *
- * Code block to execute while compressing
- *
- * Toggle to overwite the file if exists
- * $RETURNS$
- * .t. if file was create, otherwise .f.
- * $DESCRIPTION$
- * This function creates a zip file named . If the extension
- * is ommited, .ZIP will be assumed. If the second parameter is a
- * character string, this file will be added to the zip file. If the
- * second parameter is an array, all file names contained in
- * will be compressed.
- *
- * If is used, it detemines the compression type where 0 means
- * no compression and 9 means best compression.
- *
- * If is used, every time the file is opened to compress it
- * will evaluate bBlock. Parameters of bBlock are cFile and nPos.
- *
- * If is used , it toggles to overwrite or not the existing
- * file. Default is to overwrite the file.
- * $EXAMPLES$
- * FUNCTION MAIN()
- *
- * IF HB_ZIPFILE( "TEST.ZIP","TEST.PRG")
- * qout("File was successly create")
- * ENDIF
- *
- * IF HB_ZIPFILE( "TEST1.ZIP",{"TEST.PRG","c:\windows\win.ini"})
- * qout("File was successly create")
- * ENDIF
- *
- * IF HB_ZIPFILE( "TEST2.ZIP",{"TEST.PRG","c:\windows\win.ini"},8,{|nPos,cFile|,qout(cFile)})
- * qout("File was successly create")
- * ENDIF
- *
- * aFiles := {"TEST.PRG","c:\windows\win.ini"}
- * nLen := Len(afiles)
- * aGauge := GaugeNew( 5, 5, 7,40 , "W/B", "W+/B" ,'²')
- * GaugeDisplay( aGauge )
- * Hb_ZIPFILE('test33.zip',aFiles,8,{|cFile,nPos| GaugeUpdate(aGauge,nPos/nLen)})
- * Return Nil
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/*
- * $DOC$
- * $FUNCNAME$
- * HB_UNZIPFILE()
- * $CATEGORY$
- * ZIP FUNCTION
- * $ONELINER$
- * Unzip a compressed file
- * $SYNTAX$
- * HB_UNZIPFILE( , , ) ---> lCompress
- * $ARGUMENTS$
- * Name of the zip file
- *
- * Code block to execute while compressing
- *
- * Toggle to create directory if needed
- *
- * $RETURNS$
- * .t. if all file was successfuly restored, otherwise .f.
- * $DESCRIPTION$
- * This function restores all files contained inside the .
- * If the extension is ommited, .ZIP will be assumed. If a file already
- * exists, it wlll be overwriten.
- *
- * If is used, every time the file is opened to compress it
- * will evaluate bBlock. Parameters of bBlock are cFile and nPos.
- * $EXAMPLES$
- * FUNCTION MAIN()
- *
- * IF HB_UNZIPFILE( "TEST.ZIP")
- * qout("File was successly create")
- * ENDIF
- *
- * IF HB_ZIPFILE( "TEST2.ZIP",{|cFile|,qout(cFile)})
- * qout("File was successly create")
- * ENDIF
- *
- * Return Nil
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/*
- * $DOC$
- * $FUNCNAME$
- * HB_GETUNZIPFILE()
- * $CATEGORY$
- * ZIP FUNCTION
- * $ONELINER$
- * Gets the number of files that are in the zipfile
- * $SYNTAX$
- * HB_GETUNZIPFILE( ) ---> nNumber
- * $ARGUMENTS$
- * Name of the zip file
- * $RETURNS$
- * The number of files contained inside the zipfile
- * $DESCRIPTION$
- * This function returns the number of files that is stored in the zipfile.
- * The purpose for this function is to use in conjuntion with the
- * HB_UNZIPFILE() function, so you can use returned result in the code
- * block. See example below.
- * $EXAMPLES$
- * FUNCTION MAIN()
- * Local nFiles :=HB_GETUNZIPFILE('test.zip')
- *
- * if nFiles >0
- * ? "This files Contains ",nfiles
- * endif
- *
- * Return Nil
- *
- * Here is an example of How to use HB_GETUNZIPFILE() in conjunction
- * with HB_UNZIPFILE()
- *
- * Function Main()
- * Local aGauge,nLen
- *
- * aGauge := GaugeNew( 5, 5, 7,40 , "W/B", "W+/B" ,'²')
- * GaugeDisplay( aGauge )
- * nLen := HB_GETUNZIPFILE('test22')
- * hb_UNZIPFILE('test22',{|cFile,nPos| GaugeUpdate(aGauge,nPos/nLen),qout(cFile)},.t.)
- *
- * Return Nil
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
diff --git a/harbour/contrib/hbzlib/doc/zipnew.txt b/harbour/contrib/hbzlib/doc/zipnew.txt
deleted file mode 100644
index 6992656b6a..0000000000
--- a/harbour/contrib/hbzlib/doc/zipnew.txt
+++ /dev/null
@@ -1,708 +0,0 @@
-/*
- * $DOC$
- * $FUNCNAME$
- * HB_ZIPFILE()
- * $CATEGORY$
- * ZIP FUNCTION
- * $ONELINER$
- * Create a zip file
- * $SYNTAX$
- * HB_ZIPFILE( , | , ,
- * , ,,,) ---> lCompress
- * $ARGUMENTS$
- * Name of the zip file
- *
- * Name of a file to Compress, Drive and/or path
- * can be used
- *
- * An array containing files to compress, Drive and/or path
- * can be used
- *
- * Compression level ranging from 0 to 9
- *
- * Code block to execute while compressing
- *
- * Toggle to overwite the file if exists
- *
- * Password to encrypt the files
- *
- * Toggle to store the path or not
- *
- * Toggle to store the Drive letter and path or not
- * $RETURNS$
- * .t. if file was create, otherwise .f.
- * $DESCRIPTION$
- * This function creates a zip file named . If the extension
- * is ommited, .ZIP will be assumed. If the second parameter is a
- * character string, this file will be added to the zip file. If the
- * second parameter is an array, all file names contained in
- * will be compressed.
- *
- * If is used, it detemines the compression type where 0 means
- * no compression and 9 means best compression.
- *
- * If is used, every time the file is opened to compress it
- * will evaluate bBlock. Parameters of bBlock are cFile and nPos.
- *
- * If is used , it toggles to overwrite or not the existing
- * file. Default is to overwrite the file,otherwise if is false
- * the new files are added to the .
- *
- * If is used, all files that are added to the archive are encrypted
- * with the password.
- *
- * If is used, it tells thats the path should also be stored with
- * the file name. Default is false.
- *
- * If is used, it tells thats the Drive and path should also be stored
- * with the file name. Default is false.
- *
- * $EXAMPLES$
- * FUNCTION MAIN()
- *
- * IF HB_ZIPFILE( "TEST.ZIP","TEST.PRG")
- * qout("File was successly create")
- * ENDIF
- *
- * IF HB_ZIPFILE( "TEST1.ZIP",{"TEST.PRG","c:\windows\win.ini"})
- * qout("File was successly create")
- * ENDIF
- *
- * IF HB_ZIPFILE( "TEST2.ZIP",{"TEST.PRG","c:\windows\win.ini"},8,{|nPos,cFile|,qout(cFile)})
- * qout("File was successly create")
- * ENDIF
- *
- * aFiles := {"TEST.PRG","c:\windows\win.ini"}
- * nLen := Len(afiles)
- * aGauge := GaugeNew( 5, 5, 7,40 , "W/B", "W+/B" ,'²')
- * GaugeDisplay( aGauge )
- * Hb_ZIPFILE('test33.zip',aFiles,8,{|cFile,nPos| GaugeUpdate(aGauge,nPos/nLen)},,'hello')
- * Return Nil
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/*
- * $DOC$
- * $FUNCNAME$
- * HB_UNZIPFILE()
- * $CATEGORY$
- * ZIP FUNCTION
- * $ONELINER$
- * Unzip a compressed file
- * $SYNTAX$
- * HB_UNZIPFILE( , , ) ,,,
- * [|] <---> lCompress
- * $ARGUMENTS$
- * Name of the zip file
- *
- * Code block to execute while compressing
- *
- * Toggle to create directory if needed
- *
- * Password to use to extract files
- *
- * Path to extract the files.
- *
- * | An file or an Array of files to extract
- * $RETURNS$
- * .t. if all file was successfuly restored, otherwise .f.
- * $DESCRIPTION$
- * This function restores all files contained inside the .
- * If the extension is ommited, .ZIP will be assumed. If a file already
- * exists, it wlll be overwriten.
- *
- * If is used, every time the file is opened to compress it
- * will evaluate bBlock. Parameters of bBlock are cFile and nPos.
- *
- * The is an obrogatory parameter. Set to ".\" to extract to the
- * current dir
- * $EXAMPLES$
- * FUNCTION MAIN()
- *
- * IF HB_UNZIPFILE( "TEST.ZIP")
- * qout("File was successly create")
- * ENDIF
- *
- * IF HB_ZIPFILE( "TEST2.ZIP",{|cFile|,qout(cFile)})
- * qout("File was successly create")
- * ENDIF
- *
- * Return Nil
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/*
- * $DOC$
- * $FUNCNAME$
- * HB_GETUNZIPFILE()
- * $CATEGORY$
- * ZIP FUNCTION
- * $ONELINER$
- * Gets the number of files that are in the zipfile
- * $SYNTAX$
- * HB_GETUNZIPFILE( ) ---> nNumber
- * $ARGUMENTS$
- * Name of the zip file
- * $RETURNS$
- * The number of files contained inside the zipfile
- * $DESCRIPTION$
- * This function returns the number of files that is stored in the zipfile.
- * The purpose for this function is to use in conjuntion with the
- * HB_UNZIPFILE() function, so you can use returned result in the code
- * block. See example below.
- * $EXAMPLES$
- * FUNCTION MAIN()
- * Local nFiles :=HB_GETUNZIPFILE('test.zip')
- *
- * if nFiles >0
- * ? "This files Contains ",nfiles
- * endif
- *
- * Return Nil
- *
- * Here is an example of How to use HB_GETUNZIPFILE() in conjunction
- * with HB_UNZIPFILE()
- *
- * Function Main()
- * Local aGauge,nLen
- *
- * aGauge := GaugeNew( 5, 5, 7,40 , "W/B", "W+/B" ,'²')
- * GaugeDisplay( aGauge )
- * nLen := HB_GETUNZIPFILE('test22')
- * hb_UNZIPFILE('test22',{|cFile,nPos| GaugeUpdate(aGauge,nPos/nLen),qout(cFile)},.t.)
- *
- * Return Nil
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/*
- * $DOC$
- * $FUNCNAME$
- * HB_ZIPFILEBYTDSPAN()
- * $CATEGORY$
- * ZIP FUNCTION
- * $ONELINER$
- * Create a zip file
- * $SYNTAX$
- * HB_ZIPFILEBYTDSPAN()( , | , ,
- * , ,,,,) ---> lCompress
- * $ARGUMENTS$
- * Name of the zip file
- *
- * Name of a file to Compress, Drive and/or path
- * can be used
- *
- * An array containing files to compress, Drive and/or path
- * can be used
- *
- * Compression level ranging from 0 to 9
- *
- * Code block to execute while compressing
- *
- * Toggle to overwite the file if exists
- *
- * Password to encrypt the files
- *
- * Size of the archive, in bytes,default is 1457664 bytes
- *
- * Toggle to store the path or not
- *
- * Toggle to store the Drive letter and path or not
- * $RETURNS$
- * .t. if file was create, otherwise .f.
- * $DESCRIPTION$
- * This function creates a zip file named . If the extension
- * is ommited, .ZIP will be assumed. If the second parameter is a
- * character string, this file will be added to the zip file. If the
- * second parameter is an array, all file names contained in
- * will be compressed.
- *
- * If is used, it detemines the compression type where 0 means
- * no compression and 9 means best compression.
- *
- * If is used, every time the file is opened to compress it
- * will evaluate bBlock. Parameters of bBlock are cFile and nPos.
- *
- * If is used , it toggles to overwrite or not the existing
- * file. Default is to overwrite the file,otherwise if is false
- * the new files are added to the .
- *
- * If is used, it tells thats the path should also be stored with
- * the file name. Default is false.
- *
- * If is used, it tells thats the Drive and path should also be stored
- * with the file name. Default is false.
- *
- * $EXAMPLES$
- * FUNCTION MAIN()
- *
- * IF HB_ZIPFILEBYTDSPAN( "TEST.ZIP","TEST.PRG")
- * qout("File was successly create")
- * ENDIF
- *
- * IF ZIPFILEBYTDSPAN( "TEST1.ZIP",{"TEST.PRG","c:\windows\win.ini"})
- * qout("File was successly create")
- * ENDIF
- *
- * IF HB_ZIPFILEBYTDSPAN( "TEST2.ZIP",{"TEST.PRG","c:\windows\win.ini"},8,{|nPos,cFile|,qout(cFile)},'hello',,521421)
- * qout("File was successly create")
- * ENDIF
- *
- * aFiles := {"TEST.PRG","c:\windows\win.ini"}
- * nLen := Len(afiles)
- * aGauge := GaugeNew( 5, 5, 7,40 , "W/B", "W+/B" ,'²')
- * GaugeDisplay( aGauge )
- * HB_ZIPFILEBYTDSPAN('test33.zip',aFiles,8,{|cFile,nPos| GaugeUpdate(aGauge,nPos/nLen)},,'hello',,6585452)
- * Return Nil
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-
-/*
- * $DOC$
- * $FUNCNAME$
- * HB_ZIPFILEBYPKSPAN()
- * $CATEGORY$
- * ZIP FUNCTION
- * $ONELINER$
- * Create a zip file on removable media
- * $SYNTAX$
- * HB_ZIPFILEBYPKSPAN( , | , ,
- * , ,,,) ---> lCompress
- * $ARGUMENTS$
- * Name of the zip file
- *
- * Name of a file to Compress, Drive and/or path
- * can be used
- *
- * An array containing files to compress, Drive and/or path
- * can be used
- *
- * Compression level ranging from 0 to 9
- *
- * Code block to execute while compressing
- *
- * Toggle to overwite the file if exists
- *
- * Password to encrypt the files
- *
- * Toggle to store the path or not
- *
- * Toggle to store the Drive letter and path or not
- * $RETURNS$
- * .t. if file was create, otherwise .f.
- * $DESCRIPTION$
- * This function creates a zip file named . If the extension
- * is ommited, .ZIP will be assumed. If the second parameter is a
- * character string, this file will be added to the zip file. If the
- * second parameter is an array, all file names contained in
- * will be compressed.Also , the use of this function is for creating
- * backup in removable media like an floppy drive/zip drive.
- *
- * If is used, it detemines the compression type where 0 means
- * no compression and 9 means best compression.
- *
- * If is used, every time the file is opened to compress it
- * will evaluate bBlock. Parameters of bBlock are cFile and nPos.
- *
- * If is used , it toggles to overwrite or not the existing
- * file. Default is to overwrite the file,otherwise if is false
- * the new files are added to the .
- *
- * If is used, all files that are added to the archive are encrypted
- * with the password.
- *
- * If is used, it tells thats the path should also be stored with
- * the file name. Default is false.
- *
- * If is used, it tells thats the Drive and path should also be stored
- * with the file name. Default is false.
- *
- * Before calling this function, Set an Changedisk codeblock by calling
- * the HB_SETDISKZIP().
- * $EXAMPLES$
- * FUNCTION MAIN()
- *
- * IF HB_ZIPFILE( "a:\TEST.ZIP","TEST.PRG")
- * qout("File was successly create")
- * ENDIF
- *
- * IF HB_ZIPFILEBYPKSPAN( "a:\TEST1.ZIP",{"TEST.PRG","c:\windows\win.ini"})
- * qout("File was successly create")
- * ENDIF
- *
- * IF HB_ZIPFILEBYPKSPAN( "TEST2.ZIP",{"TEST.PRG","c:\windows\win.ini"},8,{|nPos,cFile|,qout(cFile)})
- * qout("File was successly create")
- * ENDIF
- *
- * aFiles := {"TEST.PRG","c:\windows\win.ini"}
- * nLen := Len(afiles)
- * aGauge := GaugeNew( 5, 5, 7,40 , "W/B", "W+/B" ,'²')
- * GaugeDisplay( aGauge )
- * Hb_ZIPFILEBYPKSPAN('f:\test33.zip',aFiles,8,{|cFile,nPos| GaugeUpdate(aGauge,nPos/nLen)},,'hello')
- * // assuming f:\ as an Zip Drive
- * Return Nil
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/* $DOC$
- * $FUNCNAME$
- * HB_SETDISKZIP()
- * $CATEGORY$
- * Zip Function
- * $ONELINER$
- * Set an codeblock for disk changes
- * $SYNTAX$
- * HB_SETDISKZIP()
- * $ARGUMENTS$
- * an Code block that contains an function that will be performed
- * when the need of changing disk are need.
- * $RETURNS$
- * It returns allways True
- * $DESCRIPTION$
- * This function will set an codeblock that will be evaluated every time
- * that an changedisk event is neccessary.
- *
- * Set this function before opening archives that are in removable media.
- * This block will be released, when the caller finish it job.
- * $EXAMPLES$
- * HB_SETDISKZIP({|x| alert('Please insert disk no "+str(x,3))})
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/* $DOC$
- * $FUNCNAME$
- * HB_ZIPDELETEFILES()
- * $CATEGORY$
- * Zip Functions
- * $ONELINER$
- * Delete files from an zip archive
- * $SYNTAX$
- * HB_ZIPDELETEFILES(,|) -->
- * $ARGUMENTS$
- * The name of the zip files from where the files will be deleted
- *
- * An File to be removed
- *
- * An Array of Files to Be Removed
- * $RETURNS$
- * If the files are deleted , it will return .T., otherwise
- * it will return .f. for the Follow cases: Spanned Archives, the file
- * could not be found in the zip file.
- * $DESCRIPTION$
- * This function removes files from an Zip archive.
- * $EXAMPLES$
- * ? "has the file zipnew.i been deleted ",if(HB_ZIPDELETEFILES('\test23.zip','zipnew.i'),"Yes","No")
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/* $DOC$
- * $FUNCNAME$
- * HB_ZIPTESTPK()
- * $CATEGORY$
- * Zip Functions
- * $ONELINER$
- * Test pkSpaned zip files
- * $SYNTAX$
- * HB_ZIPTESTPK() -->
- * $ARGUMENTS$
- * File to be tested.
- * $RETURNS$
- * An code that tell if the current disk is the Last of an pkspanded
- * disk set.
- * $DESCRIPTION$
- * This function tests if the disk inserted is the last disk of an backup
- * set or not.
- * It will return the follow return code when an error is found
- *
- *
- * Error code Meaning
- * 114 Incorrect Disk
- * 103 No Call back was set with HB_SETDISKZIP()
- *
- *
- * Call this function to determine if the disk inserted is the correct
- * one before any other function.
- * $EXAMPLES$
- * if (HB_ZIPTESTPK('a:\test22.zip')==114)
- * ? "invalid Disk"
- * endif
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/* $DOC$
- * $FUNCNAME$
- * HB_GETZIPCOMMENT()
- * $CATEGORY$
- * Zip Functions
- * $ONELINER$
- * Return the comment of an zip file
- * $SYNTAX$
- * HB_GETZIPCOMMENT() -->
- * $ARGUMENTS$
- * File to get the comment from
- * $RETURNS$
- * The comment that was stored in
- * $DESCRIPTION$
- * This function recieve an valid zip file name as parameter,
- * and return the global comment stored within.
- * $EXAMPLES$
- * ? "The comment of tes.zip",HB_GETZIPCOMMENT('tes.zip')
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/* $DOC$
- * $FUNCNAME$
- * HB_SETZIPCOMMENT()
- * $CATEGORY$
- * Zip Functions
- * $ONELINER$
- * Set an Zip archive Comment
- * $SYNTAX$
- * HB_SETZIPCOMMENT() -->Nil
- * $ARGUMENTS$
- * Comment to add to the zip archive
- * $RETURNS$
- * this function always return NIL
- * $DESCRIPTION$
- * This function stored an global comment to an zip archive.
- * It should be called before any of the Compression Function.
- * $EXAMPLES$
- * HB_SETZIPCOMMENT("This is an Test")
- * hb_zipfile('test.zip',{"\windows\ios.ini","\windows\win.ini"})
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/* $DOC$
- * $FUNCNAME$
- * HB_SETBUFFER()
- * $CATEGORY$
- *
- * $ONELINER$
- *
- * $SYNTAX$
- * HB_SETBUFFER([],[],[]) -->Nil
- * $ARGUMENTS$
- * The size of the write buffer.
- *
- * The size of the extract buffer.
- *
- * The size of the read buffer.
- * $RETURNS$
- * This function always return NIL.
- * $DESCRIPTION$
- * This function set the size of the internal buffers for read/write/extract
- * operation
- *
- * If the size of the buffer is smaller then the default , the function
- * will automaticaly use the default values,which is 65535/16384/32768.
- *
- * This function be called before any of the Compression/decompression
- * Function.
- * $EXAMPLES$
- * HB_SETBUFFER(100000,115214,65242)
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/*
- * $DOC$
- * $FUNCNAME$
- * HB_GETUNRARFILE()
- * $CATEGORY$
- * RAR FUNCTION
- * $ONELINER$
- * Gets the number of files that are in the rar file
- * $SYNTAX$
- * HB_GETUNRARFILE( ) ---> nNumber
- * $ARGUMENTS$
- * Name of the rar file
- * $RETURNS$
- * The number of files contained inside the rarfile
- * $DESCRIPTION$
- * This function returns the number of files that is stored in the rar file.
- * $EXAMPLES$
- * FUNCTION MAIN()
- * Local nFiles :=HB_GETUNZIPFILE('test.zip')
- *
- * if nFiles >0
- * ? "This files Contains ",nfiles
- * endif
- *
- * Return Nil
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $FILES$
- * Library is zlib.lib and zlib_bor.lib For Borland Compilers
- * Library is zlib.lib zlib_ms.lib for MSVC compilers
- * $END$
- */
-
-/* $DOC$
- * $FUNCNAME$
- * COMPRESSSTRING()
- * $CATEGORY$
- * Compression()
- * $ONELINER$
- * Compress an string
- * $SYNTAX$
- * CompressString(@,@)
- * $ARGUMENTS$
- * Buffer to compress, must be passed by reference.
- *
- * The Lenght of the compression String
- * $RETURNS$
- * NIL
- * $DESCRIPTION$
- * This function compress an string buffer and return the compression function
- * and the size of this compression function.
- * This size is required for uncompression the string
- * $EXAMPLES$
- * Local cTest:= memoread('tzipfile.prg')
- * ? 'String before compressing',cTest
- *
- * COMPRESSSTRING(@cTest,@nSize)
- * ? "Size",nSize
- * ? " "
- * ? " "
- * ? 'String after compressing',cTest
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $SEEALSO$
- * UNCOMPRESSSTRING()
- * $END$
- */
-/* $DOC$
- * $FUNCNAME$
- * UNCOMPRESSSTRING()
- * $CATEGORY$
- * Compression
- * $ONELINER$
- * Uncompress an String
- * $SYNTAX$
- * UNCOMPRESSSTRING(,) --->
- * $ARGUMENTS$
- * The compressing string to uncompress
- *
- * The saved size returned by compressionstring
- * $RETURNS$
- * The String uncompressed
- * $DESCRIPTION$
- *
- * $EXAMPLES$
- * cOrig:=UNCOMPRESSSTRING(cTest,nSize)
- * ?'uncompressed String',cOrig
- * $STATUS$
- * R
- * $COMPLIANCE$
- * This function is a Harbour extension
- * $PLATFORMS$
- * All
- * $SEEALSO$
- * COMPRESSSTRING()
- * $END$
- */
diff --git a/harbour/contrib/hbzlib/hbzip.h b/harbour/contrib/hbzlib/hbzip.h
deleted file mode 100644
index 129f663caa..0000000000
--- a/harbour/contrib/hbzlib/hbzip.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * $Id$
- */
-
-/*
- * Harbour Project source code:
- * Header file for the Zlib API,
- *
- * Copyright 2000 Luiz Rafael Culik
- * www - http://www.harbour-project.org
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
- *
- * As a special exception, the Harbour Project gives permission for
- * additional uses of the text contained in its release of Harbour.
- *
- * The exception is that, if you link the Harbour libraries with other
- * files to produce an executable, this does not by itself cause the
- * resulting executable to be covered by the GNU General Public License.
- * Your use of that executable is in no way restricted on account of
- * linking the Harbour library code into it.
- *
- * This exception does not however invalidate any other reasons why
- * the executable file might be covered by the GNU General Public License.
- *
- * This exception applies only to the code released by the Harbour
- * Project under the name Harbour. If you copy code from other
- * Harbour Project or Free Software Foundation releases into a copy of
- * Harbour, as the General Public License permits, the exception does
- * not apply to the code that you add in this way. To avoid misleading
- * anyone as to the status of such modified files, you must delete
- * this exception notice from them.
- *
- * If you write modifications of your own for Harbour, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.
- *
- */
-
-
-#ifndef HB_APIZLIB_H_
-#define HB_APIZLIB_H_
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "zip.h"
-#include "unzip.h"
-
-HB_EXTERN_BEGIN
-
-#define filePos 1
-#define Lenght 2
-#define Method 3
-#define Size 4
-#define Ratio 5
-#define Date 6
-#define Time 7
-#define Crc32 8
-
-extern uLong hb___filetime(char *f, tm_zip *tmzip, uLong *dt);
-extern char *hb___CheckFile( char * szFile);
-extern int hb___CompressOneFile(char *szFile,char *szFiletoCompress,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite);
-extern int hb___CompressMultipleFile(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite);
-extern BOOL hb___unZipFiles(char *szFile,PHB_ITEM pBlock,BOOL bExtractPath);
-extern int hb___ExtractCurrentFile(unzFile uf,BOOL popt_extract_without_path,BOOL popt_overwrite,PHB_ITEM pBlock);
-extern void hb____ChangeFileDate(char *filename,uLong dosdate,tm_unz tmu_date);
-extern int hb___MakeDir(char *szNewDirectory);
-extern int hb___GetNumbersofFilestoUnzip(char *szFile);
-extern PHB_ITEM hb___GetFilesNamesFromZip(char *szFile,BOOL iMode);
-
-HB_EXTERN_END
-
-#endif /* HB_APIEXT_H_ */
diff --git a/harbour/contrib/hbzlib/hbzip2.h b/harbour/contrib/hbzlib/hbzip2.h
deleted file mode 100644
index 4821e125d9..0000000000
--- a/harbour/contrib/hbzlib/hbzip2.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * $Id$
- */
-
-/*
- * Harbour Project source code:
- * Header file for the Zlib API,
- *
- * Copyright 2000-2001 Luiz Rafael Culik
- * www - http://www.harbour-project.org
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
- *
- * As a special exception, the Harbour Project gives permission for
- * additional uses of the text contained in its release of Harbour.
- *
- * The exception is that, if you link the Harbour libraries with other
- * files to produce an executable, this does not by itself cause the
- * resulting executable to be covered by the GNU General Public License.
- * Your use of that executable is in no way restricted on account of
- * linking the Harbour library code into it.
- *
- * This exception does not however invalidate any other reasons why
- * the executable file might be covered by the GNU General Public License.
- *
- * This exception applies only to the code released by the Harbour
- * Project under the name Harbour. If you copy code from other
- * Harbour Project or Free Software Foundation releases into a copy of
- * Harbour, as the General Public License permits, the exception does
- * not apply to the code that you add in this way. To avoid misleading
- * anyone as to the status of such modified files, you must delete
- * this exception notice from them.
- *
- * If you write modifications of your own for Harbour, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.
- *
- */
-
-
-#ifndef HB_APIZLIB_H_
-#define HB_APIZLIB_H_
-#define HB_OS_WIN_32_USED
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#ifdef __cplusplus
-#include
-extern "C" {
-#endif
-
-
-#define filePos 1
-#define Lenght 2
-#define Method 3
-#define Size 4
-#define Ratio 5
-#define Date 6
-#define Time 7
-#define Crc32 8
-#define Attr 9
-#define WRITEBUFFERSIZE (16384)
-#define MAXFILENAME (256)
-typedef struct _HB_ZIP_INTERNAL{
-int iWrite;
-int iExtract;
-int iRead;
-char * szComment;
-PHB_ITEM pItem;
-} HB_ZIP_INTERNAL,* PHB_ZIP_INTERNAL,* HB_ZIP_INTERNAL_PTR;
-#ifndef LPCTSTR
-typedef const char *LPCSTR;
-typedef LPCSTR LPCTSTR;
-#endif
-extern char *hb___CheckFile( char * szFile);
-extern PHB_ITEM hb___GetFilesNamesFromZip(char *szFile,BOOL iMode);
-extern void hb_____GetTime(struct tm *tz);
-extern int hb_CmpPkSpan(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern int hb_CmpPkSpanStd(char *szFile,char *szFiletoCompress,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern char *hb_getPassWord(char *szName);
-extern int hb___GetNumbersofFilestoUnzip(char *szFile);
-extern int hb___SetCallbackFunc(PHB_ITEM pFunc);
-extern int hb_CmpTdSpan(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,PHB_ITEM pDiskBlock,int iSpanSize ,BOOL bPath ,BOOL bDrive,PHB_ITEM pProgress);
-
-extern int hb_CompressFile(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern int hb_CompressFileStd(char *szFile,char *szFiletoCompress,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern int hb_CmpTdSpanStd(char *szFile,char * szFiletoCompress,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,PHB_ITEM pDiskBlock,int iSpanSize,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern int hb_UnzipAll(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,PHB_ITEM pDiskBlock,PHB_ITEM pProgress);
-extern int hb_UnzipOne(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,char *szFiletoExtract,PHB_ITEM pProgress);
-extern int hb_UnzipSel(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,PHB_ITEM pArray,PHB_ITEM pProgress);
-extern int hb_UnzipOneIndex(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,int uiCount,PHB_ITEM pProgress);
-extern int hb_UnzipSelIndex(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,PHB_ITEM pSelArray,PHB_ITEM pProgress);
-extern int hb_DeleteOne(char *szFile,char *szFiletoDelete);
-extern int hb_DeleteSel(char *szFile,PHB_ITEM pArray,BOOL bCase);
-extern int hb_DeleteOneIndex(char *szFile,int uiCount);
-extern int hb_TestForPKS(char *szFile);
-extern void hb_SetZipBuff(int a,int b,int c);
-extern void hb_SetZipComment(char *szComment);
-extern const char *hb_GetZipComment(char *szFile);
-extern BOOL hb_IsPassWord(char *szName);
-extern unsigned long GetCurrentFileSize( LPCTSTR szFile);
-extern BOOL hb_SaveZipFileFromMemory(char *szFile);
-extern BOOL hb_CreateZipInMemory(char *szFileToCompress,char *szFile);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* HB_APIEXT_H_ */
diff --git a/harbour/contrib/hbzlib/include/ZipExport.h b/harbour/contrib/hbzlib/include/ZipExport.h
deleted file mode 100644
index 08c7ef4f69..0000000000
--- a/harbour/contrib/hbzlib/include/ZipExport.h
+++ /dev/null
@@ -1,18 +0,0 @@
-#if !defined (ZIP_EXPORT_H)
-#define ZIP_EXPORT_H
-
-#if defined (ZIP_HAS_DLL)
-# if (ZIP_HAS_DLL == 1)
-# if defined (ZIP_BUILD_DLL)
-# define ZIP_API __declspec (dllexport)
-# else
-# define ZIP_API __declspec (dllimport)
-# endif /* ZIP_BUILD_DLL */
-# else
-# define ZIP_API
-# endif /* ! ZIP_HAS_DLL == 1 */
-#else
-# define ZIP_API
-#endif /* ZIP_HAS_DLL */
-
-#endif /* ZIP_EXPORT_H */
diff --git a/harbour/contrib/hbzlib/include/hbz.h b/harbour/contrib/hbzlib/include/hbz.h
deleted file mode 100644
index 34ef23c61f..0000000000
--- a/harbour/contrib/hbzlib/include/hbz.h
+++ /dev/null
@@ -1,84 +0,0 @@
-#ifndef HB_APIZLIB_H_
-#define HB_APIZLIB_H_
-#define HB_OS_WIN_32_USED
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#ifdef __cplusplus
-#include
-extern "C" {
-#endif
-
-
-#define filePos 1
-#define Lenght 2
-#define Method 3
-#define Size 4
-#define Ratio 5
-#define Date 6
-#define Time 7
-#define Crc32 8
-#define Attr 9
-#define WRITEBUFFERSIZE (16384)
-#define MAXFILENAME (256)
-typedef struct _HB_ZIP_INTERNAL{
-int iWrite;
-int iExtract;
-int iRead;
-char * szComment;
-PHB_ITEM pItem;
-} HB_ZIP_INTERNAL,* PHB_ZIP_INTERNAL,* HB_ZIP_INTERNAL_PTR;
-#ifndef LPCTSTR
-typedef const char *LPCSTR;
-typedef LPCSTR LPCTSTR;
-#endif
-class SpanCallback : public CZipSpanCallback
-{
- bool Callback(int iProgress)
- {
- PHB_ITEM pDisk=hb_itemPutNL(NULL,m_uDiskNeeded);
- bool iReturn=true;
- hb_vmEvalBlockV( pChangeDiskBlock, 1,pDisk );
- hb_itemRelease(pDisk);
- return iReturn;
- }
-};
-
-class SpanActionCallback : public CZipActionCallback
-{
- bool Callback(int iProgress)
- {
- int iReturn=1;
- PHB_ITEM pDisk;
- PHB_ITEM pTotal =hb_itemPutNL(NULL,m_uTotalToDo);
- pDisk= hb_itemPutNL(NULL,m_uTotalSoFar);
- hb_vmEvalBlockV( pProgressInfo, 2,pDisk,pTotal);
- hb_itemRelease(pDisk);
- hb_itemRelease(pTotal);
- return iReturn;
- }
-};
-
-
-class hbZip {
-public:
-BOOL bAdded;
-hbZip(){
- bAdded=false
-};
-virtual ~hbZip();
-CZipArchive szZip;
-SpanCallback span;
-SpanActionCallback spanac;
-};
-
-#ifdef __cplusplus
-}
-#endif
-#endif
diff --git a/harbour/contrib/hbzlib/include/hbzip.h b/harbour/contrib/hbzlib/include/hbzip.h
deleted file mode 100644
index 129f663caa..0000000000
--- a/harbour/contrib/hbzlib/include/hbzip.h
+++ /dev/null
@@ -1,90 +0,0 @@
-/*
- * $Id$
- */
-
-/*
- * Harbour Project source code:
- * Header file for the Zlib API,
- *
- * Copyright 2000 Luiz Rafael Culik
- * www - http://www.harbour-project.org
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
- *
- * As a special exception, the Harbour Project gives permission for
- * additional uses of the text contained in its release of Harbour.
- *
- * The exception is that, if you link the Harbour libraries with other
- * files to produce an executable, this does not by itself cause the
- * resulting executable to be covered by the GNU General Public License.
- * Your use of that executable is in no way restricted on account of
- * linking the Harbour library code into it.
- *
- * This exception does not however invalidate any other reasons why
- * the executable file might be covered by the GNU General Public License.
- *
- * This exception applies only to the code released by the Harbour
- * Project under the name Harbour. If you copy code from other
- * Harbour Project or Free Software Foundation releases into a copy of
- * Harbour, as the General Public License permits, the exception does
- * not apply to the code that you add in this way. To avoid misleading
- * anyone as to the status of such modified files, you must delete
- * this exception notice from them.
- *
- * If you write modifications of your own for Harbour, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.
- *
- */
-
-
-#ifndef HB_APIZLIB_H_
-#define HB_APIZLIB_H_
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-#include "zip.h"
-#include "unzip.h"
-
-HB_EXTERN_BEGIN
-
-#define filePos 1
-#define Lenght 2
-#define Method 3
-#define Size 4
-#define Ratio 5
-#define Date 6
-#define Time 7
-#define Crc32 8
-
-extern uLong hb___filetime(char *f, tm_zip *tmzip, uLong *dt);
-extern char *hb___CheckFile( char * szFile);
-extern int hb___CompressOneFile(char *szFile,char *szFiletoCompress,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite);
-extern int hb___CompressMultipleFile(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite);
-extern BOOL hb___unZipFiles(char *szFile,PHB_ITEM pBlock,BOOL bExtractPath);
-extern int hb___ExtractCurrentFile(unzFile uf,BOOL popt_extract_without_path,BOOL popt_overwrite,PHB_ITEM pBlock);
-extern void hb____ChangeFileDate(char *filename,uLong dosdate,tm_unz tmu_date);
-extern int hb___MakeDir(char *szNewDirectory);
-extern int hb___GetNumbersofFilestoUnzip(char *szFile);
-extern PHB_ITEM hb___GetFilesNamesFromZip(char *szFile,BOOL iMode);
-
-HB_EXTERN_END
-
-#endif /* HB_APIEXT_H_ */
diff --git a/harbour/contrib/hbzlib/include/hbzip2.h b/harbour/contrib/hbzlib/include/hbzip2.h
deleted file mode 100644
index 4821e125d9..0000000000
--- a/harbour/contrib/hbzlib/include/hbzip2.h
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * $Id$
- */
-
-/*
- * Harbour Project source code:
- * Header file for the Zlib API,
- *
- * Copyright 2000-2001 Luiz Rafael Culik
- * www - http://www.harbour-project.org
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING. If not, write to
- * the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
- * Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
- *
- * As a special exception, the Harbour Project gives permission for
- * additional uses of the text contained in its release of Harbour.
- *
- * The exception is that, if you link the Harbour libraries with other
- * files to produce an executable, this does not by itself cause the
- * resulting executable to be covered by the GNU General Public License.
- * Your use of that executable is in no way restricted on account of
- * linking the Harbour library code into it.
- *
- * This exception does not however invalidate any other reasons why
- * the executable file might be covered by the GNU General Public License.
- *
- * This exception applies only to the code released by the Harbour
- * Project under the name Harbour. If you copy code from other
- * Harbour Project or Free Software Foundation releases into a copy of
- * Harbour, as the General Public License permits, the exception does
- * not apply to the code that you add in this way. To avoid misleading
- * anyone as to the status of such modified files, you must delete
- * this exception notice from them.
- *
- * If you write modifications of your own for Harbour, it is your choice
- * whether to permit this exception to apply to your modifications.
- * If you do not wish that, delete this exception notice.
- *
- */
-
-
-#ifndef HB_APIZLIB_H_
-#define HB_APIZLIB_H_
-#define HB_OS_WIN_32_USED
-#include
-#include
-#include
-#include
-#include
-#include
-#include
-
-#include
-
-#ifdef __cplusplus
-#include
-extern "C" {
-#endif
-
-
-#define filePos 1
-#define Lenght 2
-#define Method 3
-#define Size 4
-#define Ratio 5
-#define Date 6
-#define Time 7
-#define Crc32 8
-#define Attr 9
-#define WRITEBUFFERSIZE (16384)
-#define MAXFILENAME (256)
-typedef struct _HB_ZIP_INTERNAL{
-int iWrite;
-int iExtract;
-int iRead;
-char * szComment;
-PHB_ITEM pItem;
-} HB_ZIP_INTERNAL,* PHB_ZIP_INTERNAL,* HB_ZIP_INTERNAL_PTR;
-#ifndef LPCTSTR
-typedef const char *LPCSTR;
-typedef LPCSTR LPCTSTR;
-#endif
-extern char *hb___CheckFile( char * szFile);
-extern PHB_ITEM hb___GetFilesNamesFromZip(char *szFile,BOOL iMode);
-extern void hb_____GetTime(struct tm *tz);
-extern int hb_CmpPkSpan(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern int hb_CmpPkSpanStd(char *szFile,char *szFiletoCompress,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern char *hb_getPassWord(char *szName);
-extern int hb___GetNumbersofFilestoUnzip(char *szFile);
-extern int hb___SetCallbackFunc(PHB_ITEM pFunc);
-extern int hb_CmpTdSpan(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,PHB_ITEM pDiskBlock,int iSpanSize ,BOOL bPath ,BOOL bDrive,PHB_ITEM pProgress);
-
-extern int hb_CompressFile(char *szFile,PHB_ITEM pArray,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern int hb_CompressFileStd(char *szFile,char *szFiletoCompress,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern int hb_CmpTdSpanStd(char *szFile,char * szFiletoCompress,int iCompLevel,PHB_ITEM pBlock,BOOL bOverWrite,char *szPassWord,PHB_ITEM pDiskBlock,int iSpanSize,BOOL bPath,BOOL bDrive,PHB_ITEM pProgress);
-extern int hb_UnzipAll(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,PHB_ITEM pDiskBlock,PHB_ITEM pProgress);
-extern int hb_UnzipOne(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,char *szFiletoExtract,PHB_ITEM pProgress);
-extern int hb_UnzipSel(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,PHB_ITEM pArray,PHB_ITEM pProgress);
-extern int hb_UnzipOneIndex(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,int uiCount,PHB_ITEM pProgress);
-extern int hb_UnzipSelIndex(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *szPath,PHB_ITEM pSelArray,PHB_ITEM pProgress);
-extern int hb_DeleteOne(char *szFile,char *szFiletoDelete);
-extern int hb_DeleteSel(char *szFile,PHB_ITEM pArray,BOOL bCase);
-extern int hb_DeleteOneIndex(char *szFile,int uiCount);
-extern int hb_TestForPKS(char *szFile);
-extern void hb_SetZipBuff(int a,int b,int c);
-extern void hb_SetZipComment(char *szComment);
-extern const char *hb_GetZipComment(char *szFile);
-extern BOOL hb_IsPassWord(char *szName);
-extern unsigned long GetCurrentFileSize( LPCTSTR szFile);
-extern BOOL hb_SaveZipFileFromMemory(char *szFile);
-extern BOOL hb_CreateZipInMemory(char *szFileToCompress,char *szFile);
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* HB_APIEXT_H_ */
diff --git a/harbour/contrib/hbzlib/include/resource.h b/harbour/contrib/hbzlib/include/resource.h
deleted file mode 100644
index 6cf0c78db2..0000000000
--- a/harbour/contrib/hbzlib/include/resource.h
+++ /dev/null
@@ -1,15 +0,0 @@
-//{{NO_DEPENDENCIES}}
-// Microsoft Developer Studio generated include file.
-// Used by version.rc
-//
-
-// Next default values for new objects
-//
-#ifdef APSTUDIO_INVOKED
-#ifndef APSTUDIO_READONLY_SYMBOLS
-#define _APS_NEXT_RESOURCE_VALUE 101
-#define _APS_NEXT_COMMAND_VALUE 40001
-#define _APS_NEXT_CONTROL_VALUE 1000
-#define _APS_NEXT_SYMED_VALUE 101
-#endif
-#endif
diff --git a/harbour/contrib/hbzlib/include/stdafx.h b/harbour/contrib/hbzlib/include/stdafx.h
deleted file mode 100644
index bd28a8dae6..0000000000
--- a/harbour/contrib/hbzlib/include/stdafx.h
+++ /dev/null
@@ -1,126 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-// $Workfile: stdafx.h $
-// $Archive: /ZipArchive_STL/stdafx.h $
-// $Date$ $Author$
-////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// For the licensing details see the file License.txt
-////////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_STDAFX_H__926F70F4_1B34_49AA_9532_498E8D2F3495__INCLUDED_)
-#define AFX_STDAFX_H__926F70F4_1B34_49AA_9532_498E8D2F3495__INCLUDED_
-
-#if (_MSC_VER < 1300) && !defined (__BORLANDC__) && !defined (__GNUC__)
- #define ZIPINLINE inline
-#else
- #define ZIPINLINE
-#endif
-
-
-#define ZIP_ARCHIVE_STL
-
-#if _MSC_VER > 1000
- #pragma once
-//because of STL
- #pragma warning (disable : 4710) // 'function' : function not inlined
- #pragma warning (disable : 4514) // unreferenced inline/local function has been removed
- #pragma warning (disable:4786) // 'identifier' : identifier was truncated to 'number' characters in the debug information
-#endif // _MSC_VER > 1000
-
-
-// some Windows typical definitions
-
-#if defined (_UNICODE) && !defined (UNICODE)
- #define UNICODE
-#endif
-#if defined (UNICODE) && !defined (_UNICODE)
- #define _UNICODE
-#endif
-
-#ifndef _WIN32
- #ifndef NULL
- #define NULL 0
- #endif
-
- #include
- typedef int HFILE;
- typedef void* HANDLE;
- typedef unsigned long DWORD;
- typedef long LONG;
- typedef int BOOL;
- typedef unsigned char BYTE;
- typedef unsigned short WORD;
- typedef unsigned int UINT;
-
- #ifndef FALSE
- #define FALSE (int)0
- #endif
-
- #ifndef TRUE
- #define TRUE (int)1
- #endif
-
-
- typedef unsigned short WCHAR; // wc, 16-bit UNICODE character
- typedef const WCHAR *LPCWSTR;
- typedef const char *LPCSTR;
- typedef WCHAR *LPWSTR;
- typedef char *LPSTR;
-
- #ifdef _UNICODE
- typedef wchar_t TCHAR;
- typedef LPCWSTR LPCTSTR;
- typedef LPWSTR LPTSTR;
- #define _T(x) L ## x
- #else /* _UNICODE */ // r_winnt
- typedef char TCHAR;
- typedef LPCSTR LPCTSTR;
- typedef LPSTR LPTSTR;
- #define _T(x) x
- #endif /* _UNICODE */ // r_winnt
-
-
-#else
- #include
- #include
- #ifndef STRICT
- #define STRICT
- #endif
-#endif // #ifndef _WIN32
-
-#ifndef ASSERT
- #include
- #define ASSERT(f) assert((f))
-#endif
-#ifndef VERIFY
- #ifdef _DEBUG
- #define VERIFY(x) ASSERT((x))
- #else
- #define VERIFY(x) x
- #endif
-#endif
-
-
-#ifndef TRACE
- #define TRACE
-#endif
-
-#if _MSC_VER >= 1300
- #define ZIP_ULONGLONG ULONGLONG
- #define ZIP_LONGLONG LONGLONG
-#else
- #define ZIP_ULONGLONG DWORD
- #define ZIP_LONGLONG LONG
-#endif
-
-//{{AFX_INSERT_LOCATION}}
-// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
-
-#endif // !defined(AFX_STDAFX_H__926F70F4_1B34_49AA_9532_498E8D2F3495__INCLUDED_)
diff --git a/harbour/contrib/hbzlib/include/unzip.h b/harbour/contrib/hbzlib/include/unzip.h
deleted file mode 100644
index 89fef3fd7a..0000000000
--- a/harbour/contrib/hbzlib/include/unzip.h
+++ /dev/null
@@ -1,274 +0,0 @@
-/* unzip.h -- IO for uncompress .zip files using zlib
- Version 0.15 beta, Mar 19th, 1998,
-
- Copyright (C) 1998 Gilles Vollant
-
- This unzip package allow extract file from .ZIP file, compatible with PKZip 2.04g
- WinZip, InfoZip tools and compatible.
- Encryption and multi volume ZipFile (span) are not supported.
- Old compressions used by old PKZip 1.x are not supported
-
- THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
- CAN CHANGE IN FUTURE VERSION !!
- I WAIT FEEDBACK at mail info@winimage.com
- Visit also http://www.winimage.com/zLibDll/unzip.htm for evolution
-
- Condition of use and distribution are the same than zlib :
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
-*/
-/* for more info about .ZIP format, see
- ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
- PkWare has also a specification at :
- ftp://ftp.pkware.com/probdesc.zip */
-
-#ifndef _unz_H
-#define _unz_H
-
-#ifndef _HBCOMPRESS_H
-#include "hbcomprs.h"
-#endif
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
- from (void*) without cast */
-typedef struct TagunzFile__ { int unused; } unzFile__;
-typedef unzFile__ *unzFile;
-#else
-typedef voidp unzFile;
-#endif
-
-
-#define UNZ_OK (0)
-#define UNZ_END_OF_LIST_OF_FILE (-100)
-#define UNZ_ERRNO (Z_ERRNO)
-#define UNZ_EOF (0)
-#define UNZ_PARAMERROR (-102)
-#define UNZ_BADZIPFILE (-103)
-#define UNZ_INTERNALERROR (-104)
-#define UNZ_CRCERROR (-105)
-
-/* tm_unz contain date/time info */
-typedef struct tm_unz_s
-{
- uInt tm_sec; /* seconds after the minute - [0,59] */
- uInt tm_min; /* minutes after the hour - [0,59] */
- uInt tm_hour; /* hours since midnight - [0,23] */
- uInt tm_mday; /* day of the month - [1,31] */
- uInt tm_mon; /* months since January - [0,11] */
- uInt tm_year; /* years - [1980..2044] */
-} tm_unz;
-
-/* unz_global_info structure contain global data about the ZIPfile
- These data comes from the end of central dir */
-typedef struct unz_global_info_s
-{
- uLong number_entry; /* total number of entries in
- the central dir on this disk */
- uLong size_comment; /* size of the global comment of the zipfile */
-} unz_global_info;
-
-
-/* unz_file_info contain information about a file in the zipfile */
-typedef struct unz_file_info_s
-{
- uLong version; /* version made by 2 bytes */
- uLong version_needed; /* version needed to extract 2 bytes */
- uLong flag; /* general purpose bit flag 2 bytes */
- uLong compression_method; /* compression method 2 bytes */
- uLong dosDate; /* last mod file date in Dos fmt 4 bytes */
- uLong crc; /* crc-32 4 bytes */
- uLong compressed_size; /* compressed size 4 bytes */
- uLong uncompressed_size; /* uncompressed size 4 bytes */
- uLong size_filename; /* filename length 2 bytes */
- uLong size_file_extra; /* extra field length 2 bytes */
- uLong size_file_comment; /* file comment length 2 bytes */
-
- uLong disk_num_start; /* disk number start 2 bytes */
- uLong internal_fa; /* internal file attributes 2 bytes */
- uLong external_fa; /* external file attributes 4 bytes */
-
- tm_unz tmu_date;
-} unz_file_info;
-
-extern int ZEXPORT unzStringFileNameCompare OF ((const char* fileName1,
- const char* fileName2,
- int iCaseSensitivity));
-/*
- Compare two filename (fileName1,fileName2).
- If iCaseSenisivity = 1, comparision is case sensitivity (like strcmp)
- If iCaseSenisivity = 2, comparision is not case sensitivity (like strcmpi
- or strcasecmp)
- If iCaseSenisivity = 0, case sensitivity is defaut of your operating system
- (like 1 on Unix, 2 on Windows)
-*/
-
-
-extern unzFile ZEXPORT unzOpen OF((const char *path));
-/*
- Open a Zip file. path contain the full pathname (by example,
- on a Windows NT computer "c:\\zlib\\zlib111.zip" or on an Unix computer
- "zlib/zlib111.zip".
- If the zipfile cannot be opened (file don't exist or in not valid), the
- return value is NULL.
- Else, the return value is a unzFile Handle, usable with other function
- of this unzip package.
-*/
-
-extern int ZEXPORT unzClose OF((unzFile file));
-/*
- Close a ZipFile opened with unzipOpen.
- If there is files inside the .Zip opened with unzOpenCurrentFile (see later),
- these files MUST be closed with unzipCloseCurrentFile before call unzipClose.
- return UNZ_OK if there is no problem. */
-
-extern int ZEXPORT unzGetGlobalInfo OF((unzFile file,
- unz_global_info *pglobal_info));
-/*
- Write info about the ZipFile in the *pglobal_info structure.
- No preparation of the structure is needed
- return UNZ_OK if there is no problem. */
-
-
-extern int ZEXPORT unzGetGlobalComment OF((unzFile file,
- char *szComment, uLong uSizeBuf));
-/*
- Get the global comment string of the ZipFile, in the szComment buffer.
- uSizeBuf is the size of the szComment buffer.
- return the number of byte copied or an error code <0
-*/
-
-
-/***************************************************************************/
-/* Unzip package allow you browse the directory of the zipfile */
-
-extern int ZEXPORT unzGoToFirstFile OF((unzFile file));
-/*
- Set the current file of the zipfile to the first file.
- return UNZ_OK if there is no problem
-*/
-
-extern int ZEXPORT unzGoToNextFile OF((unzFile file));
-/*
- Set the current file of the zipfile to the next file.
- return UNZ_OK if there is no problem
- return UNZ_END_OF_LIST_OF_FILE if the actual file was the latest.
-*/
-
-extern int ZEXPORT unzLocateFile OF((unzFile file,
- const char *szFileName,
- int iCaseSensitivity));
-/*
- Try locate the file szFileName in the zipfile.
- For the iCaseSensitivity signification, see unzStringFileNameCompare
-
- return value :
- UNZ_OK if the file is found. It becomes the current file.
- UNZ_END_OF_LIST_OF_FILE if the file is not found
-*/
-
-
-extern int ZEXPORT unzGetCurrentFileInfo OF((unzFile file,
- unz_file_info *pfile_info,
- char *szFileName,
- uLong fileNameBufferSize,
- void *extraField,
- uLong extraFieldBufferSize,
- char *szComment,
- uLong commentBufferSize));
-/*
- Get Info about the current file
- if pfile_info!=NULL, the *pfile_info structure will contain somes info about
- the current file
- if szFileName!=NULL, the filemane string will be copied in szFileName
- (fileNameBufferSize is the size of the buffer)
- if extraField!=NULL, the extra field information will be copied in extraField
- (extraFieldBufferSize is the size of the buffer).
- This is the Central-header version of the extra field
- if szComment!=NULL, the comment string of the file will be copied in szComment
- (commentBufferSize is the size of the buffer)
-*/
-
-/***************************************************************************/
-/* for reading the content of the current zipfile, you can open it, read data
- from it, and close it (you can close it before reading all the file)
- */
-
-extern int ZEXPORT unzOpenCurrentFile OF((unzFile file));
-/*
- Open for reading data the current file in the zipfile.
- If there is no error, the return value is UNZ_OK.
-*/
-
-extern int ZEXPORT unzCloseCurrentFile OF((unzFile file));
-/*
- Close the file in zip opened with unzOpenCurrentFile
- Return UNZ_CRCERROR if all the file was read but the CRC is not good
-*/
-
-
-extern int ZEXPORT unzReadCurrentFile OF((unzFile file,
- voidp buf,
- unsigned len));
-/*
- Read bytes from the current file (opened by unzOpenCurrentFile)
- buf contain buffer where data must be copied
- len the size of buf.
-
- return the number of byte copied if somes bytes are copied
- return 0 if the end of file was reached
- return <0 with error code if there is an error
- (UNZ_ERRNO for IO error, or zLib error for uncompress error)
-*/
-
-extern z_off_t ZEXPORT unztell OF((unzFile file));
-/*
- Give the current position in uncompressed data
-*/
-
-extern int ZEXPORT unzeof OF((unzFile file));
-/*
- return 1 if the end of file was reached, 0 elsewhere
-*/
-
-extern int ZEXPORT unzGetLocalExtrafield OF((unzFile file,
- voidp buf,
- unsigned len));
-/*
- Read extra field from the current file (opened by unzOpenCurrentFile)
- This is the local-header version of the extra field (sometimes, there is
- more info in the local-header version than in the central-header)
-
- if buf==NULL, it return the size of the local extra field
-
- if buf!=NULL, len is the size of the buffer, the extra header is copied in
- buf.
- the return value is the number of bytes copied in buf, or (if <0)
- the error code
-*/
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _unz_H */
diff --git a/harbour/contrib/hbzlib/include/zconf.h b/harbour/contrib/hbzlib/include/zconf.h
deleted file mode 100644
index 9fcacbe06f..0000000000
--- a/harbour/contrib/hbzlib/include/zconf.h
+++ /dev/null
@@ -1,302 +0,0 @@
-/* zconf.h -- configuration of the zlib compression library
- * Copyright (C) 1995-2002 Jean-loup Gailly.
- * For conditions of distribution and use, see copyright notice in zlib.h
- */
-
-/* @(#) $Id$ */
-
-#ifndef _ZCONF_H
-#define _ZCONF_H
-
-/*
-#if _MSC_VER > 1000
- #pragma warning (disable : 4131)
- #pragma warning (disable : 4115)
- #pragma warning (disable : 4127)
- #pragma warning (disable : 4100)
- #pragma warning (disable : 4244)
- #pragma warning (disable : 4702)
- #pragma warning (disable : 4206)
-#endif // _MSC_VER > 1000
-*/
-
-
-/*
- * 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.
- */
-#ifdef Z_PREFIX
-# define deflateInit_ z_deflateInit_
-# define deflate z_deflate
-# define deflateEnd z_deflateEnd
-# define inflateInit_ z_inflateInit_
-# define inflate z_inflate
-# define inflateEnd z_inflateEnd
-# define deflateInit2_ z_deflateInit2_
-# define deflateSetDictionary z_deflateSetDictionary
-# define deflateCopy z_deflateCopy
-# define deflateReset z_deflateReset
-# define deflateParams z_deflateParams
-# define inflateInit2_ z_inflateInit2_
-# define inflateSetDictionary z_inflateSetDictionary
-# define inflateSync z_inflateSync
-# define inflateSyncPoint z_inflateSyncPoint
-# define inflateReset z_inflateReset
-# define compress z_compress
-# define compress2 z_compress2
-# define uncompress z_uncompress
-# define adler32 z_adler32
-# define crc32 z_crc32
-# define get_crc_table z_get_crc_table
-
-# define Byte z_Byte
-# define uInt z_uInt
-# define uLong z_uLong
-# define Bytef z_Bytef
-# define charf z_charf
-# define intf z_intf
-# define uIntf z_uIntf
-# define uLongf z_uLongf
-# define voidpf z_voidpf
-# define voidp z_voidp
-#endif
-
-#if (defined(_WIN32) || defined(__WIN32__)) && !defined(WIN32)
-# define WIN32
-#endif
-#if defined(__GNUC__) || defined(WIN32) || defined(__386__) || defined(i386)
-# ifndef __32BIT__
-# define __32BIT__
-# endif
-#endif
-#if defined(__MSDOS__) && !defined(MSDOS)
-# define MSDOS
-#endif
-
-/*
- * Compile with -DMAXSEG_64K if the alloc function cannot allocate more
- * than 64k bytes at a time (needed on systems with 16-bit int).
- */
-#if defined(MSDOS) && !defined(__32BIT__)
-# define MAXSEG_64K
-#endif
-#ifdef MSDOS
-# define UNALIGNED_OK
-#endif
-
-#if (defined(MSDOS) || defined(_WINDOWS) || defined(WIN32)) && !defined(STDC)
-# define STDC
-#endif
-#if defined(__STDC__) || defined(__cplusplus) || defined(__OS2__)
-# ifndef STDC
-# define STDC
-# endif
-#endif
-
-#ifndef STDC
-# ifndef const /* cannot use !defined(STDC) && !defined(const) on Mac */
-# define const
-# endif
-#endif
-
-/* Some Mac compilers merge all .h files incorrectly: */
-#if defined(__MWERKS__) || defined(applec) ||defined(THINK_C) ||defined(__SC__)
-# define NO_DUMMY_DECL
-#endif
-
-/* Old Borland C incorrectly complains about missing returns: */
-#if defined(__BORLANDC__) && (__BORLANDC__ < 0x500)
-# define NEED_DUMMY_RETURN
-#endif
-
-
-/* Maximum value for memLevel in deflateInit2 */
-#ifndef MAX_MEM_LEVEL
-# ifdef MAXSEG_64K
-# define MAX_MEM_LEVEL 8
-# else
-# define MAX_MEM_LEVEL 9
-# endif
-#endif
-
-/* Maximum value for windowBits in deflateInit2 and inflateInit2.
- * WARNING: reducing MAX_WBITS makes minigzip unable to extract .gz files
- * created by gzip. (Files created by minigzip can still be extracted by
- * gzip.)
- */
-#ifndef MAX_WBITS
-# define MAX_WBITS 15 /* 32K LZ77 window */
-#endif
-
-/* The memory requirements for deflate are (in bytes):
- (1 << (windowBits+2)) + (1 << (memLevel+9))
- 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
- the default memory requirements from 256K to 128K, compile with
- make CFLAGS="-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7"
- Of course this will generally degrade compression (there's no free lunch).
-
- The memory requirements for inflate are (in bytes) 1 << windowBits
- that is, 32K for windowBits=15 (default value) plus a few kilobytes
- for small objects.
-*/
-
- /* Type declarations */
-
-/* function prototypes */
-
-#ifdef OF
-#undef OF
-#endif
-
-/*
-#ifndef OF
-# ifdef STDC
- */
-# define OF(args) args
-/*
-# else
-# define OF(args) ()
-# endif
-#endif
- */
-
-/* The following definitions for FAR are needed only for MSDOS mixed
- * model programming (small or medium model with some far allocations).
- * 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,
- * just define FAR to be empty.
- */
-#if (defined(M_I86SM) || defined(M_I86MM)) && !defined(__32BIT__)
- /* MSC small or medium model */
-# define SMALL_MEDIUM
-# ifdef _MSC_VER
-# define FAR _far
-# else
-# define FAR far
-# endif
-#endif
-#if defined(__BORLANDC__) && (defined(__SMALL__) || defined(__MEDIUM__))
-# ifndef __32BIT__
-# define SMALL_MEDIUM
-# define FAR _far
-# endif
-#endif
-
-/* Compile with -DZLIB_DLL for Windows DLL support */
-#if defined(ZLIB_DLL)
-# if defined(_WINDOWS) || defined(WINDOWS)
-# ifdef FAR
-# undef FAR
-# endif
-# include
-# define ZEXPORT WINAPI
-# ifdef WIN32
-# define ZEXPORTVA WINAPIV
-# else
-# define ZEXPORTVA FAR _cdecl _export
-# endif
-# endif
-# if defined (__BORLANDC__)
-# if (__BORLANDC__ >= 0x0500) && defined (WIN32)
-# include
-# define ZEXPORT __declspec(dllexport) WINAPI
-# define ZEXPORTRVA __declspec(dllexport) WINAPIV
-# else
-# if defined (_Windows) && defined (__DLL__)
-# define ZEXPORT _export
-# define ZEXPORTVA _export
-# endif
-# endif
-# endif
-#endif
-
-#if defined (__BEOS__)
-# if defined (ZLIB_DLL)
-# define ZEXTERN extern __declspec(dllexport)
-# else
-# define ZEXTERN extern __declspec(dllimport)
-# endif
-#endif
-
-#ifndef ZEXPORT
-# define ZEXPORT
-#endif
-#ifndef ZEXPORTVA
-# define ZEXPORTVA
-#endif
-#ifndef ZEXTERN
-# define ZEXTERN extern
-#endif
-
-#ifndef FAR
-# define FAR
-#endif
-
-#if !defined(MACOS) && !defined(TARGET_OS_MAC)
-typedef unsigned char Byte; /* 8 bits */
-#endif
-typedef unsigned int uInt; /* 16 bits or more */
-typedef unsigned long uLong; /* 32 bits or more */
-
-#ifdef SMALL_MEDIUM
- /* Borland C/C++ and some old MSC versions ignore FAR inside typedef */
-# define Bytef Byte FAR
-#else
- typedef Byte FAR Bytef;
-#endif
-typedef char FAR charf;
-typedef int FAR intf;
-typedef uInt FAR uIntf;
-typedef uLong FAR uLongf;
-
-#ifdef STDC
- typedef void FAR *voidpf;
- typedef void *voidp;
-#else
- typedef Byte FAR *voidpf;
- typedef Byte *voidp;
-#endif
-
-#ifdef HAVE_UNISTD_H
-# include /* for off_t */
-# include /* for SEEK_* and off_t */
-# define z_off_t off_t
-#endif
-#ifndef SEEK_SET
-# define SEEK_SET 0 /* Seek from beginning of file. */
-# define SEEK_CUR 1 /* Seek from current position. */
-# define SEEK_END 2 /* Set file pointer to EOF plus "offset" */
-#endif
-#ifndef z_off_t
-# define z_off_t long
-#endif
-
-/* MVS linker does not support external names larger than 8 bytes */
-#if defined(__MVS__)
-# pragma map(deflateInit_,"DEIN")
-# pragma map(deflateInit2_,"DEIN2")
-# pragma map(deflateEnd,"DEEND")
-# pragma map(inflateInit_,"ININ")
-# pragma map(inflateInit2_,"ININ2")
-# pragma map(inflateEnd,"INEND")
-# pragma map(inflateSync,"INSY")
-# pragma map(inflateSetDictionary,"INSEDI")
-# pragma map(inflate_blocks,"INBL")
-# pragma map(inflate_blocks_new,"INBLNE")
-# pragma map(inflate_blocks_free,"INBLFR")
-# pragma map(inflate_blocks_reset,"INBLRE")
-# pragma map(inflate_codes_free,"INCOFR")
-# pragma map(inflate_codes,"INCO")
-# pragma map(inflate_fast,"INFA")
-# pragma map(inflate_flush,"INFLU")
-# pragma map(inflate_mask,"INMA")
-# pragma map(inflate_set_dictionary,"INSEDI2")
-# pragma map(inflate_copyright,"INCOPY")
-# pragma map(inflate_trees_bits,"INTRBI")
-# pragma map(inflate_trees_dynamic,"INTRDY")
-# pragma map(inflate_trees_fixed,"INTRFI")
-# pragma map(inflate_trees_free,"INTRFR")
-#endif
-
-#endif /* _ZCONF_H */
diff --git a/harbour/contrib/hbzlib/include/zip.h b/harbour/contrib/hbzlib/include/zip.h
deleted file mode 100644
index 9310860a79..0000000000
--- a/harbour/contrib/hbzlib/include/zip.h
+++ /dev/null
@@ -1,152 +0,0 @@
-/* zip.h -- IO for compress .zip files using zlib
- Version 0.15 alpha, Mar 19th, 1998,
-
- Copyright (C) 1998 Gilles Vollant
-
- This unzip package allow creates .ZIP file, compatible with PKZip 2.04g
- WinZip, InfoZip tools and compatible.
- Encryption and multi volume ZipFile (span) are not supported.
- Old compressions used by old PKZip 1.x are not supported
-
- For uncompress .zip file, look at unzip.h
-
- THIS IS AN ALPHA VERSION. AT THIS STAGE OF DEVELOPPEMENT, SOMES API OR STRUCTURE
- CAN CHANGE IN FUTURE VERSION !!
- I WAIT FEEDBACK at mail info@winimage.com
- Visit also http://www.winimage.com/zLibDll/zip.htm for evolution
-
- Condition of use and distribution are the same than zlib :
-
- This software is provided 'as-is', without any express or implied
- warranty. In no event will the authors be held liable for any damages
- arising from the use of this software.
-
- Permission is granted to anyone to use this software for any purpose,
- including commercial applications, and to alter it and redistribute it
- freely, subject to the following restrictions:
-
- 1. The origin of this software must not be misrepresented; you must not
- claim that you wrote the original software. If you use this software
- in a product, an acknowledgment in the product documentation would be
- appreciated but is not required.
- 2. Altered source versions must be plainly marked as such, and must not be
- misrepresented as being the original software.
- 3. This notice may not be removed or altered from any source distribution.
-
-
-*/
-
-/* for more info about .ZIP format, see
- ftp://ftp.cdrom.com/pub/infozip/doc/appnote-970311-iz.zip
- PkWare has also a specification at :
- ftp://ftp.pkware.com/probdesc.zip
-*/
-
-#ifndef _zip_H
-#define _zip_H
-
-
-#ifndef _HBCOMPRESS_H
-#include "hbcomprs.h"
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-
-#if defined(STRICTZIP) || defined(STRICTZIPUNZIP)
-/* like the STRICT of WIN32, we define a pointer that cannot be converted
- from (void*) without cast */
-typedef struct TagzipFile__ { int unused; } zipFile__;
-typedef zipFile__ *zipFile;
-#else
-typedef voidp zipFile;
-#endif
-
-#define ZIP_OK (0)
-#define ZIP_ERRNO (Z_ERRNO)
-#define ZIP_PARAMERROR (-102)
-#define ZIP_INTERNALERROR (-104)
-
-/* tm_zip contain date/time info */
-typedef struct tm_zip_s
-{
- uInt tm_sec; /* seconds after the minute - [0,59] */
- uInt tm_min; /* minutes after the hour - [0,59] */
- uInt tm_hour; /* hours since midnight - [0,23] */
- uInt tm_mday; /* day of the month - [1,31] */
- uInt tm_mon; /* months since January - [0,11] */
- uInt tm_year; /* years - [1980..2044] */
-} tm_zip;
-
-typedef struct
-{
- tm_zip tmz_date; /* date in understandable format */
- uLong dosDate; /* if dos_date == 0, tmu_date is used */
-/* uLong flag; */ /* general purpose bit flag 2 bytes */
-
- uLong internal_fa; /* internal file attributes 2 bytes */
- uLong external_fa; /* external file attributes 4 bytes */
-} zip_fileinfo;
-
-extern zipFile ZEXPORT zipOpen OF((const char *pathname, int append));
-/*
- Create a zipfile.
- pathname contain on Windows NT a filename like "c:\\zlib\\zlib111.zip" or on
- an Unix computer "zlib/zlib111.zip".
- if the file pathname exist and append=1, the zip will be created at the end
- of the file. (useful if the file contain a self extractor code)
- If the zipfile cannot be opened, the return value is NULL.
- Else, the return value is a zipFile Handle, usable with other function
- of this zip package.
-
-
-*/
-
-extern int ZEXPORT zipOpenNewFileInZip OF((zipFile file,
- const char* filename,
- const zip_fileinfo* zipfi,
- const void* extrafield_local,
- uInt size_extrafield_local,
- const void* extrafield_global,
- uInt size_extrafield_global,
- const char* comment,
- int method,
- int level));
-/*
- Open a file in the ZIP for writing.
- filename : the filename in zip (if NULL, '-' without quote will be used
- *zipfi contain supplemental information
- if extrafield_local!=NULL and size_extrafield_local>0, extrafield_local
- contains the extrafield data the the local header
- if extrafield_global!=NULL and size_extrafield_global>0, extrafield_global
- contains the extrafield data the the local header
- if comment != NULL, comment contain the comment string
- method contain the compression method (0 for store, Z_DEFLATED for deflate)
- level contain the level of compression (can be Z_DEFAULT_COMPRESSION)
-*/
-
-extern int ZEXPORT zipWriteInFileInZip OF((zipFile file,
- const voidp buf,
- unsigned len));
-/*
- Write data in the zipfile
-*/
-
-extern int ZEXPORT zipCloseFileInZip OF((zipFile file));
-/*
- Close the current file in the zipfile
-*/
-
-extern int ZEXPORT zipClose OF((zipFile file,
- const char* global_comment));
-/*
- Close the zipfile
-*/
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _zip_H */
diff --git a/harbour/contrib/hbzlib/include/zipabstractfile.h b/harbour/contrib/hbzlib/include/zipabstractfile.h
deleted file mode 100644
index 8c9097b262..0000000000
--- a/harbour/contrib/hbzlib/include/zipabstractfile.h
+++ /dev/null
@@ -1,54 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// $Workfile: ZipAbstractFile.h $
-// $Archive: /ZipArchive/ZipAbstractFile.h $
-// $Date$ $Author$
-////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// For the licensing details see the file License.txt
-////////////////////////////////////////////////////////////////////////////////
-
-#if !defined(AFX_ZIPABSTRACTFILE_H__46F247DE_21A6_4D12_AF64_B5A6B3CF4D57__INCLUDED_)
-#define AFX_ZIPABSTRACTFILE_H__46F247DE_21A6_4D12_AF64_B5A6B3CF4D57__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-#include "ZipExport.h"
-#include "zipstring.h"
-
-class ZIP_API CZipAbstractFile
-{
-public:
-
- enum { begin = SEEK_SET, // 0
- current = SEEK_CUR, // 1
- end = SEEK_END // 2
- };
- CZipAbstractFile(){}
- virtual bool Open(LPCTSTR , UINT , bool ){return true;}
- virtual void Close() = 0;
- virtual void Flush() = 0;
- virtual ZIP_ULONGLONG GetPosition() const = 0;
- virtual ZIP_ULONGLONG Seek(ZIP_LONGLONG lOff, int nFrom) = 0;
- virtual ZIP_ULONGLONG GetLength() const = 0;
- virtual void SetLength(ZIP_ULONGLONG nNewLen) = 0;
- virtual ZIP_ULONGLONG SeekToBegin(){return Seek(0, begin);}
- virtual ZIP_ULONGLONG SeekToEnd(){return Seek(0, end);}
- virtual CZipString GetFilePath() const = 0;
- virtual UINT Read(void *lpBuf, UINT nCount) = 0;
- virtual void Write(const void* lpBuf, UINT nCount) = 0;
- virtual bool IsClosed() const = 0;
- virtual ~CZipAbstractFile(){};
-
-};
-
-
-
-#endif // !defined(AFX_ZIPABSTRACTFILE_H__46F247DE_21A6_4D12_AF64_B5A6B3CF4D57__INCLUDED_)
diff --git a/harbour/contrib/hbzlib/include/ziparchive.h b/harbour/contrib/hbzlib/include/ziparchive.h
deleted file mode 100644
index 23402203e0..0000000000
--- a/harbour/contrib/hbzlib/include/ziparchive.h
+++ /dev/null
@@ -1,2052 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// $Workfile: ZipArchive.h $
-// $Archive: /ZipArchive/ZipArchive.h $
-// $Date$ $Author$
-////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// For the licensing details see the file License.txt
-//
-// Check the site http://www.artpol-software.com for the updated version of the library.
-////////////////////////////////////////////////////////////////////////////////
-//
-// The following information files are distributed along with this library:
-// License.txt - licensing information
-// gpl.txt - General Public License text
-// Readme.txt - general information
-// ChangeLog.txt - revision history
-// faq.txt - frequently asked questions
-// Appnote.txt - details on the zip format
-// ( also available at ftp://ftp.pkware.com/appnote.zip)
-//
-//
-
-
-
-/**
-* \file ZipArchive.h
-* Interface for the CZipArchive class.
-*
-*/
-
-#if !defined(AFX_ZIPARCHIVE_H__A7F528A6_1872_4071_BE66_D56CC2DDE0E6__INCLUDED_)
-#define AFX_ZIPARCHIVE_H__A7F528A6_1872_4071_BE66_D56CC2DDE0E6__INCLUDED_
-
-/**
- \namespace ziparchv
- A helper namespace.
- \par Members
- - CZipFileMapping
-
-*/
-
-
-
-
-/**
- \struct CZipFileMapping ZipFileMapping.h
-
- Maps a file to the memory. A system-specific implementation.
- Stored in ziparchv namespace.
-
- \c #include "ZipFileMapping.h"
-*/
-
-
-// to ensure that the correct files are copied
-// (see "Compatibility" chapter in the documentation).
-// Rebuild the project after copying the files.
-#ifdef ZIP_ARCHIVE_MFC_PROJ
- #ifndef ZIP_ARCHIVE_MFC
- #error You need to copy files from the MFC subdirectory\
- to the ZipArchive root directory and rebuild the project
- #endif
-#elif defined ZIP_ARCHIVE_STL_PROJ
- #ifndef ZIP_ARCHIVE_STL
- #error You need to copy files from the STL subdirectory\
- to the ZipArchive root directory and rebuild the project
- #endif
-#endif //
-
-#if (_MSC_VER > 1000) && (defined ZIP_HAS_DLL)
- #pragma warning( disable : 4251 ) // needs to have dll-interface to be used by clients of class
- #pragma warning( disable : 4275 ) // non dll-interface class used as base for dll-interface
-#endif
-
-
-//#ifdef __cplusplus
-//extern "C" {
-//#endif
-#ifndef _HBCOMPRESS_H
-#include "hbcomprs.h"
-#endif
-//#ifdef __cplusplus
-//}
-//#endif
-
-
-#include "zipexception.h"
-#include "zipautobuffer.h"
-#include "zipcentraldir.h"
-#include "zipstorage.h"
-#include "zippathcomponent.h"
-#include "zipstring.h"
-#include "ZipExport.h"
-
-
-/**
- Structure used as a parameter in CZipArchive::AddNewFile(CZipAddNewFileInfo& );
- Use one of constructors provided and then adjust the member variables that are
- set to default values by #Defaults method.
-*/
-struct ZIP_API CZipAddNewFileInfo
-{
- CZipAddNewFileInfo(LPCTSTR lpszFilePath, bool bFullPath = true)
- : m_szFilePath(lpszFilePath),m_bFullPath(bFullPath)
- {
- m_pFile = NULL;
- Defaults();
- }
- CZipAddNewFileInfo(LPCTSTR lpszFilePath, LPCTSTR lpszFileNameInZip)
- : m_szFilePath(lpszFilePath), m_szFileNameInZip(lpszFileNameInZip)
- {
- m_pFile = NULL;
- Defaults();
- }
- CZipAddNewFileInfo(CZipAbstractFile* pFile, LPCTSTR lpszFileNameInZip)
- : m_pFile(pFile), m_szFileNameInZip(lpszFileNameInZip)
- {
- Defaults();
- }
- /**
- the full path to the file to be added; if it is empty you need to set #m_pFile
- */
- CZipString m_szFilePath;
-
- /**
- the file name that will be stored in the archive (if the file is a directory,
- there is a path separator automatically added at the end); #SetRootPath
- function has no effect on this parameter
- */
- CZipString m_szFileNameInZip;
-
- /**
- It has only the meaning when #m_szFileNameInZip is not specified and #m_szFilePath is not empty.
-
- - if \c true, include full path of the file inside the archive (even if #m_szRootPath is set)
-
- - if \c false only the filename without a path is stored in the archive
-
- in this case if #m_szRootPath is set previously with #SetRootPath
- and if the beginning of #m_szFilePath equals #m_szRootPath
- then the filename is set to the remaining part of m_szFilePath
- (you can say to m_lpszFilePath minus #m_szRootPath)
- */
- bool m_bFullPath;
-
- /**
- the compression level, see #OpenNewFile
- */
- int m_iComprLevel;
-
- /**
- the smartness level of of the library; can be one or more #Smartness
- values (you can OR them);
- if zipsmCheckForEff is specified and due to it the file needs to be
- reinserted into the archive without a compression and the callback
- functor is specified, the callback functor's method Callback is called with the first argument set to
- DWORD (-1) (you need to remember the last argument if you need the size of the file)
- */
- int m_iSmartLevel;
-
- /**
- the index of the existing file in the archive to be replaced by the file being added (the new file
- goes into the same physical place as the old file - the archive may of course grow or shrink as a result)
-
-- >= 0 the index of the file to be replaced
-- -1 do not replace any file and add the new file at the end of the archive (default)
-- -2 if the new file has the same name as a file already in the archive then replace it or add at the end of the archive if it's filename is unique; it uses CZipArchive::FindFile with
- the arguments \e iCaseSensitive and \e bFileNameOnly set to default values
-
- \note
- - you replace files in disk-spanning archives (i.e. use a value different from -1)
- - if the space size taken by the old file is different from the space size needed by the new file, the callback is called while moving data (see CZipArchive::cbReplace)
- - this replaces the file physically, so no information from the file being replaced is retained (such as attributes, modification time, etc.)
- - if you use an invalid index, the function will fail; if you specify the last file in the archive to be replaced, it'll be removed and the usual action taken
- - the new file encryption does not depend on the old file encryption but only on the current password settings (see CZipArchive::SetPassword)
- - if #m_iComprLevel is not 0 then a temporary archive is created in the temporary directory
- (see CZipArchive::SetTempPath) or in the memory (if you use CZipArchive::zipsmMemoryFlag in #m_iSmartLevel)
- - the most complicated scenario is when you try to replace the file and use CZipArchive::zipsmCheckForEff flag in #m_iSmartLevel and the file compression proves to be
- inefficient (you can use the sample application \e ZipArc to observe the following process):
- - first you get CZipArchive::cbAdd callback - the file is being compressed to a temporary archive,
- - then the file compression proves to be inefficient and the file needs to be stored instead of compressed,
- but first the space inside archive must be adjusted to fit the file being added in the place of file being replaced - you get CZipArchive::cbReplace,
- - then, at the end, the file is being stored - you get CZipArchive::cbAddStore callback
-
- \see SetAdvanced
- \see CZipArchive::WillBeDuplicated
- */
- int m_iReplaceIndex;
-
- /**
- the size of the buffer used while file operations
- */
- unsigned long m_nBufSize;
-
- /**
- instead of from a physical file, the data for compression is taken from the CZipAbstractFile object (e.g. from CZipMemFile)
-
- \note
- - you have to leave #m_szFilePath empty if you set #m_pFile to not NULL
- - the time of the file in zip is set to the current time, and the attributes to the default
- file attributes (depending on the system)
- - you cannot add directories this way
- */
- CZipAbstractFile* m_pFile;
-
- /**
- Set default values for #m_iSmartLevel, #m_iReplaceIndex, #m_nBufSize and #m_iComprLevel
- */
- void Defaults();
-};
-
-
-/**
- The representation of the zip archive file.
- This class provides all the operations on the zip archive.
-
-*/
-class ZIP_API CZipArchive
-{
-
-public:
- /**
- The purpose of this structure is to hold the data that allow communication
- with the zlib library
- */
- struct ZIP_API CZipInternalInfo
- {
-
- CZipInternalInfo()
- {
- m_iBufferSize = 65536;
- }
- virtual ~CZipInternalInfo(){}
-
- /**
- Allocate internal buffer of m_iBufferSize size
- */
- void Init()
- {
- m_pBuffer.Allocate(m_iBufferSize);
- }
- void ReleaseBuf()
- {
- m_pBuffer.Release();
- }
- z_stream m_stream; ///< zlib library data stream
- DWORD m_uUncomprLeft; ///< bytes left to uncompress
- DWORD m_uComprLeft; ///< bytes left to decompress
- DWORD m_uCrc32; ///< crc32 file control value
-
- /**
- The size of the buffer used in decompressing data.
- Set before opening the archive.
- It is usually set with CZipArchive::SetAdvanced
- (specify this value as the second argument).
- \see CZipArchive::SetAdvanced
- */
- DWORD m_iBufferSize;
-
- /**
- This buffer caches data during compression and decompression.
- */
- CZipAutoBuffer m_pBuffer;
- };
-
- CZipArchive();
- virtual ~CZipArchive();
-
-/**
- In non-UNICODE version just copy \e szSingle to \e szWide.
- In UNICODE version works the same way as ZipPlatform::SingleToWide
- \param szSingle
- \param szWide
-
- \return (in non-UNICODE version the number of characters copied)
- \see ZipPlatform::SingleToWide
-*/
- static int SingleToWide(const CZipAutoBuffer &szSingle, CZipString& szWide);
-
-/**
- In non-UNICODE version just copy \e lpWide to \e szSingle.
- In UNICODE version works the same way as ZipPlatform::WideToSingle
- \param lpWide
- \param szSingle
- \return (in non-UNICODE version the number of characters copied)
- \see ZipPlatform::WideToSingle
-
-*/
- static int WideToSingle(LPCTSTR lpWide, CZipAutoBuffer &szSingle);
-
-
-/**
- Set the password for the file to be opened or created.
- Use this method BEFORE opening or adding a file, but AFTER opening an archive
- \param lpszPassword
- set it to NULL to clear password
- \return \c false if the password contains ASCII characters
- with values 128 or higher or the file inside archive is opened
-
-*/
- bool SetPassword(LPCTSTR lpszPassword = NULL);
-
-/**
- \return the current archive password or an empty string if there is no password
-*/
- CZipString GetPassword()const ;
-
-/**
- Set the buffer sizes. No buffer can be set smaller than 1024.
- Use this method before opening the archive. The optimal size for
- the write buffer in the disk spanning archive is the size of the volume.
-
- \param iWriteBuffer
- the write cache size used
- \see CZipStorage::m_iWriteBufferSize
- \param iGeneralBuffer
- buffer used in extracting, compressing, deleting, getting (#GetFromArchive) files, renaming and replacing
- \see CZipInternalInfo::m_iBufferSize
- \param iSearchBuffer
- the buffer used in searching for the central dir
- \see CZipCentralDir::m_iBufferSize
- \see GetAdvanced
-*/
- void SetAdvanced(int iWriteBuffer = 65536, int iGeneralBuffer = 65536, int iSearchBuffer = 32768);
-
- /**
- retreive buffer size as set by #SetAdvanced
- */
- void GetAdvanced(int* piWriteBuffer = NULL, int* piGeneralBuffer = NULL, int* piSearchBuffer= NULL)
- {
- if (piWriteBuffer)
- *piWriteBuffer = m_storage.m_iWriteBufferSize;
- if (piGeneralBuffer)
- *piGeneralBuffer = m_info.m_iBufferSize;
- if (piSearchBuffer)
- *piSearchBuffer = m_centralDir.m_iBufferSize;
- }
-
- /**
- Enum values used as \e iWhich parameter in #SetCallback function.
- You can assign several values to the same functor (OR them)
- \see CZipActionCallback
- */
- enum CallbackType
- {
- cbNothing = 0x0000, ///< you can use it for your own purposes
- cbAdd = 0x0001, ///< called when adding a file with one of #AddNewFile functions
- cbAddTmp = 0x0002, ///< called while adding a file (only on a disk-spanning archive) when the smartness level contains CZipArchive::zipsmCheckForEff or CZipArchive::zipsmCheckForEffInMem
- ///< and if just compressed file is being moved from a temporary place (file or memory) to the archive
- cbAddStore = 0x0004, ///< called while adding a file and if it's compressing has proven to be inefficient and it is now being stored (instead of compressed) in the archive;
- ///< smartness level must contain CZipArchive::zipsmCheckForEff or CZipArchive::zipsmCheckForEffInMem; the archive can be disk-spanning or not
-
- cbExtract = 0x0008, ///< called when extracting a file with one of #ExtractFile functions
-
- cbDeleteCnt = 0x0010, ///< called before the actual deletion takes place and the map of holes and continuous areas is being created (it safe to break it by returning \c false from the callback method)
- cbDelete = 0x0020, ///< called when moving data while deleting file(s) with function #DeleteFile or one of #DeleteFiles functions
-
- cbTest = 0x0040, ///< called when testing a file with #TestFile function
- cbSave = 0x0080, ///< called when saving the central directory with CZipCentralDir::Write (usually on close or flush); it is safe to break on non-disk spanning archive - the saved part of
- ///< the central directory will be removed from disk
- cbGetFromArchive
- = 0x0100, ///< called when using one of #GetFromArchive methods
- cbRename = 0x0200, ///< called when during the renaming a file there is a need to make less or more space for the new filename
- cbReplace = 0x0400, ///< called when moving data while replacing files to make less or more space for the new file
- cbNextValue = 0x0800, ///< for CZipActionCallback overrides and user defined callbacks
-
-
- cbSubActions= cbAddTmp | cbAddStore | cbDeleteCnt | cbReplace, ///< sub actions - they are part of bigger actions (#cbAddTmp | #cbAddStore | #cbDeleteCnt | #cbReplace)
- cbActions = cbAdd | cbExtract | cbDelete | cbTest | cbSave | cbGetFromArchive | cbRename, ///< main actions (#cbAdd | #cbExtract | #cbDelete | #cbTest | #cbSave | #cbGetFromArchive | #cbRename)
- cbAll = cbActions | cbSubActions ///< assign all callbacks to the same functor
- };
-
-
- /**
-
- Set callback functors for the following operations on the zip archive: adding, extracting, testing or deleting files.
- See \ref sectCallb information on how to use functors.
- \param pCallback
- the address of the functional object which class is derived from CZipActionCallback
- (you need to override member function CZipCallback::Callback in the derived class)
- Set it to \c NULL to clear callback for the selected actions.
- \param iWhich
- can be one or more (use logical OR) #CallbackType values.
-
- \see CZipActionCallback
- \see GetCallback
-
- */
- void SetCallback(CZipActionCallback* pCallback = NULL, int iWhich = cbAll);
-
- /**
- \return the callback \e iWhich set with #SetCallback
- */
- CZipActionCallback* GetCallback(CallbackType iWhich)
- {
- return m_callbacks.Get(iWhich);
- }
-
- /**
- Set the callback functor used during operations on a
- PKZIP compatible disk spanning archive to change disks.
- Set it before opening the archive. If you open the archive
- in the \ref PKSpan "PKZIP compatible mode" and don't set the callback functor,
- the exception CZipException::noCallback will be thrown.
-
- Callback functor's method CZipSpanCallback::Callback is called when there is a need for a disk change.
- Calling CZipArchive methods from inside this method may result in an unexpected behavior.
- \param pCallback
- the address of the functional object which class is derived from CZipSpanCallback
- (you need to override member function CZipCallback::Callback in the derived class)
- Set it to \c NULL to clear the callback.
-
- \see CZipSpanCallback
- */
- void SetSpanCallback(CZipSpanCallback* pCallback = NULL){m_storage.m_pChangeDiskFunc = pCallback;}
-
-
-
- /**
- Archive open modes used in #Open(LPCTSTR , int , int )
- and #Open(CZipMemFile, int )
- */
- enum OpenMode
- {
- zipOpen, ///< open an existing archive
- /**
- Open an existing archive as a read only file.
- This mode is intended to use in a self extract code or opening
- archive on storage without write access (e.g. CD-ROMS),
- If you try to modify the archive in this mode,
- an exception will be thrown.
- */
- zipOpenReadOnly,
- zipCreate, ///< create a new archive
- zipCreateSpan ///< create a disk spanning archive
- };
-
-
-
-/**
- Open or create a zip archive.
-
- The archive creation mode depends on \e iMode and \e iVolumesSize values:
- - if \e iMode == #zipCreateSpan and \e iVolumeSize <= 0 then create disk spanning
- archive in \ref PKSpan "PKZIP compatible mode" (pkzipSpan)
- - if \e iMode == #zipCreateSpan and \e iVolumeSize > 0 then create disk spanning
- archive in \ref TDSpan "TD compatible mode" (tdSpan)
- - if \e iMode == #zipOpen and the existing archive is a spanned archive
- then pkzipSpan mode is assumed if the archive is on a removable device
- or tdSpan otherwise;
- if you want to open tdSpan archive on a removable device, set \e iVolumeSize
- to a value different from 0
- - if \e iMode == #zipCreate then \e iVolumeSize doesn't matter
-
- \param szPathName
- the path to the archive
- \param iMode
- one of the #OpenMode values
- \param iVolumeSize
- the volume size in the disk spanning archive;
- the size of the volume may be from 1 to INT_MAX ,
- and the bigger - the faster is creation and extraction (no file changes between volumes) - but the size of the whole archive is the same.
- If you're creating disk-spanning archive in \ref TDSpan "TD span compatible mode"
- and plan later to convert it to \ref PKSpan "PKZIP compatible mode" (see \ref sectSpan), it is good to set this this value to
- about the size of the diskette (a little less just in case).
-
- \note Throws exceptions.
- \see Open(CZipMemFile&, int);
- \see GetSpanMode
-*/
- void Open(LPCTSTR szPathName, int iMode = zipOpen, int iVolumeSize = 0);
-
-
-/**
- Open or create the archive in memory. The CZipMemFile object is not closed
- after closing the archive, so that is it possible to work with it afterwards.
- \param mf
- CZipMemFile structure to create archive in or extract from
- \note This is important: you shouldn't destroy CZipMemFile object before
- closing the archive, because you'll get an error;
- \param iMode
- Open mode.
- The following modes are valid: #zipOpen, #zipOpenReadOnly, #zipCreate
- \note Throws exceptions.
- \see Open(LPCTSTR, int, int);
-*/
- void Open(CZipMemFile& mf, int iMode = zipOpen);
-
-/**
- Set #m_szRootPath to a specified value. Use it if you don't want to set
- \e bFullPath argument in #AddNewFile or #ExtractFile to true and you
- don't want to strip the whole path neither, but only a specific beginning.
- Use it AFTER opening the archive and before using #AddNewFile or #ExtractFile.
- See \ref q9 "the FAQ" for the example of use.
- \param szPath
- Set it to the string that you want to be omitted from the beginning of the path of the file
- in the archive
- if \c NULL - clears the #m_szRootPath and no path beginning will be matched against it
-
- \note Set the case-sensitivity with #SetCaseSensitivity
-
- \see AddNewFile
- \see ExtractFile
- \see GetRootPath
-
-*/
- void SetRootPath(LPCTSTR szPath = NULL);
-
-
- /**
- Return the current value of #m_szRootPath
- \return CZipString
- */
- CZipString GetRootPath()const
- {
- return m_szRootPath;
- }
-
- /**
- The levels of smartness of the adding files action (see #AddNewFile)
- \note If you wish to use \e zipsmCheckForEff, you should use
- \e zipsmNotCompSmall as well, because it will save you the time
- ( the small file will be surely larger after compression, so that
- we can add it not compressed straight away);the compression level
- is always ignored for a directory and set to 0
- */
-
- enum Smartness
- {
- zipsmLazy = 0x0000, ///< do not bother (you know what you're doing after all)
- zipsmCPassDir = 0x0001, ///< clear password for directories
- zipsmCPFile0 = 0x0002, ///< clear password for files of 0 size
- zipsmNotCompSmall = 0x0004, ///< do not compress files smaller than 5 bytes (they are always stored larger than uncompressed)
- zipsmCheckForEff = 0x0008, ///< check whether the compressed file is larger than uncompressed and if so, remove it and store without the compression;
- ///< in the disk spanning mode, the temporary file is used for that: if the file compression is efficient, the data is not compressed
- ///< again, but moved from the temporary file to the archive; you can use #SetTempPath() to set the path where the
- ///< file will be created or you can let the library figure it out (the library tries first the system default temporary directory,
- ///< if it is not present or there is not enough space there, it tries the current directory, if it fails, no temporary file is created
- ///< and the compression goes the usual way
-
- zipsmMemoryFlag = 0x0010, ///< combine it with zipsmCheckForEff or use zipsmCheckForEffInMem, you can also use this when replacing files see note at CZipAddNewFileInfo::m_iReplaceIndex
-
- zipsmCheckForEffInMem = zipsmMemoryFlag | zipsmCheckForEff, ///< the same as #zipsmCheckForEff, but the temporary file is created created in memory instead (the temporary directory set with #SetTempPath() is ignored); has the meaning only with a disk-spanning archive,
- ///< non-disk spanning archives don't need a temporary file
- zipsmSmartPass = zipsmCPassDir | zipsmCPFile0, ///< smart password policy (a combination of \e zipsmCPassDir and \e zipsmCPFile0)
- zipsmSmartAdd = zipsmNotCompSmall | zipsmCheckForEff, ///< smart adding (a combination of \e zipsmNotCompSmall and \e zipsmCheckForEff)
- zipsmSafeSmart = zipsmSmartPass | zipsmNotCompSmall, ///< safe smart (smartest without checking for efficiency)
- zipsmSmartest = zipsmSmartPass | zipsmSmartAdd, ///< smart at its best
-
-
- zipsmInternal01 = 0xf000 ///< for internal use only
-
- };
-
-
- /**
- Add a new file to the archive. You can set the callback functor with #SetCallback.
- \param info see CZipAddNewFileInfo
- \return \c if it returns false then the file was not added, but the internal
- state allows you to add other files (which is not possible after throwing
- an exception)
-
- \note
- - If you abort while adding a file in a non-disk-spanning archive, the added data will be removed from the archive
- - Throws exceptions.
-
- \see SetCallback
- \see AddNewFile(LPCTSTR, LPCTSTR, int, int, unsigned long)
- \see AddNewFile(LPCTSTR, int, bool, int, unsigned long)
- \see AddNewFile(CZipMemFile&, LPCTSTR, int, int, unsigned long)
- */
- bool AddNewFile(CZipAddNewFileInfo& info);
- bool AddNewFileDrv(CZipAddNewFileInfo& info);
-
-
- /**
- \see AddNewFile(CZipAddNewFileInfo& ); the parameters are equivalent to CZipAddNewFileInfo member variables
-
- */
- bool AddNewFile(LPCTSTR lpszFilePath, int iComprLevel = -1, bool bFullPath = true,
- int iSmartLevel = zipsmSafeSmart, unsigned long nBufSize = 65536);
-
- bool AddNewFileDrv(LPCTSTR lpszFilePath, int iComprLevel = -1, bool bFullPath = true,
- int iSmartLevel = zipsmSafeSmart, unsigned long nBufSize = 65536);
- /**
- \see AddNewFile(CZipAddNewFileInfo& ); the parameters are equivalent to CZipAddNewFileInfo member variables
- */
- bool AddNewFile(LPCTSTR lpszFilePath,
- LPCTSTR lpszFileNameInZip,
- int iComprLevel = -1,
- int iSmartLevel = zipsmSafeSmart,
- unsigned long nBufSize = 65536);
-
- /**
- \see AddNewFile(CZipAddNewFileInfo& ); the parameters are equivalent to CZipAddNewFileInfo member variables
- */
- bool AddNewFile(CZipMemFile& mf,
- LPCTSTR lpszFileNameInZip,
- int iComprLevel = -1,
- int iSmartLevel = zipsmSafeSmart,
- unsigned long nBufSize = 65536);
-
-
-
-/**
- Add a new file to the opened zip archive. The zip archive cannot be
- an existing disk spanning archive (existing at the moment of opening archive),
- because modifying such an archive is not possible (at least not with this
- version ).
-
- \param header
- The structure that provides additional information about the added file.
- The following fields are valid:
- - \e m_uMethod - file compression method; can be 0 (storing) or Z_DEFLATE (deflating)
- otherwise Z_DEFLATE is assumed
- - \e m_uModDate, \e m_uModTime - Use CZipFileHeader::SetTime to set them.
- If \e lpszFilePath is not NULL this fields are overwritten and updated automatically.
- See CZipFileHeader::SetTime
- - \e m_uExternalAttr - Attributes of the file.
- If \e lpszFilePath is not NULL this field is overwritten and updated automatically.
- Use #SetFileHeaderAttr to set them. See #SetFileHeaderAttr.
- - \e m_szFileName - A filename (may be with path) to be stored inside archive
- to represent this file. See CZipFileHeader::SetFileName
- - \e m_szComment - A file comment. See CZipFileHeader::SetComment
- - \e m_pExtraField - LOCAL extra field, use #SetExtraField after opening
- a new file, but before closing it to set the not local extra field
- in the header in the central directory. See #SetExtraField
- Other fields are ignored - they are updated automatically.
- If the function returns \c true, \link #GetSystemCompatibility
- system compatibility \endlink for this object is
- set to the correct value (the same as #m_iArchiveSystCompatib),
- additionally if \e lpszFilePath was not NULL, the attributes and
- the time fields are filled with information retrieved from
- the file pointed by \e lpszFilePath.
- \param iLevel
- The level of compression (-1, 0 - 9).
- The are several preset values for the compression level:
- - Z_DEFAULT_COMPRESSION : -1 (equals 6)
- - Z_NO_COMPRESSION : 0
- - Z_BEST_SPEED : 1
- - Z_BEST_COMPRESSION : 9
- \param lpszFilePath
- The path to the file to retrieve date stamp and attributes from.
- These values are stored inside the archive.
- \param uInternal
- for internal use only
-
- \return \c false in the following cases:
- - the \e lpszFilePath is not NULL and the file attributes and data was not correctly retrieved
- - a file is already opened for extraction or compression
- - archive is an existing disk span archive
- - maximum file count inside archive already reached (65536)
- \note Throws exceptions.
-
-*/
- bool OpenNewFile(CZipFileHeader & header, int iLevel = Z_DEFAULT_COMPRESSION, LPCTSTR lpszFilePath = NULL, DWORD uInternal = 0);
-
-/**
- Compress the contents of the buffer and write it to a new file.
- \param pBuf
- the buffer containing the data to be compressed and written
- \param iSize
- the number of bytes to be written from the buffer
- \return \c false if the new file hasn't been opened yet
- \note Throws exceptions.
- \see OpenNewFile
-*/
- bool WriteNewFile(const void *pBuf, DWORD iSize);
-
-
-/**
- Set the extra field in the central directory of the currently opened file.
- Must be used after opening a new file in the archive, but before closing it
- To set the local extra field, set it in the CZipFileHeader structure passed
- as the argument to the #OpenNewFile
- \param pBuf
- the bufer with the data to be copied
- \param iSize
- the size of the extra field in the buffer
- \see OpenNewFile
-*/
- void SetExtraField(const char *pBuf, WORD iSize);
-
-/**
- Close the new file in the archive.
- \return \c false if there is no new file opened
- \param bAfterException
- it will close the new file without writing anything (call it also
- with this parameter set to \c true after an exception other than CZipException::abortedSafely was
- thrown from one of #AddNewFile functions)
- \note Throws exceptions.
- \see OpenNewFile
-*/
- bool CloseNewFile(bool bAfterException = false);
-
-/**
- Acquire a file with the given index from another archive.
- The compressed data of the file from another archive are copied
- without decompressing to the current archive.
- You can set the callback functor with #SetCallback.
- \param zip
- an opened archive to get the file from (must not be multi-disk)
- \param uIndex
- a zero-based index of the file to get from the \e zip archive
- \param iReplaceIndex the same as CZipAddNewFileInfo::m_iReplaceIndex
- \param bKeepSystComp
- if \c false, which is default, then the file from \e zip archive
- system compatibility is converted to the current archive system
- compatibility (if they differ)
- \return \c false if the operation could not be performed (either of archives is closed,
- a file inside either of archives is opened, \e zip archive is multi-disk or the current
- archive is an existing multi-disk archive)
- \note Throws exceptions
- (when an exception is thrown, you may need to call #CloseNewFile with \e bAfterException set to \c true, to make the archive reusable).
- \note it is safe to abort the action (by returning false from the callback call) in non-disk spanning archive and when no replacing is taking place
- (the file not entirely added is removed from the archive)
- \see SetCallback
- \see GetFromArchive(CZipArchive& , CZipWordArray &, bool)
- \see GetFromArchive(CZipArchive& , CZipStringArray &, bool)
- \see FindMatches
- \see SetAdvanced
-*/
- bool GetFromArchive(CZipArchive& zip, WORD uIndex, int iReplaceIndex = -1, bool bKeepSystComp = false)
- {
-
- m_info.Init();
- bool bRet;
- try
- {
- bRet = GetFromArchive(zip, uIndex, iReplaceIndex, bKeepSystComp, GetCallback(cbGetFromArchive));
- }
- catch(...)
- {
- m_info.ReleaseBuf();
- throw;
- }
- m_info.ReleaseBuf();
- if (bRet && m_bAutoFlush)
- Flush();
-
- return bRet;
- }
-
- /**
- Acquire files with the given indexes from another archive.
-
- \param aIndexes
- an array of zero-based indexes of the files inside the \e zip archive
-
- \see GetFromArchive(CZipArchive& , WORD, int, bool)
-
- \note
- - To get files which filenames match a specified pattern, use #FindMatches function
- */
- bool GetFromArchive(CZipArchive& zip, CZipWordArray &aIndexes, bool bKeepSystComp = false);
-
- /**
- Acquire files with the given indexes from another archive.
- \param aNames
- an array of filenames inside the \e zip archive;
-
- \see GetFromArchive(CZipArchive& , WORD, int, bool)
- \see EnableFindFast
-
- \note
- - Set the case-sensitivity with #SetCaseSensitivity
- - Enables FindFast if not enabled
-
- */
-
- bool GetFromArchive(CZipArchive& zip, CZipStringArray &aNames, bool bKeepSystComp = false)
- {
- CZipWordArray indexes;
- zip.GetIndexes(aNames, indexes);
- return GetFromArchive(zip, indexes, bKeepSystComp);
-
- }
-
- /**
- Get indexes of the files stored int \e aNames array and put them into \e aIndexes
- \param aNames
- an array of filenames inside the archive;
- \param aIndexes
- an array of indexes to be build
- \note
- - Set the case-sensitivity with #SetCaseSensitivity
- - Enables FindFast if not enabled
-
- */
- void GetIndexes(const CZipStringArray &aNames, CZipWordArray& aIndexes);
-
-/**
- Extract the file from the archive. You can set the callback functor with #SetCallback.
- The argument \e lpszNewName may point to the full path and is influenced by \e bFullPath
- argument (if \e lpszNewName contains drive specification then it is removed)
- \param uIndex
- the index of the file to extract
- \param lpszPath
- \verbatim
- The PATH only to extract the file to. May not be NULL. If you wish to
- use UNC path you need to replace \\\\ at the beginning of UNC path with \\\\?\UNC\ .
- \endverbatim
- \param bFullPath
- - if \c true, then extract with the full path - in this case the resulting
- file path is \e lpszPath plus the path stored in the archive or plus \e lpszNewName
- if \e lpszNewName is not NULL.
- - if \c false, the destination file path is \e lpszPath + \e the filename only
- extracted from the path stored in the archive or from \e lpszNewName if
- \e lpszNewName is specified;
- if #m_szRootPath is set previously with #SetRootPath then to \e lpszPath
- is added the path stored in the archive (or \e lpszNewName if
- \e lpszNewName is specified) that has removed the beginning that equals
- #m_szRootPath (if there is no common beginning then is behaves like
- #m_szRootPath was empty)
- \param lpszNewName
- The new name of the file after extraction.
- If NULL the original filename stored in the archive is used.
- May point to the full path but, if \e bFullPath is \c false, only the filename is extracted from this argument,
- \param nBufSize
- the size of the buffer used while file operations
- \return \c true if successful
- \note
- - To extract files which filenames match a specified pattern, use #FindMatches function
- - Throws exceptions.
- \see SetCallback
- \see ExtractFile(WORD, CZipMemFile&, DWORD)
- \see FindMatches
-*/
- bool ExtractFile(WORD uIndex, LPCTSTR lpszPath, bool bFullPath = true,
- LPCTSTR lpszNewName = NULL, DWORD nBufSize = 65536);
-
-
- /**
- The same as #ExtractFile(WORD , LPCTSTR , bool , LPCTSTR , DWORD )
- but instead to a physical file, this function decompress the data into CZipMemFile object
- \note
- - if you pass CZipMemFile object already with data, its contents are NOT overwirtten, but the decompressed data is appended at the end
- - if you try to extract a directory, the function will return \c false
- */
- bool ExtractFile(WORD uIndex, CZipMemFile& mf, DWORD nBufSize = 65536);
-
-/**
- Open the file with the given index in the archive for extracting.
- Not successful opening the file doesn't lock the whole archive, so
- you can try to open another one (after catching an exception if it was
- thrown). Throw exception CZipException::badPassword if the password
- was not set for the encrypted file.
- \param uIndex
- the index of the file
- \return \c true if successful
- \note Throws exceptions.
-*/
- bool OpenFile(WORD uIndex);
-
-/**
- Decompress currently opened file to the buffer.
- \param pBuf
- buffer to receive data
- \param iSize
- the size of the buffer
- \return the number of bytes read
- \see OpenFile
- \note Throws exceptions.
-*/
- DWORD ReadFile(void *pBuf, DWORD iSize);
-
-
-/**
- Test the file with the given index for the integrity. You can set the callback functor with #SetCallback.
- The method throws exceptions but performs all the necessary cleanup
- before, so that the next file can be tested after catching the exception.
- \param uIndex
- index of the file to test
- \param uBufSize
- the size of the buffer used during extraction
- \return \c false if the incorrect action has been taken by
- the user or the programmer (it is when #OpenFile or #GetFileInfo returned \c false or \e uBufSize is 0).
- If the file didn't passed the test or there was a disk I/O error or the password supplied was incorrect, an exception is thrown.
- \note Throws exceptions.
- \see SetCallback
-
-*/
- bool TestFile(WORD uIndex, DWORD uBufSize = 65536);
-
-/**
- Perform the necessary cleanup after an exception was thrown
- while testing the archive so that next files in the archive can be tested.
- Called by #TestFile. Does not remove the file headers
- information from the central directory.
- \see TestFile
- \see CZipCentralDir::Clear
-*/
- void CloseFileAfterTestFailed();
-
-/**
- Get the local extra filed of the currently opened
- for extraction file in the archive.
- \param pBuf
- the buffer to receive the data
- \param iSize
- the size of the buffer
- \return If \e pBuf is NULL or iSize is 0, returns the size of the local extra field.
- Returns -1 if there is no file opened for the extraction.
-*/
- int GetLocalExtraField(char* pBuf, int iSize)const ;
-
-/**
- The same as CZipArchive::CloseFile(LPCTSTR), but additionally
- closes \e file.
- \param file
- OPENED CZipFile structure of the extracted file
- \return
- \note Throws exceptions.
- \see CZipArchive::CloseFile(LPCTSTR)
-*/
- int CloseFile(CZipFile &file);
-
-
-/**
- Close the file opened for extraction in the archive and copy its date and
- attributes to the file pointed by \e lpszFilePath
- \param lpszFilePath
- Points to the path of the file to have the date and attributes information updated.
- \param bAfterException
- Set to \c true to close the file inside archive after an exception has been
- thrown, to allow futher operations on the archive.
- \warning Close the file pointed by \e lpszFilePath before using this method,
- because the system may not be able to retrieve information from it.
- \return
- - "1" = ok
- - "-1" = some bytes left to uncompress - probably due to a bad password or corrupted archive
- - "-2" = setting extracted file date and attributes was not successful
- \note Throws exceptions.
-*/
- int CloseFile(LPCTSTR lpszFilePath = NULL, bool bAfterException = false);
-
-/**
- Delete the file from the archive with the given index.
- You can set the callback functor with #SetCallback.
- If you plan to delete more than one file, use one of DeleteFiles functions rather than calling DeleteFile
- successively, because these functions are optimized for deleting multiple files
- \param uIndex
- a zero-based index
- \note Throws exceptions.
- \see SetCallback
- \see DeleteFiles(CZipWordArray&)
- \see DeleteFiles(const CZipStringArray&)
- \see FindMatches
-*/
- void DeleteFile(WORD uIndex);
-
-/**
- Delete files from the archive.
- You can set the callback functor with #SetCallback.
- Sorts \e aIndexes array in an ascending order.
- \param aIndexes
- an array of zero-based indexes of the files inside the archive
- \note
- - To remove files which filenames match a specified pattern, use #FindMatches function
- - Throws exceptions.
- \see SetCallback
- \see DeleteFile
- \see DeleteFiles(const CZipStringArray& )
- \see FindMatches
-*/
- void DeleteFiles(CZipWordArray &aIndexes);
-
-
-/**
- Delete files from the archive.
- You can set the callback functor with #SetCallback.
- \param aNames
- an array of filenames inside the archive;
- \note
- - Set the case-sensitivity with #SetCaseSensitivity
- - Enables FindFast if not enabled
- - Throws exceptions.
- \see SetCallback
- \see DeleteFile
- \see DeleteFiles(CZipWordArray&)
- \see EnableFindFast
-*/
- void DeleteFiles(const CZipStringArray &aNames);
-
-
-/**
- Set the global comment in the archive.
- \param lpszComment
- the file comment
- \return \c false if the archive is closed or if it is an existing disk spanning archive
- \note Throws exceptions.
-*/
- bool SetGlobalComment(LPCTSTR lpszComment);
-
-
-/**
- \return the global comment or an empty string if the archive is closed
-*/
- CZipString GetGlobalComment()const ;
-
-
-/**
- Set the comment of the file with the given index inside the archive.
- \param uIndex
- zero-based index of the file in the archive
- \param lpszComment
- a comment to add
- \return \c false if the comment change is impossible
- \note Throws exceptions.
-*/
- bool SetFileComment(WORD uIndex, LPCTSTR lpszComment);
-
-/**
- \return the path of the currently opened archive volume
-*/
- CZipString GetArchivePath()const;
-
-/**
- \return
- - a one-based number of the current disk
- - 0 if there is no current disk (the archive is closed)
- \note Useful mostly while working with the disk-spanning archive in creation to find out
- how many disks were already created. To find out how many disks are in an existing disk-spanning archive,
- use the function #GetCentralDirInfo
-*/
- int GetCurrentDisk()const ;
-
-/**
- Return the disk spanning mode of the current archive.
-
- \return
- - -2 - existing TD mode compatible disk spanning archive
- - -1 - existing PKZIP compatible
- - 0 - no disk spanning
- - 1 - PKZIP compatible in creation
- - 2 - TD compatible in creation
-
- \see \ref PKSpan, \ref TDSpan
-
-*/
- int GetSpanMode()const
- {
- return m_storage.m_iSpanMode * m_storage.IsSpanMode();
- }
-
- /**
- case-sensitivity values used as argument \e iCaseSensitive in #FindFile
- */
- enum FFCaseSens
- {
- ffDefault, ///< use the default case-sensitivity as set with #SetCaseSensitivity function;
- ///< if CZipCentralDir::m_findarray was build before with a different case-sensitivity,
- ///< it is rebuild again, if it hasn't been build so far, it is build now with the
- ///< default case-sensitivity
- ffCaseSens, ///< perform a case-sensitive search (if the \c CZipArchive is non-case-sensitive,
- ///< a less effective search is perfomed); does not rebuild CZipCentralDir::m_findarray,
- ///< but if the array hasn't been built yet, it is build now as \b non-case-sensitive
- ///< (you can use \c SetCaseSensitivity(true) and then #ffDefault to build it as case-sensitive)
- ffNoCaseSens ///< perform a non-case-sensitive search (if the \c CZipArchive is case-sensitive,
- ///< a less effective search is performed); does not rebuild CZipCentralDir::m_findarray,
- ///< but if the array hasn't been built yet, it is build now as \b case-sensitive
- ///< (you can use \c SetCaseSensitivity(false) and then #ffDefault to build it as non-case-sensitive)
-
- };
-
-/**
- Find the file in the archive.
- If the archive wasn't opened with CZipCentralDir::m_bConvertAfterOpen set to \c true,
- this function automatically convert all the filenames with the function
- CZipCentralDir::ConvertAll and set CZipCentralDir::m_bConvertAfterOpen to \c true.
- This function requires \link CZipCentralDir::m_bFindFastEnabled FindFast \endlink
- feature enabled.
- \param lpszFileName
- the name of the file to be found in the archive; must be with path unless
- you set \e bFileNameOnly to \c true. Use path separators the same as they are for your system
- (\e "\" for Windows and \e "/" for Unix/Linux)
- \param iCaseSensitive can be one of #FFCaseSens values
- \param bFileNameOnly
- if \c true, the function tries to find a filename without a path (a less effective search is performed); if you wish to find
- a directory name, do not end it with the path separator, which is required if you set \e bFileName to \c false
- \return
- - the index of the file found
- - -1 if there is no such a file in the archive
- \see CZipCentralDir::FindFileNameIndex
- \see EnableFindFast
- \see CZipCentralDir::ConvertAll
- \see SetConvertAfterOpen
-*/
- int FindFile(LPCTSTR lpszFileName, int iCaseSensitive = ffDefault, bool bFileNameOnly = false);
-
-/**
- Get the info of the file with the given index.
- \param fhInfo
- the structure to receive info
- \param uIndex
- a zero-based index of the file inside the archive
- \return \c true if successful
-*/
- bool GetFileInfo(CZipFileHeader & fhInfo, WORD uIndex) const;
-
-
-/**
- \param bOnlyFiles
- if \c true, the directories are not inluded in a total count;
- default is \c false
- \return the number of files in the archive
-*/
- int GetCount(bool bOnlyFiles = false)const
- {
- int iTotalCount = m_centralDir.m_headers.GetSize();
- if (bOnlyFiles)
- {
- int iCount = 0;
- for (int i = 0; i < iTotalCount; i++)
- if (!m_centralDir.m_headers[i]->IsDirectory())
- iCount++;
- return iCount;
- }
- else
- return iTotalCount;
- }
-
- /**
- values used in #Close function as parameter \e iAfterException
- */
- enum CloseAfterException
- {
- afNoException, ///< normal close, no exception was thrown before by CZipArchive object
- afAfterException, ///< an exception has been thrown, don't write any data but perform necessary cleaning to reuse CZipArchive object for another archive
- afWriteDir ///< the same as above, but write the central directory end structure to the archive, so that we can save at least the files that have
- ///< been added properly and maybe try to repair the archive later
- };
-
-/**
- Close the archive.
- \param iAfterException
- one of #CloseAfterException enum values
- \param bUpdateTimeStamp
- if \c true, set the modification date of the zip file to the date of the newest file in the archive;
- in disk-spanning mode only the last archive file will have the time stamp updated;
- you can use this option even without performing any additional processing on the archive, just open and close it
- \note Throws exceptions if \e iAfterException is different from \c afAfterException
-*/
- void Close(int iAfterException = afNoException, bool bUpdateTimeStamp = false);
-
-
-/**
- Test if the archive is closed (a whole or the current volume only)
- \param bArchive
- - \c true: test for the whole archive
- - \c false: test for the volume file only
-
- \return \c true if closed
-*/
- bool IsClosed(bool bArchive = true)const ;
-
- /**
- Write the central directory to the archive and flushes the internal buffers to the disk,
- so that the archive is finalized on the disk, but you can still modify it. Use it after
- opening (or creating) and modifying the archive if you want to prevent the loss
- of the data you've compressed so far in case of the program crash.
- If you use it on a disk spanning archive in creation it will not be closed, but its state
- will be changed from "archive in creation" to "an existing span archive". Use it when you finish adding files to the disk-spanning archive and want to
- begin extracting or testing it. It follows that you can call it only once in this case. However, if
- after finalizing the disk spanning archive it turns out that it is one disk only, it is converted to
- a normal archive and you can use it as such. If you want to know what is the state of the archive after using
- this function call #GetSpanMode.
- \note
- - Cannot be used on existing disk spanning archives (they are not modifable anyway)
- - If you have an archive with a huge central directory, it'll influence the perfomance calling this function without a reason.
- - Throws exceptions.
- \see GetSpanMode
- \see SetAutoFlush
- \see GetAutoFlush
-
- */
- void Flush();
-
-
- /**
- Set the CZipArchive object to call #Flush after each operation that modifies the archive
- (adding a new file, deleting file(s), modifying the global or a file comment).
- It is useful when we want to prevent the loss of data in case of the program crash - the zip file will be then finalized on the disk.
- Use it after opening the archive.
- \note
- - You can set AutoFlush only for non-disk spanning archives, however you can call #Flush once for a disk-spanning archive in creation.
- - If you have an archive with a huge central directory, setting Auto-Flush will influence the performance.
- \see Flush
- \see GetAutoFlush
- */
- void SetAutoFlush(bool bAutoFlush = true);
-
-
- /**
- return the current #m_bAutoFlush value
- \see Flush
- \see SetAutoFlush
- */
- bool GetAutoFlush()const {return m_bAutoFlush;}
-
-/**
- Return the system compatibility of the current archive.
- System compatibility value for the single file in the archive
- (represented by CZipFileHeader) influences file attributes conversion
- (the file attributes are defined differently across the platforms).
- When opening an existing archive CZipArchive assumes the system compatibility
- of the whole archive to be the same as of the first file in the archive
- (if present). In other cases the current system value is assumed which is
- taken from ZipPlatform::GetSystemID during creating or opening an archive
- \remark
- If the existing archive during opening is empty, ZipPlatform::GetSystemID
- is assumed to be the default system for the files that will be added to the archive.
-
- \return
- one of the enum values defined in \link ZipCompatibility::ZipPlatforms
- ZipCompatibility.h \endlink
- \see ZipCompatibility::ZipPlatforms
- \see ZipPlatform::GetSystemID
- \see CZipFileHeader::GetSystemCompatibility
-*/
- int GetSystemCompatibility() const {return m_iArchiveSystCompatib;}
-
-/**
- Set the system compatibility of the archive. By default it is set to the
- current system value (the one returned by ZipPlatform::GetSystemID() function).
- Use it after opening the archive, but before adding a new file or using
- SetFileHeaderAttr() function
- \param iSystemComp
- can be one of ZipCompatibility::ZipPlatforms values
- \return
- return \c false if the value \e iSystemComp is not supported
- (ZipCompatibility::IsPlatformSupported returns \c false for the value)
- or it is not possible to set it right now
-*/
- bool SetSystemCompatibility(int iSystemComp);
-
-/**
- Set the attributes for CZipFileHeader structure to be used
- in #OpenNewFile method as an argument.
- This special procedure is taken, because the system compatibility must
- be set for CZipFileHeader prior to the value, which must be identical to
- the return value of #GetSystemCompatibility method.
- \param header
- the structure to have attributes set
- \param uAttr
- attributes to set
- \note Throws exceptions if the archive system or the current system
- is not supported by the ZipArchive library.
- \see GetSystemCompatibility
-*/
- void SetFileHeaderAttr(CZipFileHeader& header, DWORD uAttr);
-
-
-/**
- A helper for a various purposes (needed e.g. by the program that
- cracks the zip archives password)
- \return the pointer to the static CRC table in the zlib library
-
-*/
- static const DWORD* GetCRCTable()
- {
- return get_crc_table();
- }
-
-/**
- Return the underlying archive storage medium.
- \warning A method for a very advanced use - you normally never need it.
- \return the pointer to #m_storage
- \see CZipStorage
-*/
- CZipStorage* GetStorage(){return &m_storage;}
-
-
-/**
- Set #m_bDetectZlibMemoryLeaks value.
- \param bDetect
- \note Use before opening a file in the archive.
- \see m_bDetectZlibMemoryLeaks
-
-*/
-/*
- void SetDetectZlibMemoryLeaks(bool bDetect)
- {
- if (m_iFileOpened != nothing)
- {
- TRACE(_T("CZipArchive::SetDetectZlibMemoryLeaks: Set it before opening a file in the archive"));
- return;
- }
- m_bDetectZlibMemoryLeaks = bDetect;
-
- }
-*/
-/**
- Set CZipCentralDir::m_bConvertAfterOpen value.
- The default value is \c true.
- Setting this value to \c false is generally not effective and is intended
- only for quick and short operations on archives with lots of files inside
- (e.g. open archive, make an operation on a file which index you already know
- and close the archive - using #FindFile function already makes setting this
- value to \c false inefficient)
-
- \param bConvertAfterOpen
- \note Use before opening the archive.
- \see CZipCentralDir::m_bConvertAfterOpen
-*/
- void SetConvertAfterOpen (bool bConvertAfterOpen)
- {
- if (!IsClosed())
- {
- TRACE(_T("CZipArchive::SetConvertAfterOpen: Set it before opening the archive"));
- return;
- }
- m_centralDir.m_bConvertAfterOpen = bConvertAfterOpen;
-
- }
-
-/**
- Enable fast finding by the file name of the files inside the archive.
- Set CZipCentralDir::m_bFindFastEnabled to \c true, which is required by #FindFile.
- #FindFileIt is called by #FindFileif necessary. It builds CZipCentralDir::m_findarray
- with the default case-sensitivity (set with #SetCaseSensitivity)
- \note Call it only after opening the archive.
- \param bEnable
- \see CZipCentralDir::m_bFindFastEnabled
- \see FindFile
-*/
- void EnableFindFast(bool bEnable = true);
-
-
- /**
- After you enable FindFast feature with #EnableFindFast, you can retrieve
- how the files are sorted in CZipCentralDir::m_findarray (you can use it
- in your own program if you need to display the sorted list and do not want
- to duplicate data)
-
- \param iFindFastIndex
- index in CZipCentralDir::m_findarray (not necessary the same as the one you'd
- pass to #GetFileInfo); the number of items in this array is the same
- as the number of files in the archive (you can retrieve it with
- #GetCount)
-
- \return
- index of the file in central directory (now you can call #GetFileInfo to get
- the information); if the value is \c -1 then you have not called
- #EnableFindFast before or the archive is closed or the \e iFindFastIndex
- is out of range)
- */
- int GetFindFastIndex(int iFindFastIndex) const
- {
- if (IsClosed())
- {
- TRACE(_T("CZipArchive::GetFindFastIndex: ZipArchive not yet opened.\n"));
- return -1;
- }
-
- return m_centralDir.GetFindFastIndex(iFindFastIndex);
- }
-
-
- /**
- Set a temporary path used when compressing files and #zipsmCheckForEff
- is specified as an argument in #AddNewFile and the disk spanning archive
- is in creation.
- \param lpszPath set it to NULL to clear the temporary path and let the
- library figure it out (it uses the system temporary directory if possible)
- \param bForce if \e lpszPath is not \c NULL and this parameter set to \c true
- the directory is created if it doesn't exists (if the given directory
- does not exists , the temporary file will not be created)
- \see AddNewFile
- \see Smartness
- \see GetTempPath
- */
- void SetTempPath(LPCTSTR lpszPath = NULL, bool bForce = true);
-
-
-
- /**
- enum values used in #PredictFileNameInZip
- */
- enum Predict
- {
-
- prDir, ///< if an argument is a directory, add a separator at the end
- prFile, ///< treat the argument as a common file
- prAuto ///< treat the argument as a directory only if it has a path separator at the end
-
- };
-
- /**
- Given the file path in the form it would be passed to #AddNewFile
- as \e lpszFilePath argument, the function returns the file name
- as it would be stored in the archive.
- The function takes into account the root path set with #SetRootPath. You can use this function
- to eliminate duplicates before adding a list of files.
-
- \param lpszFilePath
- the file path as it would be passed to #AddNewFile function
- \param bFullPath
- the same as \e bFullPath in #AddNewFile
- \param iWhat
- one of #Predict values to treat \e lpszFilePath correctly
- \param bExactly
- if \c true, return the filename exactly as it would look inside the archive i.e. convert slash to backslash, and perform ANSI->OEM conversion;
- otherwise return the filename with the path separators that are used by default in the system
-
- \return a modified file path
- */
- CZipString PredictFileNameInZip(LPCTSTR lpszFilePath, bool bFullPath, int iWhat = prAuto, bool bExactly = false)const ;
-
- /**
- Check if the filename will be duplicted in the archive, if added to the archive in the given form
- \param bFileNameOnly
- if \c true, assume that the filename is duplicated if only the filename (no path) is the same (\e bFullPath is ignored), otherwise the whole filename with path is taken into account.
-
- \b Default: \c false
-
- The rest of the parameters have the same meaning as in #PredictFileNameInZip.
-
- \return the zero-based index of the file in the archive that the filename would be duplicated, or -1, if the filename is unique
- */
- int WillBeDuplicated(LPCTSTR lpszFilePath, bool bFullPath, bool bFileNameOnly = false, int iWhat = prAuto);
-
-
- /**
- Predict the full filename with path after extraction. The parameters (except for the first) are in the form you'd pass
- to the #ExtractFile(WORD , LPCTSTR , bool , LPCTSTR , DWORD ) function. The function takes into account the root path set with #SetRootPath.
- \param lpszFileNameInZip
- the filename of the file inside the archive (may be \c NULL if lpszNewName is not \c NULL)
- \param lpszPath
- \param bFullPath
- \param lpszNewName
- \return a predicted file path
- */
- CZipString PredictExtractedFileName(LPCTSTR lpszFileNameInZip, LPCTSTR lpszPath, bool bFullPath, LPCTSTR lpszNewName = NULL)const ;
-
- /**
-
- Return the current value of #m_szTempPath
-
- \return CZipString
- */
- CZipString GetTempPath()const
- {
- return m_szTempPath;
- }
-
-/**
- Function used in conjunction with #m_szRootPath to trim paths in #AddNewFile and #ExtractFile
- \param zpc
- \see SetRootPath
-
-*/
- CZipString TrimRootPath(CZipPathComponent& zpc)const ;
-
- /**
- Remove \e lpszBeginning from the beginning of the \e szPath. Both argument are
- considered to be paths so they matches up to the path separator.
-
- \param lpszBeginning
- \param szPath
- \param pCompareFunction (see: #m_pZipCompare)
-
-
- \return \c true if the path beginning was removed
- */
- static bool RemovePathBeginning(LPCTSTR lpszBeginning, CZipString& szPath, ZIPSTRINGCOMPARE pCompareFunction);
-
- /**
- Set the default archive case-sensitivity. Affects the following functions:
- - #FindFile
- - #FindMatches
- - #EnableFindFast
- - #TrimRootPath
- - #DeleteFiles
-
-
-
- \param bCaseSensitive
- the default CZipArchive case-sensitivity depends on the system and is set
- as follows:
- - on Windows: \c false
- - on Linux: \c true
- \note Set it before using one of the functions above or leave it as it is by default;
-
- */
-
- void SetCaseSensitivity(bool bCaseSensitive)
- {
- m_bCaseSensitive = bCaseSensitive;
- m_pZipCompare = GetCZipStrCompFunc(bCaseSensitive);
- }
-
- /**
- Return the central directory information.
- \see GetCentralDirSize
- */
- void GetCentralDirInfo(CZipCentralDir::Info& info)const;
-
-
- /**
- Get the central directory size.
- \see CZipCentralDir::GetSize
- \see GetCentralDirInfo
- */
- DWORD GetCentralDirSize(bool bWhole = true) const
- {
- return m_centralDir.GetSize(bWhole);
- }
-
- /**
- return \c true if the archive cannot be modified, because it is an existing disk spanning archive
- or it was opened with #zipOpenReadOnly
- */
- bool IsReadOnly(){return m_storage.IsReadOnly();}
-
-
- /**
-
- If you set \e bIgnore to \c true, CRC is not checked for the files being tested or extracted.
- This method is useful when working with Java TM Archives (jar).
- The CRC is checked by default. You can use this function on an opened or closed archive.
-
- */
- void SetIgnoreCRC(bool bIgnore = true){m_bIgnoreCRC = bIgnore;}
-
- /**
- A class used in wildcard pattern matching.
- This class is based on code by J. Kercheval, created 01/05/1991
- and available as a public domain at http://www.snippets.org.
- */
- class ZIP_API CWildcard
- {
- public:
-
-
- enum Match
- {
- matchNone, ///< for internal use
- matchValid, ///< valid match
- matchEnd, ///< premature end of pattern string
- matchAbort, ///< premature end of text string
- matchRange, ///< match failure on [..] construct
- matchLiteral, ///< match failure on literal match
- matchPattern ///< bad pattern
- };
-
- enum Pattern
- {
- patternEmpty = -4, ///< [..] construct is empty
- patternClose, ///< no end bracket in [..] construct
- patternRange, ///< malformed range in [..] construct
- patternEsc, ///< literal escape at end of pattern
- patternValid, ///< valid pattern
- };
-
-
- /**
- Match the pattern against the string \e lpszText
- A match means the entire string \e lpszText is used up in matching.
-
- \param lpszText
- the string to match against
- \param iRetCode
- if not \c NULL, set to one of #Match values indicating the return code
- \return \c true if \e lpszText matches the pattern.
- \see SetPattern
- */
- bool IsMatch(LPCTSTR lpszText, int* iRetCode = NULL);
-
- /**
-
- \param lpszPattern
-
- \return \c true if \e lpszPattern has any special wildcard characters.
-
- */
- static bool IsPattern(LPCTSTR lpszPattern);
-
- /**
- Test the pattern for validity.
-
- \param lpszPattern
- the pattern to test
- \param iErrorType
- if not \c NULL, set to one of #Pattern values indicating the return code
- \return \c true if \e lpszPattern is a well formed regular expression according
- to the CWildcard class syntax (see #SetPattern)
- */
- static bool IsPatternValid(LPCTSTR lpszPattern, int* iErrorType = NULL);
-
- /**
- Match the pattern \e lpszPattern against the string \e lpszText
- A match means the entire string \e lpszText is used up in matching.
-
-
- \param lpszPattern
- see #SetPattern
- \param lpszText
- the string to match against
- \return
- one of #Match values
- */
- static int Match(LPCTSTR lpszPattern, LPCTSTR lpszText);
-
- CWildcard(){}
- /**
- Initialize the pattern.
- \see SetPattern
- */
- CWildcard(LPCTSTR lpszPattern, bool bCaseSensitive)
- {
- SetPattern(lpszPattern, bCaseSensitive);
- }
- virtual ~CWildcard(){}
-
- /**
- Set the pattern to \e lpszPattern.
- \param lpszPattern
-
- In the pattern string:
- - * matches any sequence of characters(zero or more)
- - ? matches any character
- - [SET] matches any character in the specified set,
- - [!SET] or[^SET] matches any character not in the specified set.
-
- A set is composed of characters or ranges; a range looks like
- character hyphen character(as in 0 - 9 or A - Z).[0 - 9a - zA - Z_] is the
- minimal set of characters allowed in the[..] pattern construct.
- Other characters are allowed(ie. 8 bit characters) if your system
- will support them.
-
- \note To suppress the special syntactic significance of any of []*?!^-\,
- and match the character exactly, precede it with a \
- */
- void SetPattern(LPCTSTR lpszPattern, bool bCaseSensitive)
- {
- m_szPattern = lpszPattern;
- m_bCaseSensitive=bCaseSensitive;
- if (!bCaseSensitive)
- m_szPattern.MakeLower();
- }
- operator LPCTSTR()
- {
- return (LPCTSTR)m_szPattern;
- }
- protected:
- bool m_bCaseSensitive;
- static int MatchAfterStar(LPCTSTR p , LPCTSTR t);
- CZipString m_szPattern;
- };
-
-
- /**
- This function finds the indexes of the files, which filenames match the specified pattern and stores
- these indexes in the array. The indexes can be used then e.g. in deleting (CZipArchive::DeleteFiles) or
- extracting files (CZipArchive::ExtractFile).
-
- \param lpszPattern
- the pattern to match (see CWildcard::SetPattern on how to build the pattern). The case-sensitivity of the pattern
- is set to the global archive case-sensitivity (set with #SetCaseSensitivity)
- \param ar
- the array which will contain the indexes of the files which filenames match the pattern; the contents of the array are NOT clearead, but the
- indexes are appended to it
- \param bFullPath
- - if \c true, match the filename with path (if present) of the file (if the file is a directory, end it with the path separator or use a pattern that will recognize it)
- - otherwise match only the name of the file (if the file is a directory, do not end it with the path separator)
-
- */
- void FindMatches(LPCTSTR lpszPattern, CZipWordArray& ar, bool bFullPath = true)const;
-
-
- /**
- Change the name of the file with the given index.
-
- \param uIndex
- zero-based index of the file
- \param lpszNewName
- new name for the file
- \return
-
- \note Throws exceptions.
- \see SetAdvanced
- */
- bool RenameFile(WORD uIndex, LPCTSTR lpszNewName);
-
- /**
-
- If \c true, the drive letter is removed from the filename stored inside the archive when adding a new file to the archive. It affects
- #AddNewFile, #ExtractFile, #PredictFileNameInZip, #PredictExtractedFileName, #WillBeDuplicated methods.
-
- \b Default: \c true
- */
- bool m_bRemoveDriveLetter;
-
-protected:
-
- /**
- \param iReplaceIndex index of file to be replaced
- \param uTotal the size of the new file to replace existing
- \param lpszFileName the filename for callback initialization
- */
- void MakeSpaceForReplace(int iReplaceIndex, DWORD uTotal, LPCTSTR lpszFileName);
- /**
- A structure for the internal use only. Clears the password if necessary and
- restores it later (also in case of an exception).
- */
- struct ZIP_API CZipSmClrPass
- {
- void ClearPasswordSmartly(CZipArchive* pZip)
- {
- m_pZip = pZip;
- m_szPass = pZip->GetPassword();
- if (!m_szPass.IsEmpty())
- pZip->SetPassword();
- }
- ~CZipSmClrPass()
- {
- if (!m_szPass.IsEmpty())
- m_pZip->SetPassword(m_szPass);
- }
- CZipString m_szPass;
- CZipArchive* m_pZip;
- };
-
- /**
- Holds map of holes and areas to remain when deleting files from the archive.
- A structure for the internal use only.
- */
- struct ZIP_API CZipDeleteInfo
- {
- CZipDeleteInfo(){m_pHeader = NULL; m_bDelete = false;}
- CZipDeleteInfo(CZipFileHeader* pHeader, bool bDelete)
- :m_pHeader(pHeader), m_bDelete (bDelete){}
- CZipFileHeader* m_pHeader;
- bool m_bDelete;
- };
-
-
- /**
- Storage for callback functors. A structure for the internal use only.
- \see SetCallback
- */
- struct ZIP_API CZipClbckStrg : public CZipMap
- {
- void Set(CZipActionCallback* pCallback, CallbackType iType)
- {
- if (pCallback)
- {
- SetAt(iType, pCallback);
- }
- else
- RemoveKey(iType);
- }
- CZipActionCallback* Get(CallbackType iType)
- {
- CZipActionCallback* pCallback = NULL;
- if (Lookup(iType, pCallback))
- {
- pCallback->m_iType = iType;
- return pCallback;
- }
- else
- return NULL;
- }
-
- };
-
-
- /**
- \see CZipClbckStrg
- */
- CZipClbckStrg m_callbacks;
-
-
- /**
- Write central directory calling a callback functor if available
- */
- void WriteCentralDirectory(bool bFlush = true);
-
- /**
- Default archive case-sensitivity
- \see SetCaseSensitivity
- */
- bool m_bCaseSensitive;
-
- /**
- a pointer to the function in CZipString structure,
- used to compare elements; can point to Compare, CompareNoCase,
- Collate or CollateNoCase function address in CZipString structure ZIPSTRINGCOMPARE is defined as follows:
- typedef int (CZipString::*ZIPSTRINGCOMPARE)( LPCTSTR ) const;
- */
- ZIPSTRINGCOMPARE m_pZipCompare;
-
- /**
- Internal data.
- \see CZipInternalInfo
- */
- CZipInternalInfo m_info;
-
-
- /**
- Physical layer of the archive.
- \see CZipStorage
- */
- CZipStorage m_storage;
-
- /**
- A central directory object.
- \see CZipCentralDir
- */
- CZipCentralDir m_centralDir;
-
- /**
- The open mode of the current file inside archive.
- */
- enum OpenFileType
- {
- extract = -1, ///< current file opened for extraction
- nothing, ///< no file inside archive opened
- compress ///< a new file opened for compression
- };
-
- /**
- Takes one of the #OpenFileType enum values.
- */
- char m_iFileOpened;
-
- /**
- The current AutoFlush value.
- \see Flush
- \see SetAutoFlush
- \see GetAutoFlush
- */
- bool m_bAutoFlush;
-
- /**
- The value set with #SetIgnoreCRC
- */
- bool m_bIgnoreCRC;
-
-
-
-/**
- The root path to be omitted in #AddNewFile and #ExtractFile functions
- from the beginning of the full file path. Set by #SetRootPath
- \see TrimRootPath
- \see SetRootPath
-*/
- CZipString m_szRootPath;
-
- /**
- A temporary path set with #SetTempPath function
- \see SetTempPath
- \see AddNewFile
- \see Smartness
- */
- CZipString m_szTempPath;
-
-/**
- Open the archive in the given mode.
- Called by #Open(LPCTSTR, int, int) and #Open(CZipMemFile&, int).
- \param iMode
- an opening mode
- \note Throws exceptions.
-*/
- void OpenInternal(int iMode);
-
- /**
- The system code of the current archive. All new files in the archive
- will be created regarding this value. Can be one of the enum values
- defined in \link ZipCompatibility::ZipPlatforms ZipCompatibility.h
- \endlink
-
- \see GetSystemCompatibility
- */
- int m_iArchiveSystCompatib;
-
-/**
- Free the memory allocated by the zlib library that hasn't been freed
- due to an error in the zlib library (usually never happens).
-*/
- void EmptyPtrList();
-
-
-
-/**
- Move the range of data in the archive specified by the \e uStartOffset
- and \e uEndOffset by \e uToMove
-
-*/
- void MovePackedFiles(DWORD uStartOffset, DWORD uEndOffset, DWORD uMoveBy, CZipActionCallback* pCallback, bool bForward = false);
-
- /**
- Remove recently added file (used by AddNewFile) if compressed is larger than uncompressed or if callback method return \c false.
- \param bRemoveAnyway if \c true, do not check for the efficiency, but remove the file
-
- */
- bool RemoveLast(bool bRemoveAnyway = false);
-
- /**
- It is used in GetFromArchive public functions and in AddNewFile and the callback parameter is needed
- */
- bool GetFromArchive(CZipArchive& zip, WORD uIndex, int iReplaceIndex, bool bKeepSystComp, CZipActionCallback* pCallback);
-
- /**
- \return whether the code should continue or not
- */
- bool UpdateReplaceIndex(int& iReplaceIndex, LPCTSTR lpszNewFileName);
-
-/**
- \return the currently opened for compression or decompression
- file inside the archive NULL if there is no file opened
-*/
- CZipFileHeader* CurrentFile();
-
-/**
- If the parameter \e iErr signalizes a zlib library error, throw CZipException
- \param iErr
- a zlib library error to check
- \note Throws exceptions.
-*/
- void CheckForError(int iErr);
-
-
-/**
- Throw a CZipException error.
- \param err
- the error code
- \see CZipException::ZipErrors
- \param bZlib
- if \c true, treat \e err as a zlib error code and perform the conversion to the one of CZipException codes.
- \see CZipException::Throw
-*/
- void ThrowError(int err, bool bZlib = false);
-
-
- typedef CZipPtrList::iterator CZipPtrListIter;
- CZipPtrList m_list; ///< a list holding pointers to the memory areas allocated by the zlib library
-
-
- static void* _zliballoc(void* opaque, UINT items, UINT size); ///< memory allocator called by the zlib library
- static void _zlibfree(void* opaque, void* address); ///< memory deallocator called by the zlib library
-
-
- /**
- Specify whether to control memory allocation and freeing by the zlib library.
-
- \b Default: \c true
- \note Set it before opening a file (new or existing) in the archive.
- \see SetDetectZlibMemoryLeaks
-
- */
-// bool m_bDetectZlibMemoryLeaks;
-
-
- /**
- Copyright string.
- */
- static const TCHAR m_gszCopyright[];
-
-/**
- \defgroup Cryptography Cryptography
- Methods performing data encryption and decryption
- and attributes used by them.
-*/
- /*@{*/
-
-/**
- Decode \e uCount bytes from the internal buffer.
- \see m_info
- \see CZipInternalInfo::m_pBuffer
-
-*/
- void CryptDecodeBuffer(DWORD uCount);
-/**
- Encode the internal buffer.
- \see m_info
- \see CZipInternalInfo::m_pBuffer
-*/
- void CryptEncodeBuffer();
-
-/**
- Encode the character \e c and update \link #m_keys encryption keys \endlink.
-
-*/
- void CryptEncode(char &c);
-/**
- Create an encryption header for the new file in the archive.
- \param iCrc
- A control value. Use the two lower bytes of CZipFileHeader::m_uModTime.
- This entails the need for a data description presence at the end of
- the compressed data. We cannot use the real CRC now, because we don't know
- it yet.
- \param buf
- a buffer to receive the header
- \see CryptCheck
-*/
- void CryptCryptHeader(long iCrc, CZipAutoBuffer& buf);
-/**
- \internal
- \return
-*/
- DWORD CryptCRC32(DWORD l, char c);
-/**
- Decode the character \e c and update \link #m_keys encryption keys \endlink.
-*/
- void CryptDecode(char &c);
- /**
- \internal
- */
- char CryptDecryptByte();
-
-/**
- Decrypt the encryption header and check its control value.
- The control value depends on the presence of the data descriptor.
- \return \c true if the control value is correct
- \see CryptCryptHeader
-*/
- bool CryptCheck();
-/**
- Update \link #m_keys encryption keys \endlink with the given value.
-*/
- void CryptUpdateKeys(char c);
-/**
- Initialize \link #m_keys encryption keys \endlink.
-*/
- void CryptInitKeys();
- /**
- The archive password. If empty, the new file will not be encrypted.
- */
- CZipAutoBuffer m_pszPassword;
-
- /**
- Encryption keys.
- The key values are initialized using a supplied encryption password.
- \see CryptInitKeys
- */
- DWORD m_keys[3];
-
- /*@}*/
-};
-
-
-
-#endif // !defined(AFX_ZIPARCHIVE_H__A7F528A6_1872_4071_BE66_D56CC2DDE0E6__INCLUDED_)
diff --git a/harbour/contrib/hbzlib/include/zipautobuffer.h b/harbour/contrib/hbzlib/include/zipautobuffer.h
deleted file mode 100644
index 533f7c1328..0000000000
--- a/harbour/contrib/hbzlib/include/zipautobuffer.h
+++ /dev/null
@@ -1,79 +0,0 @@
-///////////////////////////////////////////////////////////////////////////////
-// $Workfile: ZipAutoBuffer.h $
-// $Archive: /ZipArchive/ZipAutoBuffer.h $
-// $Date$ $Author$
-////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// For the licensing details see the file License.txt
-////////////////////////////////////////////////////////////////////////////////
-
-/**
-* \file ZipAutoBuffer.h
-* Interface for the CZipAutoBuffer class.
-*
-*/
-
-#if !defined(AFX_ZIPAUTOBUFFER_H__DEC28C20_83FE_11D3_B7C3_EDEC47A8A86C__INCLUDED_)
-#define AFX_ZIPAUTOBUFFER_H__DEC28C20_83FE_11D3_B7C3_EDEC47A8A86C__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#include "ZipExport.h"
-/**
- A smart buffer freeing its contents on destruction.
-*/
-class ZIP_API CZipAutoBuffer
-{
-public:
- operator char*()
- {
- return m_pBuffer;
- }
-#ifndef __BORLANDC__
- operator const char*() const // Borland seems to have problems with this
- {
- return m_pBuffer;
- }
-#endif
-
-
-
-
-
- // may produce ambiguity on some compilers
-// operator const char*() const
-// {
-// return m_pBuffer;
-// }
- const char* GetBuffer() const {return m_pBuffer;}
- char* Allocate(DWORD iSize, bool bZeroMemory = false);
- void Release();
- DWORD GetSize() const
- {
- return m_iSize;
- }
- bool IsAllocated() const
- {
- return (m_pBuffer != NULL);
- }
- CZipAutoBuffer(DWORD iSize, bool bZeroMemory = false);
- CZipAutoBuffer();
- CZipAutoBuffer(const CZipAutoBuffer& buffer);
- virtual ~CZipAutoBuffer();
- CZipAutoBuffer& operator=(const CZipAutoBuffer& buffer);
-protected:
- char* m_pBuffer;
- DWORD m_iSize;
-};
-
-#endif // !defined(AFX_ZIPAUTOBUFFER_H__DEC28C20_83FE_11D3_B7C3_EDEC47A8A86C__INCLUDED_)
-
\ No newline at end of file
diff --git a/harbour/contrib/hbzlib/include/zipbaseexception.h b/harbour/contrib/hbzlib/include/zipbaseexception.h
deleted file mode 100644
index 6eb4b00719..0000000000
--- a/harbour/contrib/hbzlib/include/zipbaseexception.h
+++ /dev/null
@@ -1,22 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-// $Workfile: ZipBaseException.h $
-// $Archive: /ZipArchive_STL/ZipBaseException.h $
-// $Date$ $Author$
-////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// For the licensing details see the file License.txt
-////////////////////////////////////////////////////////////////////////////////
-
-#ifndef __ZIPBASEEXCEPTION_H__
-#define __ZIPBASEEXCEPTION_H__
-
-typedef std::exception CZipBaseException;
-
-#endif //__ZIPBASEEXCEPTION_H__
diff --git a/harbour/contrib/hbzlib/include/zipcentraldir.h b/harbour/contrib/hbzlib/include/zipcentraldir.h
deleted file mode 100644
index c7c6132ec2..0000000000
--- a/harbour/contrib/hbzlib/include/zipcentraldir.h
+++ /dev/null
@@ -1,554 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-// $Workfile: ZipCentralDir.h $
-// $Archive: /ZipArchive/ZipCentralDir.h $
-// $Date$ $Author$
-////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// For the licensing details see the file License.txt
-////////////////////////////////////////////////////////////////////////////////
-
-/**
-* \file ZipCentralDir.h
-* Interface for the CZipCentralDir class.
-*
-*/
-
-#if !defined(AFX_CENTRALDIR_H__859029E8_8927_4717_9D4B_E26E5DA12BAE__INCLUDED_)
-#define AFX_CENTRALDIR_H__859029E8_8927_4717_9D4B_E26E5DA12BAE__INCLUDED_
-
-#if _MSC_VER > 1000
-#pragma once
-#endif // _MSC_VER > 1000
-
-#if (_MSC_VER > 1000) && (defined ZIP_HAS_DLL)
- #pragma warning( disable : 4251 ) // needs to have dll-interface to be used by clients of class
-#endif
-
-#include "zipexception.h"
-#include "zipfileheader.h"
-#include "zipautobuffer.h"
-#include "zipcollections.h"
-#include "zipcompatibility.h"
-#include "ZipExport.h"
-#define ZIPARCHIVE_DATADESCRIPTOR_LEN 12
-
-/**
- A class representing the central directory record in the archive.
-*/
-class ZIP_API CZipCentralDir
-{
-public:
- /**
- Used in fast finding files by the filename.
- A structure for the internal use only.
- \see CZipCentralDir::m_findarray
- \see CZipArchive::GetFindFastElement
- \see CZipArchive::FindFile
- \see CZipArchive::EnableFindFast
- */
- struct ZIP_API CZipFindFast
- {
- CZipFindFast()
- {
- m_uIndex = 0;
- m_pHeader= NULL;
- }
- CZipFindFast(CZipFileHeader* pHeader, WORD uIndex):m_pHeader(pHeader), m_uIndex(uIndex){}
- /**
- A pointer to the structure in CZipCentralDir. We extract a name from it.
- */
- CZipFileHeader* m_pHeader;
-
- /**
- The index in the central directory of the \e m_pHeader.
- */
- WORD m_uIndex;
- };
-
-
- /**
- Stores general information about the central directory record.
- */
- struct ZIP_API Info
- {
- DWORD m_uCentrDirPos; ///< the position of the beginning of the central directory (as located by #Locate)
- DWORD m_uBytesBeforeZip;///< The number of bytes before the actual zip archive in a file. It is non-zero for self-extracting archives.
- WORD m_uThisDisk; ///< number of the disk with the central directory end record (the number of disks in the disk-spanning archive)
- WORD m_uDiskWithCD; ///< number of the disk with the start of the central directory
- WORD m_uDiskEntriesNo; ///< total number of entries in the central dir on this disk
- WORD m_uEntriesNumber; ///< total number of entries in the central dir
- DWORD m_uSize; ///< size of the central directory (valid only if #m_bOnDisk is \c true; use #GetSize instead)
- DWORD m_uOffset; ///< offset of start of central directory with respect to the starting disk number
- ///< (as written in the central directory record);
- ///< valid only if #m_bOnDisk is \c true
- bool m_bOnDisk; ///< \c true if the central directory is physically present in the archive
-#if !defined(__GNUC__)
- protected:
- friend CZipCentralDir;
-#endif
-
- bool CheckIfOK_1()
- {
- return ((DWORD)m_uCentrDirPos >= m_uOffset + m_uSize);
- }
- void SetBytesBeforeZip(bool bIsSpan)
- {
- m_uBytesBeforeZip = bIsSpan ? 0 : m_uCentrDirPos - m_uSize - m_uOffset;
- }
- bool CheckIfOK_2()
- {
- return (m_uSize || !m_uEntriesNumber) && (m_uEntriesNumber || !m_uSize);
- }
- void DiskChange(int iCurrentDisk)
- {
- m_uThisDisk = (WORD)iCurrentDisk;
- if (m_uEntriesNumber)
- {
- m_uDiskEntriesNo = 0;
- }
- else
- {
- m_uDiskWithCD = m_uThisDisk;
- m_uOffset = 0;
- }
- }
- };
-
- CZipCentralDir();
- virtual ~CZipCentralDir();
-
- static char m_gszSignature[]; ///< central dir signature
-
- char m_szSignature[4]; ///< end of central dir signature (must be 0x06054b50)
-
- CZipAutoBuffer m_pszComment; ///< the archive comment
- CZipAutoBuffer m_pLocalExtraField; ///< a local extra field
- CZipFileHeader* m_pOpenedFile; ///< points to a currently opened file or NULL if no file is opened
-
- /**
- Called by CZipArchive::OpenInternal.
- */
- void Init();
-
- /**
- Read the central directory from the archive.
- \note Throws exceptions.
- */
- void Read();
-
- /**
- Open the file.
- \param uIndex
- zero-based index of the file to open
- \note Throws exceptions.
- */
- void OpenFile(WORD uIndex);
-
-/**
- Test if the given file header index is valid.
- \param uIndex
- a zero-based index
- \return \c true if the file with the given index exists inside the archive; otherwise \c false;
-*/
- bool IsValidIndex(int uIndex)const;
-
-/**
- Remove the file header from the central directory.
- \param pHeader
- the header to remove
- \param iIndex if index is not known set it to -1
- \param bShift
- \note Throws exceptions.
-*/
- void RemoveFile(CZipFileHeader* pHeader, int iIndex = -1, bool bShift = true);
-
-
- /**
- Remove last file from the central directory.
-
- */
- void RemoveLastFile(CZipFileHeader* pHeader = NULL, int iIndex = -1)
- {
- if (iIndex == -1)
- {
- iIndex = m_headers.GetSize() - 1;
- if (iIndex == -1)
- return;
- }
- if (!pHeader)
- pHeader = m_headers[iIndex];
- DWORD uNewSize = pHeader->m_uOffset + GetBytesBefore();
- // then remove
- RemoveFile(pHeader, iIndex);
-
- m_pStorage->Flush();
- m_pStorage->m_pFile->SetLength(uNewSize);
- m_info.m_bOnDisk = false; // it is true when AutoFlush is set to true
- }
-
-
- /**
- Remove all files
- \note Throws exceptions.
- */
- void RemoveAll();
-/**
- Cleanup the structure.
- \param bEverything
- - \c true - clear some attributes and remove all the file headers from memory
- - \c false - do not remove the file headers. It is called in that manner
- from CZipArchive::CloseFileAfterTestFailed so that the
- next file can be tested for the integrity
- \see CZipArchive::CloseFileAfterTestFailed
-*/
- void Clear(bool bEverything = true);
-
-/**
- Add a new file to the central directory.
- \param header
- copy data from it to the new file header
- \param iReplaceIndex if different from -1, the index of the file to be replaced
- \return the pointer to the new header
- \note Throws exceptions.
-*/
- CZipFileHeader* AddNewFile(const CZipFileHeader & header, int iReplaceIndex = -1);
-
- /**
- return the header filename, converted if needed
- */
- CZipString GetProperHeaderFileName(const CZipFileHeader* pHeader) const
- {
- if (!m_bConvertAfterOpen)
- {
- CZipFileHeader fh = *pHeader;
- ConvertFileName(true, false, &fh);
- return fh.GetFileName();
- }
- else
- return pHeader->GetFileName();
- }
-
-/**
- Remove physically the central directory from the archive.
- Called during adding or deleting files.
- \note Throws exceptions.
-*/
- void RemoveFromDisk();
-
-/**
- Get the central directory size.
- \param bWhole
- if \c true, include the size of the file headers
- \return the size of the central directory
- \see CZipArchive::GetCentralDirSize
-*/
- DWORD GetSize(bool bWhole = false) const;
-
- /**
- Close a file inside archive opened for reading.
- \param bAfterException \c true if closing after exception
- \note Throws exceptions.
- */
- void CloseFile(bool bAfterException = false);
-
- /**
- Close a file inside archive opened for reading.
- \note Throws exceptions.
- */
- void CloseNewFile();
-
- /**
- Write the central directory to the archive.
- \note Throws exceptions.
- */
- void Write(CZipActionCallback* pCallback);
-
- /**
- \see CZipArchive::EnableFindFast
- */
- void EnableFindFast(bool bEnable, bool bCaseSensitive);
-
- /**
- \see CZipArchive::FindFile
- \note \e bSporadically set to \c false rebuilds #m_findarray if necessary
- */
- int FindFile(LPCTSTR lpszFileName, bool bCaseSensitive, bool bSporadically, bool bFileNameOnly);
-
-
- /**
- \see CZipArchive::GetFindFastIndex
- */
- int GetFindFastIndex(int iFindFastIndex)const
- {
- if (!IsValidIndex(iFindFastIndex) || !m_bFindFastEnabled)
- {
- // ASSERT(FALSE); //
- return -1;
- }
-
- return m_findarray[iFindFastIndex].m_uIndex;
- }
-
- /**
- Points to CZipArchive::m_storage.
- */
- CZipStorage* m_pStorage;
-
-
- /**
- The size of the buffer used in searching for the central dir.
- Set before opening the archive.
- It is usually set with CZipArchive::SetAdvanced
- (specify this value as the third argument).
- \see CZipArchive::SetAdvanced
- */
- int m_iBufferSize;
-
-
-
-
- /**
- Holds all the files inside archive info.
- \see CZipFileHeader
- */
- CZipArray m_headers;
-
- CZipFileHeader* operator[](int iIndex)
- {
- return m_headers[iIndex];
- }
- const CZipFileHeader* operator[](int iIndex) const
- {
- return m_headers[iIndex];
- }
-
-
- /**
- - If \c true, the conversion of the filenames takes
- place after opening the archive (after reading the central directory
- from the file), and before writing the central directory back to
- the archive.
- - If \c false, the conversion takes place on each call to CZipArchive::GetFileInfo
-
- Change is value with CZipArchive::SetConvertAfterOpen.
-
- Set it to \c true when you plan to use CZipArchive::FindFile or get the stored files information.
- Set it to \c false when you plan mostly to modify the archive.
-
- \b Default: \c true
- \note Set it before opening the archive.
- \see CZipArchive::SetConvertAfterOpen
- \see ConvertFileName
- */
- bool m_bConvertAfterOpen;
-
-
-/**
- Convert the filename of the CZipFileHeader depending on the current system
- and the system the zip file was created on (change slash to backslash or
- vice versa, perform ANSI-OEM conversion if necessary).
- \param bFromZip
- if \c true, convert from archive format
- \param bAfterOpen
- if \c true, called after opening the archive or before closing
- \param pHeader
- the header to have filename converted; if \c NULL convert the currently
- opened file
- \see ZipCompatibility::FileNameUpdate
- \see m_bConvertAfterOpen
-*/
- void ConvertFileName(bool bFromZip, bool bAfterOpen, CZipFileHeader* pHeader = NULL) const
- {
- if (bAfterOpen != m_bConvertAfterOpen)
- return;
- if (!pHeader)
- {
- pHeader = m_pOpenedFile;
- ASSERT(pHeader);
- }
- ZipCompatibility::FileNameUpdate(*pHeader, bFromZip);
- }
-
-/**
- Convert all the filenames to the system form.
- Called by CZipArchive::FindFile
- \see CZipArchive::FindFile
-*/
- void ConvertAll();
-
-/**
- \param lpszFileName
- the name of the file to find, must be exactly the same (apart from case)
- as it appears in the archive
- \return the index in #m_findarray with the appropriate CZipFindFast structure
- or \c -1 if there is no file with the given name
- \see CZipArchive::FindFile
-*/
- int FindFileNameIndex(LPCTSTR lpszFileName) const;
-
- DWORD GetBytesBefore() const {return m_info.m_uBytesBeforeZip;}
- /**
- Get the information about the central directory
- */
- void GetInfo(Info& info) const {info = m_info;}
- /**
- \return the value of m_bFindFastEnabled
- */
- bool IsFindFastEnabled(){return m_bFindFastEnabled;}
- /**
- Called by CZipArchive::RenameFile
- */
- void RenameFile(WORD uIndex, LPCTSTR lpszNewName);
-protected:
- /**
- Sort the files inside the archive headers by the order in the archive.
- */
- void SortHeaders();
- static int CompareHeaders(const void *pArg1, const void *pArg2)
- {
- CZipFileHeader* pw1 = *(CZipFileHeader**)pArg1;
- CZipFileHeader* pw2 = *(CZipFileHeader**)pArg2;
- if ((pw1->m_uOffset < pw2->m_uOffset && pw1->m_uDiskStart == pw2->m_uDiskStart)
- || (pw1->m_uDiskStart < pw2->m_uDiskStart))
- return -1;
- else if ((pw1->m_uOffset > pw2->m_uOffset && pw1->m_uDiskStart == pw2->m_uDiskStart)
- || (pw1->m_uDiskStart > pw2->m_uDiskStart))
- return 1;
- else
- {
- ASSERT(FALSE);
- // two files with the same offsets on the same disk???
- CZipException::Throw(CZipException::badZipFile);
- return 0; // just for the compiler comfort
- }
- }
-
-
-/**
- Build #m_findarray.
-*/
- void BuildFindFastArray( bool bCaseSensitive );
-
- /**
- Used in fast finding files by the filename.
- \see CZipFindFast
- \see m_bFindFastEnabled
- \see CZipArchive::FindFile
- */
- CZipArray m_findarray;
-
- /**
- If \c true, the there is an additional array build, to speed up the
- finding process
- CZipArchive::FindFile uses this array to perform a
- binary search.
- \b Default: \c false
- \see CZipArchive::EnableFindFast
- \see CZipArchive::FindFile
- \see CZipCentralDir::m_findarray
- */
- bool m_bFindFastEnabled;
-
-
-
-/**
- The \e lpszFileName and \e bCaseSensitive arguments
- are the same as in the #FindFileNameIndex. The function get CZipFindFast
- structure pointed by \e uIndex and compares the filename of CZipFileHeader
- class stored in this structure with \e lpszFileName.
- \param lpszFileName
- \param uIndex
- the index from #m_findarray
- \return
- - 0 if the filenames are the same
- - < 0 if the filename stored in the array is less than \e lpszFileName
- - > 0 if the filename stored in the array is greater than \e lpszFileName
-*/
- int CompareElement(LPCTSTR lpszFileName, WORD uIndex) const
- {
- return (m_findarray[uIndex].m_pHeader->GetFileName().*m_pCompare)(lpszFileName);
- }
-/**
- Insert a new CZipFindFast element to the #m_findarray.
- Initialize CZipFindFast object with \e pHeader and \e uIndex values.
-*/
- void InsertFindFastElement(CZipFileHeader* pHeader, WORD uIndex);
-
-
-
- /**
- A compare function (Collate or CollateNoCase) set once so as not
- to check every time which one to use
- ZIPSTRINGCOMPARE is defined in CZipString.h as:
- typedef int (CZipString::*ZIPSTRINGCOMPARE)( LPCTSTR ) const;
- */
- ZIPSTRINGCOMPARE m_pCompare;
-
- /**
- The way the m_findarray is sorted
- */
- bool m_bCaseSensitive;
-
- /**
- \see Info
- */
- Info m_info;
-
- /**
- \return the location of the beginning of the central dir end record in the archive
- \note Throws exceptions.
- */
- DWORD Locate();
- /**
- Read the file headers from the file.
- \note Throws exceptions.
- */
- void ReadHeaders();
-
- /**
- Free the memory allocated for the CZipFileHeader structures.
- */
- void RemoveHeaders();
-/**
- Remove data descriptors from the write buffer in the disk spanning volume
- that turned out to be one-disk only.
- We do not remove them from password encrypted files.
-
- \param bFromBuffer
- if \c true, remove from the buffer in memory otherwise from the file on a disk
- \return \c false if the file mapping to memory was not successful
- Can happen only when \e bFormBuffer is \c false.
- \note Throws exceptions.
-*/
- bool RemoveDataDescr(bool bFromBuffer);
-/**
- Write the file headers to the archive.
- \note Throws exceptions.
-*/
- void WriteHeaders(CZipActionCallback* pCallback, bool bOneDisk);
-/**
- Write the central directory end record.
- \return the size of the record
- \note Throws exceptions.
-*/
- DWORD WriteCentralEnd();
-
-/**
- Throw an exception with the given code.
- \param err
- \see CZipException::Throw
-*/
- void ThrowError(int err) const;
-
-
-};
-
-
-#endif // !defined(AFX_CENTRALDIR_H__859029E8_8927_4717_9D4B_E26E5DA12BAE__INCLUDED_)
diff --git a/harbour/contrib/hbzlib/include/zipcollections.h b/harbour/contrib/hbzlib/include/zipcollections.h
deleted file mode 100644
index 002d3d9cf4..0000000000
--- a/harbour/contrib/hbzlib/include/zipcollections.h
+++ /dev/null
@@ -1,180 +0,0 @@
-////////////////////////////////////////////////////////////////////////////////
-// $Workfile: ZipCollections.h $
-// $Archive: /ZipArchive_STL/ZipCollections.h $
-// $Date$ $Author$
-////////////////////////////////////////////////////////////////////////////////
-// This source file is part of the ZipArchive library source distribution and
-// is Copyright 2000-2003 by Tadeusz Dracz (http://www.artpol-software.com/)
-//
-// This program is free software; you can redistribute it and/or
-// modify it under the terms of the GNU General Public License
-// as published by the Free Software Foundation; either version 2
-// of the License, or (at your option) any later version.
-//
-// For the licensing details see the file License.txt
-////////////////////////////////////////////////////////////////////////////////
-
-#ifndef ZIPCOLLECTIONS_DOT_H
-#define ZIPCOLLECTIONS_DOT_H
-
-#if _MSC_VER > 1000
- #pragma warning( push, 3 ) // STL "requirements"
- #pragma warning (disable : 4284) //return type for 'identifier::operator >' is not a UDT or reference to a UDT. Will produce errors if applied using infix notation
- #pragma warning (disable : 4018) //'expression' : signed/unsigned mismatch
-#endif
-
-#include
-#include
-#include