2008-06-23 14:08 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
- hbziparch/make_b32_dll.bat
- hbziparch/make_b32_dll.mak
- hbziparch/doc
* hbziparch/Makefile
* hbziparch/common.mak
* hbziparch/hbziparc.c
* hbziparch/hbziparc.h
- hbziparch/zipcomp.cpp
+ hbziparch/hbzipcom.cpp
- hbziparch/zipnew.cpp
+ hbziparch/hbzipnew.cpp
- Docs integrated into source.
- Removed .dll building batch files (highly redundant,
non-maintained and probably non-working), so now the make
system is fully standard. If .dll generation is that
important, we will have to add it to the central
contrib make files, so that we can use it for
all contribs.
* Renamed some files so separate ZipArch and Harbour parts.
* Cleanups, renames (statics, globals), warning fixes,
deleted unneeded stuff, some functions made static.
; This is still a mess.
; NOTE: Since there is no sample or test program, neither
do I use this contrib, I couldn't test any of these
changes. Please test.
(if you have test code, upload it to hbziparch/tests)
This commit is contained in:
@@ -8,6 +8,34 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2008-06-23 14:08 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
- hbziparch/make_b32_dll.bat
|
||||
- hbziparch/make_b32_dll.mak
|
||||
- hbziparch/doc
|
||||
* hbziparch/Makefile
|
||||
* hbziparch/common.mak
|
||||
* hbziparch/hbziparc.c
|
||||
* hbziparch/hbziparc.h
|
||||
- hbziparch/zipcomp.cpp
|
||||
+ hbziparch/hbzipcom.cpp
|
||||
- hbziparch/zipnew.cpp
|
||||
+ hbziparch/hbzipnew.cpp
|
||||
- Docs integrated into source.
|
||||
- Removed .dll building batch files (highly redundant,
|
||||
non-maintained and probably non-working), so now the make
|
||||
system is fully standard. If .dll generation is that
|
||||
important, we will have to add it to the central
|
||||
contrib make files, so that we can use it for
|
||||
all contribs.
|
||||
* Renamed some files so separate ZipArch and Harbour parts.
|
||||
* Cleanups, renames (statics, globals), warning fixes,
|
||||
deleted unneeded stuff, some functions made static.
|
||||
; This is still a mess.
|
||||
; NOTE: Since there is no sample or test program, neither
|
||||
do I use this contrib, I couldn't test any of these
|
||||
changes. Please test.
|
||||
(if you have test code, upload it to hbziparch/tests)
|
||||
|
||||
2008-06-23 10:45 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* contrib/hbziparch/make_b32_dll.mak
|
||||
* contrib/hbziparch/make_b32.bat
|
||||
|
||||
@@ -11,17 +11,18 @@ C_SOURCES = \
|
||||
hbcomprs.c \
|
||||
|
||||
CPP_SOURCES = \
|
||||
hbzipnew.cpp \
|
||||
hbzipcom.cpp \
|
||||
/
|
||||
stdafx.cpp \
|
||||
ziparchive.cpp \
|
||||
zipautobuffer.cpp \
|
||||
zipcentraldir.cpp \
|
||||
zipcomp.cpp \
|
||||
zipcompatibility.cpp \
|
||||
zipexception.cpp \
|
||||
zipfile.cpp \
|
||||
zipfileheader.cpp \
|
||||
zipmemfile.cpp \
|
||||
zipnew.cpp \
|
||||
zipplatformcomm.cpp \
|
||||
zipstorage.cpp \
|
||||
ZipString.cpp
|
||||
|
||||
@@ -8,6 +8,8 @@ LIB_PATH = $(LIB_DIR)$(LIBNAME)$(LIBEXT)
|
||||
|
||||
LIB_OBJS = \
|
||||
$(OBJ_DIR)hbziparc$(OBJEXT) \
|
||||
$(OBJ_DIR)hbzipnew$(OBJEXT) \
|
||||
$(OBJ_DIR)hbzipcom$(OBJEXT) \
|
||||
$(OBJ_DIR)hbcomprs$(OBJEXT) \
|
||||
$(OBJ_DIR)ziparchive$(OBJEXT) \
|
||||
$(OBJ_DIR)ZipPlatform_win$(OBJEXT) \
|
||||
@@ -18,8 +20,6 @@ LIB_OBJS = \
|
||||
$(OBJ_DIR)zipmemfile$(OBJEXT) \
|
||||
$(OBJ_DIR)zipfileheader$(OBJEXT) \
|
||||
$(OBJ_DIR)zipfile$(OBJEXT) \
|
||||
$(OBJ_DIR)zipnew$(OBJEXT) \
|
||||
$(OBJ_DIR)zipcomp$(OBJEXT) \
|
||||
$(OBJ_DIR)zipexception$(OBJEXT) \
|
||||
$(OBJ_DIR)zipcompatibility$(OBJEXT) \
|
||||
$(OBJ_DIR)zipcentraldir$(OBJEXT) \
|
||||
|
||||
@@ -1,728 +0,0 @@
|
||||
/*
|
||||
* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_ZIPFILE()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Create a zip file
|
||||
* $SYNTAX$
|
||||
* HB_ZIPFILE( <cFile>, <cFileToCompress> | <aFiles>, <nLevel>,
|
||||
* <bBlock>, <lOverWrite>, <cPassword>, <lWithPath>, <lWithDrive>,
|
||||
* <pFileProgress> ) ---> lCompress
|
||||
* $ARGUMENTS$
|
||||
* <cFile> Name of the zip file to create
|
||||
*
|
||||
* <cFileToCompress> Name of a file to Compress, Drive and/or path
|
||||
* can be used
|
||||
* _or_
|
||||
* <aFiles> An array containing files to compress, Drive and/or path
|
||||
* can be used
|
||||
*
|
||||
* <nLevel> Compression level ranging from 0 to 9
|
||||
*
|
||||
* <bBlock> Code block to execute while compressing
|
||||
*
|
||||
* <lOverWrite> Toggle to overwrite the file if exists
|
||||
*
|
||||
* <cPassword> Password to encrypt the files
|
||||
*
|
||||
* <lWithPath> Toggle to store the path or not
|
||||
*
|
||||
* <lWithDrive> Toggle to store the Drive letter and path or not
|
||||
*
|
||||
* <pFileProgress> Code block for File Progress
|
||||
* $RETURNS$
|
||||
* <lCompress> .t. if file was create, otherwise .f.
|
||||
* $DESCRIPTION$
|
||||
* This function creates a zip file named <cFile>. If the extension
|
||||
* is omitted, .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 <aFiles>
|
||||
* will be compressed.
|
||||
*
|
||||
* If <nLevel> is used, it determines the compression type where 0 means
|
||||
* no compression and 9 means best compression.
|
||||
*
|
||||
* If <bBlock> is used, every time the file is opened to compress it
|
||||
* will evaluate bBlock. Parameters of bBlock are cFile and nPos.
|
||||
*
|
||||
* If <lOverWrite> is used, it toggles to overwrite or not the existing
|
||||
* file. Default is to overwrite the file,otherwise if <lOverWrite> is false
|
||||
* the new files are added to the <cFile>.
|
||||
*
|
||||
* If <cPassword> is used, all files that are added to the archive are encrypted
|
||||
* with the password.
|
||||
*
|
||||
* If <lWithPath> is used, it tells the path should also be stored with
|
||||
* the file name. Default is false.
|
||||
*
|
||||
* If <lWithDrive> is used, it tells thats the Drive and path should also be stored
|
||||
* with the file name. Default is false.
|
||||
*
|
||||
* If <pFileProgress> is used, an Code block is evaluated, showing the total
|
||||
* of that file has being processed.
|
||||
* The codeblock must be defined as follow {|nPos,nTotal| GaugeUpdate(aGauge1,(nPos/nTotal))}
|
||||
*
|
||||
* $EXAMPLES$
|
||||
* FUNCTION MAIN()
|
||||
*
|
||||
* IF HB_ZIPFILE( "TEST.ZIP", "TEST.PRG" )
|
||||
* qout( "File was successfully created" )
|
||||
* ENDIF
|
||||
*
|
||||
* IF HB_ZIPFILE( "TEST1.ZIP", { "TEST.PRG", "c:\windows\win.ini" } )
|
||||
* qout( "File was successfully created" )
|
||||
* ENDIF
|
||||
*
|
||||
* IF HB_ZIPFILE( "TEST2.ZIP", { "TEST.PRG", "c:\windows\win.ini" }, 9, {|cFile,nPos,| qout(cFile) } )
|
||||
* qout( "File was successfully created" )
|
||||
* 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, 9, {|cFile,nPos| GaugeUpdate( aGauge, nPos/nLen ) },, "hello" )
|
||||
* Return Nil
|
||||
* $STATUS$
|
||||
* R
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/*
|
||||
* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_UNZIPFILE()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Unzip a compressed file
|
||||
* $SYNTAX$
|
||||
* HB_UNZIPFILE( <cFile>, <bBlock>, <lWithPath>, <cPassWord>, <cPath>,
|
||||
* <cFile> | <aFile>, <pFileProgress> ) ---> lCompress
|
||||
* $ARGUMENTS$
|
||||
* <cFile> Name of the zip file to extract
|
||||
*
|
||||
* <bBlock> Code block to execute while extracting
|
||||
*
|
||||
* <lWithPath> Toggle to create directory if needed
|
||||
*
|
||||
* <cPassWord> Password to use to extract files
|
||||
*
|
||||
* <cPath> Path to extract the files to - mandatory
|
||||
*
|
||||
* <cFile> | <aFiles> A File or Array of files to extract - mandatory
|
||||
*
|
||||
* <pFileProgress> Code block for File Progress
|
||||
* $RETURNS$
|
||||
* <lCompress> .t. if all file was successfully restored, otherwise .f.
|
||||
* $DESCRIPTION$
|
||||
* This function restores all files contained inside the <cFile>.
|
||||
* If the extension is omitted, .ZIP will be assumed. If a file already
|
||||
* exists, it will be overwritten.
|
||||
*
|
||||
* If <bBlock> is used, every time the file is opened to compress it
|
||||
* will evaluate bBlock. Parameters of bBlock are cFile and nPos.
|
||||
*
|
||||
* The <cPath> is a mandatory parameter. Set to ".\" to extract to the
|
||||
* current directory
|
||||
*
|
||||
* If <cFile> or <aFiles> are not provided, no files will be extracted!
|
||||
* Make sure you provide the file or files you want extracted
|
||||
*
|
||||
* If <pFileProgress> is used, an Code block is evaluated, showing the total
|
||||
* of that file has being processed.
|
||||
* The codeblock must be defined as follow {|nPos,nTotal| GaugeUpdate(aGauge1,(nPos/nTotal))}
|
||||
* $EXAMPLES$
|
||||
* FUNCTION MAIN()
|
||||
*
|
||||
* aExtract := hb_GetFilesInZip( "TEST.ZIP" ) // extract all files in zip
|
||||
* IF HB_UNZIPFILE( "TEST.ZIP",,,, ".\", aExtract )
|
||||
* qout("File was successfully extracted")
|
||||
* ENDIF
|
||||
*
|
||||
* aExtract := hb_GetFilesInZip( "TEST2.ZIP" ) // extract all files in zip
|
||||
* IF HB_UNZIPFILE( "TEST2.ZIP", {|cFile| qout( cFile ) },,, ".\", aExtract )
|
||||
* qout("File was successfully extracted")
|
||||
* ENDIF
|
||||
* Return Nil
|
||||
* $STATUS$
|
||||
* R
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/*
|
||||
* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_GETUNZIPFILE()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Gets the number of files that are in the zipfile
|
||||
* $SYNTAX$
|
||||
* HB_GETUNZIPFILE( <cFile> ) ---> nNumber
|
||||
* $ARGUMENTS$
|
||||
* <cFile> Name of the zip file
|
||||
* $RETURNS$
|
||||
* <nNumber> 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 conjunction 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 hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/*
|
||||
* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_ZIPFILEBYTDSPAN()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Create a zip file
|
||||
* $SYNTAX$
|
||||
* HB_ZIPFILEBYTDSPAN( <cFile> ,<cFileToCompress> | <aFiles>, <nLevel>,
|
||||
* <bBlock>, <lOverWrite>, <cPassword>, <iSize>, <lWithPath>, <lWithDrive>,
|
||||
* <pFileProgress>) ---> lCompress
|
||||
* $ARGUMENTS$
|
||||
* <cFile> Name of the zip file
|
||||
*
|
||||
* <cFileToCompress> Name of a file to Compress, Drive and/or path
|
||||
* can be used
|
||||
* _or_
|
||||
* <aFiles> An array containing files to compress, Drive and/or path
|
||||
* can be used
|
||||
*
|
||||
* <nLevel> Compression level ranging from 0 to 9
|
||||
*
|
||||
* <bBlock> Code block to execute while compressing
|
||||
*
|
||||
* <lOverWrite> Toggle to overwrite the file if exists
|
||||
*
|
||||
* <cPassword> Password to encrypt the files
|
||||
*
|
||||
* <iSize> Size of the archive, in bytes. Default is 1457664 bytes
|
||||
*
|
||||
* <lWithPath> Toggle to store the path or not
|
||||
*
|
||||
* <lWithDrive> Toggle to store the Drive letter and path or not
|
||||
*
|
||||
* <pFileProgress> Code block for File Progress
|
||||
* $RETURNS$
|
||||
* <lCompress> .t. if file was create, otherwise .f.
|
||||
* $DESCRIPTION$
|
||||
* This function creates a zip file named <cFile>. If the extension
|
||||
* is omitted, .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 <aFiles>
|
||||
* will be compressed.
|
||||
*
|
||||
* If <nLevel> is used, it determines the compression type where 0 means
|
||||
* no compression and 9 means best compression.
|
||||
*
|
||||
* If <bBlock> is used, every time the file is opened to compress it
|
||||
* will evaluate bBlock. Parameters of bBlock are cFile and nPos.
|
||||
*
|
||||
* If <lOverWrite> is used, it toggles to overwrite or not the existing
|
||||
* file. Default is to overwrite the file, otherwise if <lOverWrite> is
|
||||
* false the new files are added to the <cFile>.
|
||||
*
|
||||
* If <lWithPath> is used, it tells thats the path should also be stored '
|
||||
* with the file name. Default is false.
|
||||
*
|
||||
* If <lWithDrive> is used, it tells thats the Drive and path should also
|
||||
* be stored with the file name. Default is false.
|
||||
*
|
||||
* If <pFileProgress> is used, an Code block is evaluated, showing the total
|
||||
* of that file has being processed.
|
||||
* The codeblock must be defined as follow {|nPos,nTotal| GaugeUpdate(aGauge1,(nPos/nTotal))}
|
||||
* $EXAMPLES$
|
||||
* FUNCTION MAIN()
|
||||
*
|
||||
* IF HB_ZIPFILEBYTDSPAN( "TEST.ZIP", "TEST.PRG" )
|
||||
* qout( "File was successfully created" )
|
||||
* ENDIF
|
||||
*
|
||||
* IF HB_ZIPFILEBYTDSPAN( "TEST1.ZIP", { "TEST.PRG", "c:\windows\win.ini" } )
|
||||
* qout( "File was successfully created" )
|
||||
* ENDIF
|
||||
*
|
||||
* IF HB_ZIPFILEBYTDSPAN( "TEST2.ZIP", { "TEST.PRG", "c:\windows\win.ini" }, 9, {|nPos,cFile| qout(cFile) }, "hello",, 521421 )
|
||||
* qout("File was successfully created" )
|
||||
* 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, 9, {|cFile,nPos| GaugeUpdate( aGauge, nPos/nLen) },, "hello",, 6585452 )
|
||||
* Return Nil
|
||||
* $STATUS$
|
||||
* R
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_ZIPFILEBYPKSPAN()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Create a zip file on removable media
|
||||
* $SYNTAX$
|
||||
* HB_ZIPFILEBYPKSPAN( <cFile>, <cFileToCompress> | <aFiles>, <nLevel>,
|
||||
* <bBlock>, <lOverWrite>, <cPassword>, <lWithPath>, <lWithDrive>,
|
||||
* <pFileProgress>) ---> lCompress
|
||||
* $ARGUMENTS$
|
||||
* <cFile> Name of the zip file
|
||||
*
|
||||
* <cFileToCompress> Name of a file to Compress, Drive and/or path
|
||||
* can be used
|
||||
* _or_
|
||||
* <aFiles> An array containing files to compress, Drive and/or path
|
||||
* can be used
|
||||
*
|
||||
* <nLevel> Compression level ranging from 0 to 9
|
||||
*
|
||||
* <bBlock> Code block to execute while compressing
|
||||
*
|
||||
* <lOverWrite> Toggle to overwrite the file if exists
|
||||
*
|
||||
* <cPassword> Password to encrypt the files
|
||||
*
|
||||
* <lWithPath> Toggle to store the path or not
|
||||
*
|
||||
* <lWithDrive> Toggle to store the Drive letter and path or not
|
||||
*
|
||||
* <pFileProgress> Code block for File Progress
|
||||
* $RETURNS$
|
||||
* <lCompress> .t. if file was create, otherwise .f.
|
||||
* $DESCRIPTION$
|
||||
* This function creates a zip file named <cFile>. If the extension
|
||||
* is omitted, .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 <aFiles>
|
||||
* will be compressed. Also, the use of this function is for creating
|
||||
* backup in removable media like an floppy drive/zip drive.
|
||||
*
|
||||
* If <nLevel> is used, it determines the compression type where 0 means
|
||||
* no compression and 9 means best compression.
|
||||
*
|
||||
* If <bBlock> is used, every time the file is opened to compress it
|
||||
* will evaluate bBlock. Parameters of bBlock are cFile and nPos.
|
||||
*
|
||||
* If <lOverWrite> is used , it toggles to overwrite or not the existing
|
||||
* file. Default is to overwrite the file, otherwise if <lOverWrite> is false
|
||||
* the new files are added to the <cFile>.
|
||||
*
|
||||
* If <cPassword> is used, all files that are added to the archive are encrypted
|
||||
* with the password.
|
||||
*
|
||||
* If <lWithPath> is used, it tells thats the path should also be stored with
|
||||
* the file name. Default is false.
|
||||
*
|
||||
* If <lWithDrive> is used, it tells thats the Drive and path should also be stored
|
||||
* with the file name. Default is false.
|
||||
*
|
||||
* If <pFileProgress> is used, an Code block is evaluated, showing the total
|
||||
* of that file has being processed.
|
||||
* The codeblock must be defined as follow {|nPos,nTotal| GaugeUpdate(aGauge1,(nPos/nTotal))}
|
||||
*
|
||||
* Before calling this function, Set an Changedisk codeblock by calling
|
||||
* the HB_SETDISKZIP().
|
||||
* $EXAMPLES$
|
||||
* FUNCTION MAIN()
|
||||
*
|
||||
* hb_setdiskzip( {|nDisk| Alert( "Please insert disk no " + Str( nDisk, 3 ) ) } )
|
||||
*
|
||||
* IF HB_ZIPFILEBYPKSPAN( "a:\TEST.ZIP", "TEST.PRG" )
|
||||
* qout( "File was successfully created" )
|
||||
* ENDIF
|
||||
*
|
||||
* IF HB_ZIPFILEBYPKSPAN( "a:\TEST1.ZIP", { "TEST.PRG", "c:\windows\win.ini" } )
|
||||
* qout( "File was successfully created" )
|
||||
* ENDIF
|
||||
*
|
||||
* IF HB_ZIPFILEBYPKSPAN( "TEST2.ZIP", { "TEST.PRG", "c:\windows\win.ini"}, 9, {|nPos,cFile| qout(cFile) } )
|
||||
* qout( "File was successfully created" )
|
||||
* 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, 9, {|cFile,nPos| GaugeUpdate( aGauge, nPos/nLen ) },, "hello" )
|
||||
* // assuming f:\ is a Zip Drive
|
||||
* Return Nil
|
||||
* $STATUS$
|
||||
* R
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_SETDISKZIP()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Set an codeblock for disk changes
|
||||
* $SYNTAX$
|
||||
* HB_SETDISKZIP( <bBlock> ) ---> TRUE
|
||||
* $ARGUMENTS$
|
||||
* <bBlock> an Code block that contains an function that will be performed
|
||||
* when the need of changing disk are need.
|
||||
* $RETURNS$
|
||||
* It always returns True
|
||||
* $DESCRIPTION$
|
||||
* This function will set an codeblock that will be evaluated every time
|
||||
* that an changedisk event is necessary. <bBlock> receives nDisk as a
|
||||
* code block param that corresponds to the diskette number to be processed.
|
||||
*
|
||||
* 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( {|nDisk| Alert( "Please insert disk no " + Str( nDisk, 3 ) ) } )
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_ZIPDELETEFILES()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Delete files from an zip archive
|
||||
* $SYNTAX$
|
||||
* HB_ZIPDELETEFILES( <cFile>, <cFiletoDelete> | <aFiles> | <nFilePos> ) --> <lDeleted>
|
||||
* $ARGUMENTS$
|
||||
* <cFile> The name of the zip files from where the files will be deleted
|
||||
*
|
||||
* <cFiletoDelete> An File to be removed
|
||||
* _or_
|
||||
* <aFiles> An Array of Files to be removed
|
||||
* _or_
|
||||
* <nFilePos> The Position of the file to be removed
|
||||
* $RETURNS$
|
||||
* <lDeleted> If the files are deleted, it will return .T.; otherwise
|
||||
* it will return .f. in the following cases: Spanned Archives; the file(s)
|
||||
* 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 hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_ZIPTESTPK()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Test pkSpanned zip files
|
||||
* $SYNTAX$
|
||||
* HB_ZIPTESTPK( <cFile> ) --> <nReturnCode>
|
||||
* $ARGUMENTS$
|
||||
* <cFile> File to be tested.
|
||||
* $RETURNS$
|
||||
* <nReturn> A code that tells if the current disk is the last of a
|
||||
* pkSpanned 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
|
||||
*
|
||||
* <table>
|
||||
* Error code Meaning
|
||||
* 114 Incorrect Disk
|
||||
* 103 No Call back was set with HB_SETDISKZIP()
|
||||
* </table>
|
||||
*
|
||||
* 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 Diskette"
|
||||
* endif
|
||||
* $STATUS$
|
||||
* R
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_GETZIPCOMMENT()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Return the comment of an zip file
|
||||
* $SYNTAX$
|
||||
* HB_GETZIPCOMMENT( <szFile> ) --> <szComment>
|
||||
* $ARGUMENTS$
|
||||
* <szFile> File to get the comment from
|
||||
* $RETURNS$
|
||||
* <szComment> The comment that was stored in <szFile>
|
||||
* $DESCRIPTION$
|
||||
* This function receives a valid zip file name as parameter,
|
||||
* and returns the global comment stored within.
|
||||
* $EXAMPLES$
|
||||
* ? "The comment in test.zip is ", HB_GETZIPCOMMENT( "test.zip" )
|
||||
* $STATUS$
|
||||
* R
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_SETZIPCOMMENT()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Set an Zip archive Comment
|
||||
* $SYNTAX$
|
||||
* HB_SETZIPCOMMENT( <cComment> ) --> Nil
|
||||
* $ARGUMENTS$
|
||||
* <cComment> Comment to add to the zip archive
|
||||
* $RETURNS$
|
||||
* <NIL> 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 functions.
|
||||
* $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 hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_SETBUFFER()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
*
|
||||
* $SYNTAX$
|
||||
* HB_SETBUFFER( [<nWriteBuffer>], [<nExtractBuffer>], [<nReadBuffer>] ) --> Nil
|
||||
* $ARGUMENTS$
|
||||
* <nWriteBuffer> The size of the write buffer.
|
||||
*
|
||||
* <nExtractBuffer> The size of the extract buffer.
|
||||
*
|
||||
* <nReadBuffer> The size of the read buffer.
|
||||
* $RETURNS$
|
||||
* <NIL> This function always returns NIL.
|
||||
* $DESCRIPTION$
|
||||
* This function set the size of the internal buffers for write/extract/read
|
||||
* operation
|
||||
*
|
||||
* If the size of the buffer is smaller then the default, the function
|
||||
* will automatically use the default values, which are 65535/16384/32768
|
||||
* respectively.
|
||||
*
|
||||
* This function be called before any of the compression/decompression
|
||||
* functions.
|
||||
* $EXAMPLES$
|
||||
* HB_SETBUFFER( 100000, 115214, 65242 )
|
||||
* $STATUS$
|
||||
* R
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
|
||||
/*
|
||||
* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_GETUNRARFILE()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Gets the number of files that are in the RAR file
|
||||
* $SYNTAX$
|
||||
* HB_GETUNRARFILE( <cFile> ) ---> nNumber
|
||||
* $ARGUMENTS$
|
||||
* <cFile> Name of the rar file
|
||||
* $RETURNS$
|
||||
* <nNumber> The number of files contained inside the RAR file
|
||||
* $DESCRIPTION$
|
||||
* This function returns the number of files that is stored in the RAR file.
|
||||
* $EXAMPLES$
|
||||
* FUNCTION MAIN()
|
||||
* Local nFiles := HB_GETUNRARFILE( "test.rar" )
|
||||
*
|
||||
* if nFiles > 0
|
||||
* ? "This files contains ", nFiles
|
||||
* endif
|
||||
*
|
||||
* Return Nil
|
||||
* $STATUS$
|
||||
* R
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
/*
|
||||
* $DOC$
|
||||
* $FUNCNAME$
|
||||
* HB_UNZIPFILEINDEX()
|
||||
* $CATEGORY$
|
||||
* Zip Functions
|
||||
* $ONELINER$
|
||||
* Unzip a compressed file referenced by it number in the zipfile
|
||||
* $SYNTAX$
|
||||
* HB_UNZIPFILE( <cFile>, <bBlock>, <lWithPath>, <cPassWord>, <cPath>,
|
||||
* <nFile> | <anFiles>, <pFileProgress> ) ---> lCompress
|
||||
* $ARGUMENTS$
|
||||
* <cFile> Name of the zip file
|
||||
*
|
||||
* <bBlock> Code block to execute while compressing
|
||||
*
|
||||
* <lWithPath> Toggle to create directory if needed
|
||||
*
|
||||
* <cPassWord> Password to use to extract files
|
||||
*
|
||||
* <cPath> Path to extract the files to - mandatory.
|
||||
*
|
||||
* <cFile> | <anFiles> A File or Array of files position to extract - mandatory
|
||||
*
|
||||
* <pFileProgress> Code block for File Progress
|
||||
* $RETURNS$
|
||||
* <lCompress> .t. if all file was successfully restored, otherwise .f.
|
||||
* $DESCRIPTION$
|
||||
* This function restores all files contained inside the <cFile>.
|
||||
* If the extension is omitted, .ZIP will be assumed. If a file already
|
||||
* exists, it will be overwritten.
|
||||
*
|
||||
* If <bBlock> is used, every time the file is opened to compress it
|
||||
* will evaluate bBlock. Parameters of bBlock are cFile and nPos.
|
||||
*
|
||||
* The <cPath> is a mandatory parameter. Set to ".\" to extract to the
|
||||
* current dir
|
||||
*
|
||||
* If <cFile> or <anFiles> are not provided, no files will be extracted!
|
||||
* Make sure you provide the file or files you want extracted
|
||||
*
|
||||
* If <pFileProgress> is used, an Code block is evaluated, showing the total
|
||||
* of that file has being processed.
|
||||
* The codeblock must be defined as follow {|nPos,nTotal| GaugeUpdate(aGauge1,(nPos/nTotal))}
|
||||
* $EXAMPLES$
|
||||
* FUNCTION MAIN()
|
||||
*
|
||||
* IF HB_UNZIPFILEINDEX( "TEST.ZIP",,,, ".\", 1 )
|
||||
* qout( "File was successfully created" )
|
||||
* ENDIF
|
||||
*
|
||||
* IF HB_UNZIPFILEINDEX( "TEST2.ZIP", {|cFile|, qout(cFile) },,, ".\", { 1, 2 } )
|
||||
* qout( "File was successfully created" )
|
||||
* ENDIF
|
||||
*
|
||||
* Return Nil
|
||||
* $STATUS$
|
||||
* R
|
||||
* $COMPLIANCE$
|
||||
* This function is a Harbour extension
|
||||
* $PLATFORMS$
|
||||
* All
|
||||
* $FILES$
|
||||
* Library is hbzip.lib
|
||||
* $END$
|
||||
*/
|
||||
File diff suppressed because it is too large
Load Diff
@@ -56,14 +56,10 @@
|
||||
|
||||
#define HB_OS_WIN_32_USED
|
||||
|
||||
#include "hbvmopt.h"
|
||||
#include "hbapi.h"
|
||||
#include "hbstack.h"
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapierr.h"
|
||||
#include "hbapicls.h"
|
||||
#include "hbapifs.h"
|
||||
/* #include "hbapigt.h" */
|
||||
#include "hbvm.h"
|
||||
|
||||
#if defined(__GNUC__) && !defined(__MINGW32__)
|
||||
@@ -92,16 +88,17 @@ HB_EXTERN_BEGIN
|
||||
#define Time 7
|
||||
#define Crc32 8
|
||||
#define Attr 9
|
||||
#define WRITEBUFFERSIZE (16384)
|
||||
#define MAXFILENAME (256)
|
||||
#define WRITEBUFFERSIZE 16384
|
||||
#define MAXFILENAME 256
|
||||
|
||||
typedef struct _HB_ZIP_INTERNAL{
|
||||
int iWrite;
|
||||
int iExtract;
|
||||
int iRead;
|
||||
char * szComment;
|
||||
int iReadOnly ;
|
||||
PHB_ITEM pItem;
|
||||
typedef struct _HB_ZIP_INTERNAL
|
||||
{
|
||||
int iWrite;
|
||||
int iExtract;
|
||||
int iRead;
|
||||
char * szComment;
|
||||
int iReadOnly;
|
||||
PHB_ITEM pItem;
|
||||
} HB_ZIP_INTERNAL,* PHB_ZIP_INTERNAL,* HB_ZIP_INTERNAL_PTR;
|
||||
|
||||
#ifndef LPCTSTR
|
||||
@@ -109,34 +106,34 @@ typedef const char *LPCSTR;
|
||||
typedef LPCSTR LPCTSTR;
|
||||
#endif
|
||||
|
||||
extern char *hb___CheckFile( char * szFile);
|
||||
extern unsigned long GetCurrentFileSize( LPCTSTR szFile);
|
||||
extern PHB_ITEM hbza_ZipArray;
|
||||
extern PHB_ITEM hbza_ChangeDiskBlock;
|
||||
extern PHB_ITEM hbza_pProgressInfo;
|
||||
|
||||
extern PHB_ITEM hb___GetFileNamesFromZip(char *szFile,BOOL iMode);
|
||||
|
||||
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 BOOL hb_TransferFilesFromzip(char *szSource,char *szDest,PHB_ITEM pArray);
|
||||
extern char *hb_getPassWord(char *szName);
|
||||
extern int hb___GetNumberofFilestoUnzip(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,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_UnzipSel(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,const char *szPath,PHB_ITEM pArray,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_DeleteSel(char *szFile,PHB_ITEM pArray,BOOL bCase);
|
||||
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 int hb_UnzipAll(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *pbyBuffer,PHB_ITEM pDiskBlock,PHB_ITEM pProgress);
|
||||
/*
|
||||
|
||||
extern BOOL hb_SaveZipFileFromMemory(char *szFile);
|
||||
extern BOOL hb_CreateZipInMemory(char *szFileToCompress,char *szFile);
|
||||
*/
|
||||
extern void hb_SetZipReadOnly(BOOL bRead);
|
||||
extern char * hb___CheckFile( char * szFile);
|
||||
extern PHB_ITEM hb___GetFileNamesFromZip(char *szFile,BOOL iMode);
|
||||
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 BOOL hb_TransferFilesFromzip(char *szSource,char *szDest,PHB_ITEM pArray);
|
||||
extern char * hb_getPassWord(char *szName);
|
||||
extern int hb___GetNumberofFilestoUnzip(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,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_UnzipSel(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,const char *szPath,PHB_ITEM pArray,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_DeleteSel(char *szFile,PHB_ITEM pArray,BOOL bCase);
|
||||
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 int hb_UnzipAll(char *szFile,PHB_ITEM pBlock,BOOL bWithPath,char *szPassWord,char *pbyBuffer,PHB_ITEM pDiskBlock,PHB_ITEM pProgress);
|
||||
/*
|
||||
extern BOOL hb_SaveZipFileFromMemory(char *szFile);
|
||||
extern BOOL hb_CreateZipInMemory(char *szFileToCompress,char *szFile);
|
||||
*/
|
||||
extern void hb_SetZipReadOnly(BOOL bRead);
|
||||
|
||||
HB_EXTERN_END
|
||||
#endif /* HB_APIEXT_H_ */
|
||||
|
||||
#endif /* HB_APIZLIB_H_ */
|
||||
|
||||
@@ -54,11 +54,6 @@
|
||||
|
||||
#include "hbziparc.h"
|
||||
|
||||
//extern PHB_ITEM ZipArray;
|
||||
PHB_ITEM pDiskStatus = NULL;
|
||||
PHB_ITEM pProgressInfo = NULL;
|
||||
extern PHB_ITEM ChangeDiskBlock;
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
@@ -73,7 +68,7 @@ class SpanCallbackc : public CZipSpanCallback
|
||||
{
|
||||
PHB_ITEM Disk=hb_itemPutNL( NULL, m_uDiskNeeded );
|
||||
|
||||
hb_vmEvalBlockV( ChangeDiskBlock, 1, Disk );
|
||||
hb_vmEvalBlockV( hbza_ChangeDiskBlock, 1, Disk );
|
||||
hb_itemRelease( Disk );
|
||||
|
||||
return TRUE;
|
||||
@@ -87,7 +82,7 @@ class SpanActionCallbackc : public CZipActionCallback
|
||||
PHB_ITEM Disk =hb_itemPutNL(NULL, m_uTotalSoFar ), Total=hb_itemPutNL( NULL, m_uTotalToDo );
|
||||
|
||||
|
||||
hb_vmEvalBlockV( pProgressInfo, 2, Disk,Total);
|
||||
hb_vmEvalBlockV( hbza_pProgressInfo, 2, Disk,Total);
|
||||
|
||||
hb_itemRelease( Disk );
|
||||
hb_itemRelease( Total );
|
||||
@@ -96,6 +91,52 @@ class SpanActionCallbackc : public CZipActionCallback
|
||||
}
|
||||
};
|
||||
|
||||
static DWORD hb_GetCurrentFileSize( LPCTSTR szFile )
|
||||
#if defined( HB_OS_WIN_32 ) || defined( __MINGW32__ )
|
||||
{
|
||||
DWORD dwFlags = FILE_ATTRIBUTE_ARCHIVE;
|
||||
HANDLE hFind;
|
||||
WIN32_FIND_DATA hFilesFind;
|
||||
|
||||
hFind = FindFirstFile( szFile, &hFilesFind );
|
||||
|
||||
if ( hFind != INVALID_HANDLE_VALUE )
|
||||
{
|
||||
if ( dwFlags & hFilesFind.dwFileAttributes )
|
||||
{
|
||||
if( hFilesFind.nFileSizeHigh>0 )
|
||||
{
|
||||
return ( ( hFilesFind.nFileSizeHigh*MAXDWORD )+hFilesFind.nFileSizeLow );
|
||||
}
|
||||
else
|
||||
{
|
||||
return ( hFilesFind.nFileSizeLow );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
FindClose( hFind );
|
||||
|
||||
return ( DWORD ) -1;
|
||||
|
||||
}
|
||||
#elif defined( __GNUC__ )
|
||||
{
|
||||
USHORT ushbMask = 63;
|
||||
USHORT usFileAttr = HB_FA_ARCHIVE;
|
||||
struct stat sStat;
|
||||
|
||||
if ( stat( szFile, &sStat ) != -1 )
|
||||
{
|
||||
return sStat.st_size;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
int hb_CompressFile( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBlock, BOOL bOverWrite, char *szPassWord, BOOL bPath, BOOL bDrive, PHB_ITEM pProgress )
|
||||
{
|
||||
ULONG ulCount;
|
||||
@@ -103,7 +144,7 @@ int hb_CompressFile( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBl
|
||||
char *szDummyLower ;
|
||||
char *szFileLower = hb_strdup((char *)szFile) ;
|
||||
BOOL bFileExist = hb_fsFile( ( BYTE* )szFile );
|
||||
BOOL bAdded = FALSE;
|
||||
BOOL bAdded;
|
||||
BOOL bReturn = TRUE;
|
||||
DWORD dwSize;
|
||||
|
||||
@@ -152,14 +193,14 @@ int hb_CompressFile( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBl
|
||||
|
||||
if ( HB_IS_BLOCK( pProgress ) )
|
||||
{
|
||||
pProgressInfo = pProgress;
|
||||
hbza_pProgressInfo = pProgress;
|
||||
szZip.SetCallback( &spanac );
|
||||
}
|
||||
|
||||
for ( ulCount = 1; ( ulCount <= hb_arrayLen( pArray ) ) ;ulCount++ )
|
||||
{
|
||||
szDummy = ( char * ) hb_arrayGetCPtr( pArray, ulCount ) ;
|
||||
dwSize = GetCurrentFileSize( szDummy );
|
||||
dwSize = hb_GetCurrentFileSize( szDummy );
|
||||
bAdded = FALSE;
|
||||
|
||||
szDummyLower = hb_strdup( (char *)szDummy ) ;
|
||||
@@ -189,7 +230,7 @@ int hb_CompressFile( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBl
|
||||
if ( bPath && !bAdded )
|
||||
{
|
||||
szZip.AddNewFile( szDummy, iCompLevel, true, CZipArchive::zipsmSafeSmart, 65536 );
|
||||
bAdded = TRUE;
|
||||
// bAdded = TRUE;
|
||||
}
|
||||
else if ( !bDrive && !bPath && !bAdded )
|
||||
{
|
||||
@@ -217,8 +258,6 @@ int hb_CompressFile( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBl
|
||||
catch( ... ){}
|
||||
|
||||
return ( int ) bReturn;
|
||||
|
||||
|
||||
}
|
||||
|
||||
int hb_CmpTdSpan( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBlock, BOOL bOverWrite, char *szPassWord, int iSpanSize, BOOL bPath, BOOL bDrive, PHB_ITEM pProgress )
|
||||
@@ -226,7 +265,7 @@ int hb_CmpTdSpan( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBlock
|
||||
ULONG ulCount;
|
||||
const char *szDummy;
|
||||
DWORD dwSize;
|
||||
BOOL bAdded = FALSE;
|
||||
BOOL bAdded;
|
||||
BOOL bReturn = TRUE;
|
||||
BOOL bFileExist = hb_fsFile( ( BYTE* )szFile );
|
||||
|
||||
@@ -278,14 +317,14 @@ int hb_CmpTdSpan( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBlock
|
||||
|
||||
if ( HB_IS_BLOCK( pProgress ) )
|
||||
{
|
||||
pProgressInfo = pProgress;
|
||||
hbza_pProgressInfo = pProgress;
|
||||
szZip.SetCallback( &spanac );
|
||||
}
|
||||
|
||||
for ( ulCount = 1;( ulCount<= hb_arrayLen( pArray ) ) ;ulCount++ )
|
||||
{
|
||||
szDummy = ( char * )hb_arrayGetCPtr( pArray, ulCount ) ;
|
||||
dwSize = GetCurrentFileSize( szDummy );
|
||||
dwSize = hb_GetCurrentFileSize( szDummy );
|
||||
|
||||
bAdded = FALSE;
|
||||
|
||||
@@ -307,7 +346,7 @@ int hb_CmpTdSpan( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBlock
|
||||
if ( bPath && !bAdded )
|
||||
{
|
||||
szZip.AddNewFile( szDummy, iCompLevel, true, CZipArchive::zipsmSafeSmart, 65536 );
|
||||
bAdded = TRUE;
|
||||
// bAdded = TRUE;
|
||||
}
|
||||
else if ( !bDrive && !bPath && !bAdded )
|
||||
{
|
||||
@@ -343,7 +382,7 @@ bool hb_SetProgressofTdSpan( DWORD a, int iSoFar, void* pData ){
|
||||
|
||||
HB_SYMBOL_UNUSED( pData );
|
||||
|
||||
hb_vmEvalBlockV( pProgressInfo, 2, Disk, Total);
|
||||
hb_vmEvalBlockV( hbza_pProgressInfo, 2, Disk, Total);
|
||||
|
||||
hb_itemRelease( Disk );
|
||||
hb_itemRelease( Total );
|
||||
@@ -395,13 +434,13 @@ int hb_CompressFileStd( char *szFile, char *szFiletoCompress, int iCompLevel, PH
|
||||
|
||||
if ( HB_IS_BLOCK( pProgress ) )
|
||||
{
|
||||
pProgressInfo = pProgress;
|
||||
hbza_pProgressInfo = pProgress;
|
||||
szZip.SetCallback( &spanac );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
dwSize = GetCurrentFileSize( szFiletoCompress );
|
||||
dwSize = hb_GetCurrentFileSize( szFiletoCompress );
|
||||
|
||||
if ( dwSize != (DWORD) -1 )
|
||||
{
|
||||
@@ -438,7 +477,7 @@ int hb_CompressFileStd( char *szFile, char *szFiletoCompress, int iCompLevel, PH
|
||||
}
|
||||
else
|
||||
{
|
||||
bAdded = TRUE;
|
||||
// bAdded = TRUE;
|
||||
}
|
||||
}
|
||||
else if ( !bDrive && !bPath && !bAdded )
|
||||
@@ -471,7 +510,6 @@ int hb_CompressFileStd( char *szFile, char *szFiletoCompress, int iCompLevel, PH
|
||||
|
||||
int hb_CmpTdSpanStd( char *szFile, char * szFiletoCompress, int iCompLevel, PHB_ITEM pBlock, BOOL bOverWrite, char *szPassWord, int iSpanSize, BOOL bPath, BOOL bDrive, PHB_ITEM pProgress )
|
||||
{
|
||||
DWORD dwSize;
|
||||
BOOL bAdded = FALSE;
|
||||
BOOL bReturn = TRUE;
|
||||
BOOL bFileExist = hb_fsFile( ( BYTE* )szFile );
|
||||
@@ -520,7 +558,7 @@ int hb_CmpTdSpanStd( char *szFile, char * szFiletoCompress, int iCompLevel, PHB_
|
||||
|
||||
if ( HB_IS_BLOCK( pProgress ) )
|
||||
{
|
||||
pProgressInfo = pProgress;
|
||||
hbza_pProgressInfo = pProgress;
|
||||
szZip.SetCallback( &spanac );
|
||||
}
|
||||
if ( bReturn )
|
||||
@@ -532,8 +570,6 @@ int hb_CmpTdSpanStd( char *szFile, char * szFiletoCompress, int iCompLevel, PHB_
|
||||
szZip.SetPassword( szPassWord );
|
||||
}
|
||||
|
||||
dwSize = GetCurrentFileSize( szFiletoCompress );
|
||||
|
||||
if( pBlock != NULL )
|
||||
{
|
||||
PHB_ITEM FileName=hb_itemPutC( NULL, szFiletoCompress ) ;
|
||||
@@ -566,7 +602,7 @@ int hb_CmpTdSpanStd( char *szFile, char * szFiletoCompress, int iCompLevel, PHB_
|
||||
}
|
||||
else
|
||||
{
|
||||
bAdded = TRUE;
|
||||
// bAdded = TRUE;
|
||||
}
|
||||
}
|
||||
else if ( !bDrive && !bPath && !bAdded )
|
||||
@@ -53,11 +53,6 @@
|
||||
#include "hbziparc.h"
|
||||
#include "hbapifs.h"
|
||||
|
||||
PHB_ITEM ZipArray;
|
||||
|
||||
extern PHB_ITEM ChangeDiskBlock;
|
||||
extern PHB_ITEM pProgressInfo;
|
||||
|
||||
int hb_CheckSpanMode( char * szFile );
|
||||
|
||||
#ifdef __cplusplus
|
||||
@@ -77,7 +72,7 @@ class SpanCallback : public CZipSpanCallback
|
||||
{
|
||||
PHB_ITEM Disk = hb_itemPutNL( NULL, m_uDiskNeeded ) ;
|
||||
|
||||
hb_vmEvalBlockV( ChangeDiskBlock, 1, Disk);
|
||||
hb_vmEvalBlockV( hbza_ChangeDiskBlock, 1, Disk);
|
||||
|
||||
hb_itemRelease( Disk );
|
||||
|
||||
@@ -92,7 +87,7 @@ class SpanActionCallback : public CZipActionCallback
|
||||
PHB_ITEM Disk = hb_itemPutNL( NULL , m_uTotalSoFar ), Total= hb_itemPutNL( NULL, m_uTotalToDo );
|
||||
|
||||
|
||||
hb_vmEvalBlockV( pProgressInfo, 2, Disk, Total);
|
||||
hb_vmEvalBlockV( hbza_pProgressInfo, 2, Disk, Total);
|
||||
|
||||
hb_itemRelease( Disk );
|
||||
hb_itemRelease( Total );
|
||||
@@ -156,7 +151,7 @@ int hb_CmpPkSpan( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBlock
|
||||
|
||||
if ( HB_IS_BLOCK( pProgress ) )
|
||||
{
|
||||
pProgressInfo = pProgress;
|
||||
hbza_pProgressInfo = pProgress;
|
||||
szZip.SetCallback( &spanac );
|
||||
}
|
||||
|
||||
@@ -181,7 +176,7 @@ int hb_CmpPkSpan( char *szFile, PHB_ITEM pArray, int iCompLevel, PHB_ITEM pBlock
|
||||
if ( bPath && !bAdded )
|
||||
{
|
||||
szZip.AddNewFile( szDummy, iCompLevel, true, CZipArchive::zipsmSafeSmart, 65536 );
|
||||
bAdded = true;
|
||||
// bAdded = true;
|
||||
}
|
||||
else if ( !bDrive && !bPath && !bAdded )
|
||||
{
|
||||
@@ -248,8 +243,8 @@ PHB_ITEM hb___GetFileNamesFromZip( char *szFile, BOOL iMode )
|
||||
{
|
||||
iNumberOfFiles = szZip.GetCount();
|
||||
|
||||
ZipArray = hb_itemNew(NULL);
|
||||
hb_arrayNew( ZipArray, iNumberOfFiles );
|
||||
hbza_ZipArray = hb_itemNew(NULL);
|
||||
hb_arrayNew( hbza_ZipArray, iNumberOfFiles );
|
||||
time_t theTime;
|
||||
tm *SzTime;
|
||||
|
||||
@@ -377,7 +372,7 @@ PHB_ITEM hb___GetFileNamesFromZip( char *szFile, BOOL iMode )
|
||||
Item = hb_itemNew( NULL );
|
||||
hb_arraySetForward( TempArray, Attr, hb_itemPutCL( Item, szAttr, 5 ));
|
||||
hb_itemRelease( Item );
|
||||
hb_arraySetForward( ZipArray, ulCount+1, TempArray );
|
||||
hb_arraySetForward( hbza_ZipArray, ulCount+1, TempArray );
|
||||
hb_itemRelease( TempArray );
|
||||
|
||||
}
|
||||
@@ -387,7 +382,7 @@ PHB_ITEM hb___GetFileNamesFromZip( char *szFile, BOOL iMode )
|
||||
CZipString szTempString = ( LPCTSTR )fh.GetFileName( );
|
||||
szFileNameInZip = ( const char * )szTempString;
|
||||
Item = hb_itemNew( NULL );
|
||||
hb_arraySetForward( ZipArray, ulCount+1, hb_itemPutC( Item, ( char * ) szFileNameInZip ));
|
||||
hb_arraySetForward( hbza_ZipArray, ulCount+1, hb_itemPutC( Item, ( char * ) szFileNameInZip ));
|
||||
hb_itemRelease( Item );
|
||||
}
|
||||
|
||||
@@ -397,7 +392,7 @@ PHB_ITEM hb___GetFileNamesFromZip( char *szFile, BOOL iMode )
|
||||
|
||||
szZip.Close( );
|
||||
|
||||
return ZipArray;
|
||||
return hbza_ZipArray;
|
||||
}
|
||||
|
||||
char *hb___CheckFile( char * szFile )
|
||||
@@ -485,20 +480,20 @@ int hb___GetNumberofFilestoUnzip( char *szFile )
|
||||
int hb___SetCallbackFunc( PHB_ITEM pFunc )
|
||||
{
|
||||
|
||||
//ChangeDiskBlock.type = HB_IT_NIL;
|
||||
if ( ChangeDiskBlock )
|
||||
//hbza_ChangeDiskBlock.type = HB_IT_NIL;
|
||||
if ( hbza_ChangeDiskBlock )
|
||||
{
|
||||
hb_itemRelease( ChangeDiskBlock );
|
||||
ChangeDiskBlock = NULL;
|
||||
hb_itemRelease( hbza_ChangeDiskBlock );
|
||||
hbza_ChangeDiskBlock = NULL;
|
||||
}
|
||||
ChangeDiskBlock = hb_itemNew(NULL);
|
||||
hbza_ChangeDiskBlock = hb_itemNew(NULL);
|
||||
|
||||
if( pFunc )
|
||||
{
|
||||
hb_itemCopy( ChangeDiskBlock, pFunc );
|
||||
hb_itemCopy( hbza_ChangeDiskBlock, pFunc );
|
||||
}
|
||||
|
||||
// pZipI.pItem = ChangeDiskBlock;
|
||||
// pZipI.pItem = hbza_ChangeDiskBlock;
|
||||
|
||||
return ( int ) true;
|
||||
}
|
||||
@@ -509,7 +504,7 @@ bool hb_SetCallBack( DWORD iNumber, int, void* pData )
|
||||
|
||||
HB_SYMBOL_UNUSED( pData );
|
||||
|
||||
hb_vmEvalBlockV( ChangeDiskBlock, 1, Disk);
|
||||
hb_vmEvalBlockV( hbza_ChangeDiskBlock, 1, Disk);
|
||||
|
||||
hb_itemRelease( Disk );
|
||||
|
||||
@@ -523,6 +518,8 @@ int hb_DeleteSel( char *szFile, PHB_ITEM pArray, BOOL bCase )
|
||||
CZipArchive szZip;
|
||||
CZipStringArray aFiles;
|
||||
|
||||
HB_SYMBOL_UNUSED( bCase );
|
||||
|
||||
try
|
||||
{
|
||||
switch(hb_CheckSpanMode( szFile ))
|
||||
@@ -574,7 +571,7 @@ int hb_UnzipSel( char *szFile, PHB_ITEM pBlock, BOOL lWithPath, char *szPassWord
|
||||
|
||||
if ( HB_IS_BLOCK( pProgress ) )
|
||||
{
|
||||
pProgressInfo = pProgress;
|
||||
hbza_pProgressInfo = pProgress;
|
||||
szZip.SetCallback( &spanac );
|
||||
}
|
||||
|
||||
@@ -800,7 +797,7 @@ int hb_UnzipSelIndex( char *szFile, PHB_ITEM pBlock, BOOL lWithPath, char *szPas
|
||||
|
||||
if ( HB_IS_BLOCK( pProgress ) )
|
||||
{
|
||||
pProgressInfo = pProgress;
|
||||
hbza_pProgressInfo = pProgress;
|
||||
szZip.SetCallback( &spanac );
|
||||
}
|
||||
|
||||
@@ -953,78 +950,35 @@ BOOL hb_TransferFilesFromzip( char *szSource, char *szDest, PHB_ITEM pArray )
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
DWORD GetCurrentFileSize( LPCTSTR szFile )
|
||||
#if defined( HB_OS_WIN_32 ) || defined( __MINGW32__ )
|
||||
{
|
||||
DWORD dwFlags = FILE_ATTRIBUTE_ARCHIVE;
|
||||
HANDLE hFind;
|
||||
WIN32_FIND_DATA hFilesFind;
|
||||
|
||||
hFind = FindFirstFile( szFile, &hFilesFind );
|
||||
|
||||
if ( hFind != INVALID_HANDLE_VALUE )
|
||||
{
|
||||
if ( dwFlags & hFilesFind.dwFileAttributes )
|
||||
{
|
||||
if( hFilesFind.nFileSizeHigh>0 )
|
||||
{
|
||||
return ( ( hFilesFind.nFileSizeHigh*MAXDWORD )+hFilesFind.nFileSizeLow );
|
||||
}
|
||||
else
|
||||
{
|
||||
return ( hFilesFind.nFileSizeLow );
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
FindClose( hFind );
|
||||
|
||||
return ( DWORD ) -1;
|
||||
|
||||
}
|
||||
#elif defined( __GNUC__ )
|
||||
{
|
||||
USHORT ushbMask = 63;
|
||||
USHORT usFileAttr = HB_FA_ARCHIVE;
|
||||
struct stat sStat;
|
||||
|
||||
if ( stat( szFile, &sStat ) != -1 )
|
||||
{
|
||||
return sStat.st_size;
|
||||
}
|
||||
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
int hb_UnzipAll(char *szFile,PHB_ITEM pBlock, BOOL bWithPath,char *szPassWord,char *pbyBuffer,PHB_ITEM pDiskBlock,PHB_ITEM pProgress)
|
||||
{
|
||||
bool iReturn=true;
|
||||
uLong uiCount=0;
|
||||
int iCause=0;
|
||||
int iMode=true;
|
||||
CZipArchive szZip;
|
||||
BOOL bChange=FALSE;
|
||||
bool iReturn = true;
|
||||
uLong uiCount = 0;
|
||||
// int iCause = 0;
|
||||
int iMode = true;
|
||||
CZipArchive szZip;
|
||||
BOOL bChange = FALSE;
|
||||
SpanCallback span;
|
||||
SpanActionCallback spanac;
|
||||
|
||||
char * szPath = (char*) hb_xgrab( _POSIX_PATH_MAX + 1 );
|
||||
BOOL bFreePath = TRUE;
|
||||
|
||||
HB_SYMBOL_UNUSED( pDiskBlock );
|
||||
|
||||
if ( HB_IS_BLOCK( pProgress ) )
|
||||
{
|
||||
pProgressInfo = pProgress;
|
||||
hbza_pProgressInfo = pProgress;
|
||||
szZip.SetCallback( &spanac );
|
||||
}
|
||||
|
||||
if (szPassWord != NULL){
|
||||
szZip.SetPassword(szPassWord);
|
||||
}
|
||||
iMode=hb_CheckSpanMode(szFile);
|
||||
if (szPassWord != NULL )
|
||||
{
|
||||
szZip.SetPassword(szPassWord);
|
||||
}
|
||||
|
||||
iMode=hb_CheckSpanMode(szFile);
|
||||
|
||||
try {
|
||||
if(iMode==0) {
|
||||
@@ -1046,7 +1000,7 @@ BOOL bChange=FALSE;
|
||||
}
|
||||
}
|
||||
catch (CZipException &e) {
|
||||
iCause=e.m_iCause ;
|
||||
// iCause=e.m_iCause ;
|
||||
}
|
||||
|
||||
if (iReturn) {
|
||||
@@ -1117,7 +1071,7 @@ BOOL bChange=FALSE;
|
||||
catch ( CZipException& e )
|
||||
{
|
||||
szZip.CloseFile( NULL, true);
|
||||
iCause=e.m_iCause ;
|
||||
// iCause=e.m_iCause ;
|
||||
}
|
||||
if(bChange)
|
||||
{
|
||||
@@ -1,43 +0,0 @@
|
||||
@echo off
|
||||
REM
|
||||
REM $Id$
|
||||
REM
|
||||
REM
|
||||
|
||||
rem ---------------------------------------------------------------
|
||||
|
||||
rem Save the user value, force silent file overwrite with COPY
|
||||
rem (not all Windows versions support the COPY /Y flag)
|
||||
set HB_ORGENV_COPYCMD=%COPYCMD%
|
||||
set COPYCMD=/Y
|
||||
|
||||
if "%1" == "clean" goto CLEAN
|
||||
if "%1" == "CLEAN" goto CLEAN
|
||||
|
||||
if not exist obj\dll md obj\dll
|
||||
if not exist obj\dll\b32 md obj\dll\b32
|
||||
|
||||
:BUILD
|
||||
|
||||
make -fmake_b32_dll.mak %1 %2 %3 > make_b32_dll.log
|
||||
if errorlevel 1 goto notepad make_b32_dll.log
|
||||
|
||||
:BUILD_OK
|
||||
|
||||
if exist hdll.tmp del hdll.tmp
|
||||
if exist ..\..\lib\b32\hbziparchdll.dll implib ..\..\lib\b32\hbziparchdll.lib ..\..\lib\b32\hbziparchdll.dll > nul
|
||||
if exist ..\..\lib\b32\hbziparchdll.dll copy ..\..\lib\b32\hbziparchdll.dll ..\..\lib > nul
|
||||
if exist ..\..\lib\b32\hbziparchdll.lib copy ..\..\lib\b32\hbziparchdll.lib ..\..\lib > nul
|
||||
|
||||
goto EXIT
|
||||
|
||||
:CLEAN
|
||||
|
||||
if exist dll_b32.log del dll_b32.log
|
||||
|
||||
:EXIT
|
||||
|
||||
rem ---------------------------------------------------------------
|
||||
|
||||
rem Restore user value
|
||||
set COPYCMD=%HB_ORGENV_COPYCMD%
|
||||
@@ -1,187 +0,0 @@
|
||||
#
|
||||
# $Id$
|
||||
#
|
||||
# ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ general definition ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßßßßßßßßßßßßßß
|
||||
# BIN_DIR is defined in dll_55.bat, please adjust accordingly
|
||||
|
||||
CC = bcc32
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ source directory ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßßßßßßßßßßß
|
||||
# This is standard per repository
|
||||
|
||||
COMMON_DIR = .
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ obj file output directory ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
|
||||
# Please adjust according to your environment
|
||||
|
||||
OBJ_DIR = obj\dll\b32
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ include directory ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßßßßßßßßßßßß
|
||||
|
||||
INCLUDE_DIR = include;..\..\include;
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ compiler flags ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßßßßßßßßß
|
||||
|
||||
|
||||
C_USR = -tW -D__WIN32__ -D__EXPORT__
|
||||
CLIBFLAGS = $(C_USR) -a8 -OS -O2 -6 -c -I$(INCLUDE_DIR) -d -w-
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄ¿
|
||||
# ³ output ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßß
|
||||
# Please adjust according to your environment
|
||||
|
||||
HARBOUR_DLL = ..\..\lib\b32\hbziparchdll.dll
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ HARBOUR_DLL rules ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßßßßßßßßßßßß
|
||||
|
||||
HARBOUR_DLL_OBJS = \
|
||||
$(OBJ_DIR)\hbziparc.obj\
|
||||
$(OBJ_DIR)\hbcomprs.obj\
|
||||
$(OBJ_DIR)\ziparchive.obj\
|
||||
$(OBJ_DIR)\ZipPlatform_win.obj\
|
||||
$(OBJ_DIR)\zipstorage.obj\
|
||||
$(OBJ_DIR)\zipstring.obj\
|
||||
$(OBJ_DIR)\zipplatformcomm.obj\
|
||||
$(OBJ_DIR)\ZipPathComponent_win.obj\
|
||||
$(OBJ_DIR)\zipmemfile.obj\
|
||||
$(OBJ_DIR)\zipfileheader.obj\
|
||||
$(OBJ_DIR)\zipfile.obj\
|
||||
$(OBJ_DIR)\zipnew.obj\
|
||||
$(OBJ_DIR)\zipcomp.obj\
|
||||
$(OBJ_DIR)\zipexception.obj\
|
||||
$(OBJ_DIR)\zipcompatibility.obj\
|
||||
$(OBJ_DIR)\zipcentraldir.obj\
|
||||
$(OBJ_DIR)\zipautobuffer.obj\
|
||||
$(OBJ_DIR)\stdafx.obj
|
||||
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ project ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßß
|
||||
|
||||
all: \
|
||||
$(HARBOUR_DLL)
|
||||
|
||||
CLEAN:
|
||||
-@if exist $(HARBOUR_DLL) del $(HARBOUR_DLL) >nul
|
||||
-@if exist ..\..\lib\b32\hbziparchdll.tds del ..\..\lib\b32\hbziparchdll.tds >nul
|
||||
-@if exist ..\..\lib\b32\hbziparchdll.map del ..\..\lib\b32\hbziparchdll.map >nul
|
||||
-@if exist $(OBJ_DIR)\*.obj del $(OBJ_DIR)\*.obj >nul
|
||||
-@if exist $(OBJ_DIR)\*.c del $(OBJ_DIR)\*.c >nul
|
||||
-@if exist $(OBJ_DIR)\*.h del $(OBJ_DIR)\*.h >nul
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ Library dependencies and build rules ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßßß
|
||||
|
||||
$(HARBOUR_DLL) : \
|
||||
$(HARBOUR_DLL_OBJS)
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ HARBOUR_DLL linking ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßßßßßßßßßßßßßß
|
||||
echo. $(OBJ_DIR)\hbziparc.obj + > hdll.tmp
|
||||
echo. $(OBJ_DIR)\hbcomprs.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\ziparchive.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\ZipPlatform_win.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipstorage.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipstring.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipplatformcomm.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\ZipPathComponent_win.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipmemfile.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipfileheader.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipfile.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipnew.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipcomp.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipexception.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipcompatibility.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipcentraldir.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\zipautobuffer.obj + >> hdll.tmp
|
||||
echo. $(OBJ_DIR)\stdafx.obj + >> hdll.tmp
|
||||
echo. c0d32w.obj, + >> hdll.tmp
|
||||
echo. $(HARBOUR_DLL), + >> hdll.tmp
|
||||
echo. , + >> hdll.tmp
|
||||
echo. cw32.lib + >> hdll.tmp
|
||||
echo. ..\..\lib\harbour.lib + >> hdll.tmp
|
||||
echo. import32.lib + >> hdll.tmp
|
||||
echo. uuid.lib >> hdll.tmp
|
||||
ILINK32 -aa -Tpd -Gn @hdll.tmp
|
||||
|
||||
# ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
|
||||
# ³ object file creation ³Û
|
||||
# ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙÛ
|
||||
# ßßßßßßßßßßßßßßßßßßßßßßßß
|
||||
|
||||
$(OBJ_DIR)\hbziparc.obj : $(COMMON_DIR)\hbziparc.c
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\ziparchive.obj : $(COMMON_DIR)\ziparchive.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\ZipPlatform_win.obj : $(COMMON_DIR)\ZipPlatform_win.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipstorage.obj : $(COMMON_DIR)\zipstorage.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipstring.obj : $(COMMON_DIR)\zipstring.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipplatformcomm.obj : $(COMMON_DIR)\zipplatformcomm.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\ZipPathComponent_win.obj : $(COMMON_DIR)\ZipPathComponent_win.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipmemfile.obj : $(COMMON_DIR)\zipmemfile.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipfileheader.obj : $(COMMON_DIR)\zipfileheader.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipfile.obj : $(COMMON_DIR)\zipfile.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipnew.obj : $(COMMON_DIR)\zipnew.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipcomp.obj : $(COMMON_DIR)\zipcomp.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipexception.obj : $(COMMON_DIR)\zipexception.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipcompatibility.obj : $(COMMON_DIR)\zipcompatibility.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipcentraldir.obj : $(COMMON_DIR)\zipcentraldir.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\zipautobuffer.obj : $(COMMON_DIR)\zipautobuffer.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
|
||||
$(OBJ_DIR)\stdafx.obj : $(COMMON_DIR)\stdafx.cpp
|
||||
$(CC) $(CLIBFLAGS) -o$@ $**
|
||||
Reference in New Issue
Block a user