2008-06-21 16:22 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
* contrib/hbfbird/firebird.c
! Fixed two bugs signaled by GCC 4.30.
* contrib/hbziparch/hbcomprs.c
* contrib/hbziparch/zip.c
* contrib/hbziparch/ziparchive.cpp
* contrib/hbziparch/include/zip.h
* contrib/hbziparch/include/ziparchive.h
* contrib/hbziparch/include/unzip.h
* contrib/hbziparch/include/zipinternalinfo.h
- contrib/hbziparch/include/hbcomprs.h
- contrib/hbziparch/include/zutil.h
- contrib/hbziparch/include/zconf.h
! Stripped an old version (1.1.4) of ZLIB embedded in this
contrib. Some warnings and even more security problems
fixed this way. Users of this lib should link hbzlib.lib
from now on.
! Fixed some warnings after recent update.
NOTE: One is still there (unused ..HBZIPCLEANUP function).
; NOTE: The quality of this code is not up to Harbour
standard. It compiles with a large amount of warnings
on all (BCC, MSVC, GCC) compilers. Also the included
ziparch source is dated.
Anybody volunteering to clear these up?
; NOTE: Please test these changes, I'm not a user of this
contrib.
[TOMERGE 1.0.0RC1]
This commit is contained in:
@@ -8,6 +8,35 @@
|
||||
2008-12-31 13:59 UTC+0100 Foo Bar <foo.bar@foobar.org>
|
||||
*/
|
||||
|
||||
2008-06-21 16:22 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* contrib/hbfbird/firebird.c
|
||||
! Fixed two bugs signaled by GCC 4.30.
|
||||
|
||||
* contrib/hbziparch/hbcomprs.c
|
||||
* contrib/hbziparch/zip.c
|
||||
* contrib/hbziparch/ziparchive.cpp
|
||||
* contrib/hbziparch/include/zip.h
|
||||
* contrib/hbziparch/include/ziparchive.h
|
||||
* contrib/hbziparch/include/unzip.h
|
||||
* contrib/hbziparch/include/zipinternalinfo.h
|
||||
- contrib/hbziparch/include/hbcomprs.h
|
||||
- contrib/hbziparch/include/zutil.h
|
||||
- contrib/hbziparch/include/zconf.h
|
||||
! Stripped an old version (1.1.4) of ZLIB embedded in this
|
||||
contrib. Some warnings and even more security problems
|
||||
fixed this way. Users of this lib should link hbzlib.lib
|
||||
from now on.
|
||||
! Fixed some warnings after recent update.
|
||||
NOTE: One is still there (unused ..HBZIPCLEANUP function).
|
||||
; NOTE: The quality of this code is not up to Harbour
|
||||
standard. It compiles with a large amount of warnings
|
||||
on all (BCC, MSVC, GCC) compilers. Also the included
|
||||
ziparch source is dated.
|
||||
Anybody volunteering to clear these up?
|
||||
; NOTE: Please test these changes, I'm not a user of this
|
||||
contrib.
|
||||
[TOMERGE 1.0.0RC1]
|
||||
|
||||
2008-06-21 12:00 UTC+0200 Viktor Szakats (harbour.01 syenar hu)
|
||||
* ChangeLog
|
||||
+ Marked changes merged with 1.0.0RC1.
|
||||
|
||||
@@ -522,20 +522,25 @@ HB_FUNC( FBGETDATA )
|
||||
|
||||
switch( dtype )
|
||||
{
|
||||
case SQL_SHORT:
|
||||
value = ( ISC_INT64 ) *( short * ) var->sqldata;
|
||||
field_width = 6;
|
||||
break;
|
||||
case SQL_SHORT:
|
||||
value = ( ISC_INT64 ) *( short * ) var->sqldata;
|
||||
field_width = 6;
|
||||
break;
|
||||
|
||||
case SQL_LONG:
|
||||
value = ( ISC_INT64 ) *( long * ) var->sqldata;
|
||||
field_width = 11;
|
||||
break;
|
||||
case SQL_LONG:
|
||||
value = ( ISC_INT64 ) *( long * ) var->sqldata;
|
||||
field_width = 11;
|
||||
break;
|
||||
|
||||
case SQL_INT64:
|
||||
value = ( ISC_INT64 ) *( ISC_INT64 * ) var->sqldata;
|
||||
field_width = 21;
|
||||
break;
|
||||
case SQL_INT64:
|
||||
value = ( ISC_INT64 ) *( ISC_INT64 * ) var->sqldata;
|
||||
field_width = 21;
|
||||
break;
|
||||
|
||||
default:
|
||||
value = 0;
|
||||
field_width = 10;
|
||||
break;
|
||||
}
|
||||
|
||||
dscale = var->sqlscale;
|
||||
@@ -605,9 +610,6 @@ HB_FUNC( FBGETBLOB )
|
||||
char p[ MAX_BUFFER ];
|
||||
long blob_stat;
|
||||
|
||||
PHB_ITEM temp;
|
||||
PHB_ITEM aNew;
|
||||
|
||||
if( ISPOINTER( 3 ) )
|
||||
{
|
||||
trans = ( isc_tr_handle ) hb_parptr( 3 );
|
||||
@@ -631,26 +633,31 @@ HB_FUNC( FBGETBLOB )
|
||||
sizeof( blob_segment ), blob_segment );
|
||||
|
||||
if( blob_stat == 0 || status[ 1 ] == isc_segment )
|
||||
aNew = hb_itemArrayNew( 0 );
|
||||
|
||||
while( blob_stat == 0 || status[ 1 ] == isc_segment )
|
||||
{
|
||||
/* p = ( char * ) hb_xgrab( blob_seg_len + 1 ); */
|
||||
snprintf( p, sizeof( p ), "%*.*s", blob_seg_len, blob_seg_len, blob_segment );
|
||||
PHB_ITEM aNew = hb_itemArrayNew( 0 );
|
||||
|
||||
temp = hb_itemPutC( NULL, p );
|
||||
hb_arrayAdd( aNew, temp );
|
||||
hb_itemRelease( temp );
|
||||
while( blob_stat == 0 || status[ 1 ] == isc_segment )
|
||||
{
|
||||
PHB_ITEM temp;
|
||||
|
||||
/* hb_xfree(p); */
|
||||
blob_stat = isc_get_segment( status, &blob_handle,
|
||||
( unsigned short * ) &blob_seg_len,
|
||||
sizeof( blob_segment ), blob_segment );
|
||||
/* p = ( char * ) hb_xgrab( blob_seg_len + 1 ); */
|
||||
snprintf( p, sizeof( p ), "%*.*s", blob_seg_len, blob_seg_len, blob_segment );
|
||||
|
||||
temp = hb_itemPutC( NULL, p );
|
||||
hb_arrayAdd( aNew, temp );
|
||||
hb_itemRelease( temp );
|
||||
|
||||
/* hb_xfree(p); */
|
||||
blob_stat = isc_get_segment( status, &blob_handle,
|
||||
( unsigned short * ) &blob_seg_len,
|
||||
sizeof( blob_segment ), blob_segment );
|
||||
}
|
||||
|
||||
hb_itemReturnRelease( aNew );
|
||||
}
|
||||
|
||||
if( isc_close_blob( status, &blob_handle ) )
|
||||
{
|
||||
hb_itemRelease( aNew );
|
||||
ERREXIT( status );
|
||||
}
|
||||
|
||||
@@ -661,6 +668,4 @@ HB_FUNC( FBGETBLOB )
|
||||
ERREXIT( status );
|
||||
}
|
||||
}
|
||||
|
||||
hb_itemReturnRelease( aNew );
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -41,9 +41,7 @@
|
||||
#ifndef _unz_H
|
||||
#define _unz_H
|
||||
|
||||
#ifndef _HBCOMPRESS_H
|
||||
#include "hbcomprs.h"
|
||||
#endif
|
||||
#include "hbzlib.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -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 <windows.h>
|
||||
# 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 <windows.h>
|
||||
# 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 <sys/types.h> /* for off_t */
|
||||
# include <unistd.h> /* 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 */
|
||||
@@ -46,9 +46,8 @@
|
||||
#define _zip_H
|
||||
|
||||
|
||||
#ifndef _HBCOMPRESS_H
|
||||
#include "hbcomprs.h"
|
||||
#endif
|
||||
#include "hbzlib.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
|
||||
@@ -83,9 +83,7 @@
|
||||
//#ifdef __cplusplus
|
||||
//extern "C" {
|
||||
//#endif
|
||||
#ifndef _HBCOMPRESS_H
|
||||
#include "hbcomprs.h"
|
||||
#endif
|
||||
#include "hbzlib.h"
|
||||
//#ifdef __cplusplus
|
||||
//}
|
||||
//#endif
|
||||
|
||||
@@ -22,11 +22,7 @@
|
||||
#pragma once
|
||||
#endif // _MSC_VER > 1000
|
||||
#include "zipautobuffer.h"
|
||||
#include "zconf.h"
|
||||
|
||||
#ifndef _HBCOMPRESS_H
|
||||
#include "hbcomprs.h"
|
||||
#endif
|
||||
#include "hbzlib.h"
|
||||
|
||||
/**
|
||||
The purpose of this structure is to hold the data that allow communication
|
||||
|
||||
@@ -1,218 +0,0 @@
|
||||
/* zutil.h -- internal interface and configuration of the compression library
|
||||
* Copyright (C) 1995-2002 Jean-loup Gailly.
|
||||
* For conditions of distribution and use, see copyright notice in zlib.h
|
||||
*/
|
||||
|
||||
/* WARNING: this file should *not* be used by applications. It is
|
||||
part of the implementation of the compression library and is
|
||||
subject to change. Applications should only use zlib.h.
|
||||
*/
|
||||
|
||||
/* @(#) $Id$ */
|
||||
|
||||
#ifndef _Z_UTIL_H
|
||||
#define _Z_UTIL_H
|
||||
|
||||
#include "hbcomprs.h"
|
||||
|
||||
#ifdef STDC
|
||||
# include <stddef.h>
|
||||
# include <string.h>
|
||||
# include <stdlib.h>
|
||||
#endif
|
||||
#ifdef NO_ERRNO_H
|
||||
extern int errno;
|
||||
#else
|
||||
# include <errno.h>
|
||||
#endif
|
||||
|
||||
#ifndef local
|
||||
# define local static
|
||||
#endif
|
||||
/* compile with -Dlocal if your debugger can't find static symbols */
|
||||
|
||||
typedef unsigned char uch;
|
||||
typedef uch FAR uchf;
|
||||
typedef unsigned short ush;
|
||||
typedef ush FAR ushf;
|
||||
typedef unsigned long ulg;
|
||||
|
||||
extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
|
||||
/* (size given to avoid silly warnings with Visual C++) */
|
||||
|
||||
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
|
||||
|
||||
#define ERR_RETURN(strm,err) \
|
||||
return (strm->msg = (char*)ERR_MSG(err), (err))
|
||||
/* To be used only when the state is known to be valid */
|
||||
|
||||
/* common constants */
|
||||
|
||||
#ifndef DEF_WBITS
|
||||
# define DEF_WBITS MAX_WBITS
|
||||
#endif
|
||||
/* default windowBits for decompression. MAX_WBITS is for compression only */
|
||||
|
||||
#if MAX_MEM_LEVEL >= 8
|
||||
# define DEF_MEM_LEVEL 8
|
||||
#else
|
||||
# define DEF_MEM_LEVEL MAX_MEM_LEVEL
|
||||
#endif
|
||||
/* default memLevel */
|
||||
|
||||
#define STORED_BLOCK 0
|
||||
#define STATIC_TREES 1
|
||||
#define DYN_TREES 2
|
||||
/* The three kinds of block type */
|
||||
|
||||
#define MIN_MATCH 3
|
||||
#define MAX_MATCH 258
|
||||
/* The minimum and maximum match lengths */
|
||||
|
||||
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
|
||||
|
||||
/* target dependencies */
|
||||
|
||||
#ifdef MSDOS
|
||||
# define OS_CODE 0x00
|
||||
# if defined(__TURBOC__) || defined(__BORLANDC__)
|
||||
# if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
|
||||
/* Allow compilation with ANSI keywords only enabled */
|
||||
void _Cdecl farfree( void *block );
|
||||
void *_Cdecl farmalloc( unsigned long nbytes );
|
||||
# else
|
||||
# include <alloc.h>
|
||||
# endif
|
||||
# else /* MSC or DJGPP */
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef OS2
|
||||
# define OS_CODE 0x06
|
||||
#endif
|
||||
|
||||
#ifdef WIN32 /* Window 95 & Windows NT */
|
||||
# define OS_CODE 0x0b
|
||||
#endif
|
||||
|
||||
#if defined(VAXC) || defined(VMS)
|
||||
# define OS_CODE 0x02
|
||||
# define F_OPEN(name, mode) \
|
||||
fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
|
||||
#endif
|
||||
|
||||
#ifdef AMIGA
|
||||
# define OS_CODE 0x01
|
||||
#endif
|
||||
|
||||
#if defined(ATARI) || defined(atarist)
|
||||
# define OS_CODE 0x05
|
||||
#endif
|
||||
|
||||
#if defined(MACOS) || defined(TARGET_OS_MAC)
|
||||
# define OS_CODE 0x07
|
||||
# if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
|
||||
# include <unix.h> /* for fdopen */
|
||||
# else
|
||||
# ifndef fdopen
|
||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
|
||||
#ifdef __50SERIES /* Prime/PRIMOS */
|
||||
# define OS_CODE 0x0F
|
||||
#endif
|
||||
|
||||
#ifdef TOPS20
|
||||
# define OS_CODE 0x0a
|
||||
#endif
|
||||
|
||||
#if defined(_BEOS_) || defined(RISCOS)
|
||||
# define fdopen(fd,mode) NULL /* No fdopen() */
|
||||
#endif
|
||||
|
||||
#if (defined(_MSC_VER) && (_MSC_VER > 600))
|
||||
# define fdopen(fd,type) _fdopen(fd,type)
|
||||
#endif
|
||||
|
||||
|
||||
/* Common defaults */
|
||||
|
||||
#ifndef OS_CODE
|
||||
# define OS_CODE 0x03 /* assume Unix */
|
||||
#endif
|
||||
|
||||
#ifndef F_OPEN
|
||||
# define F_OPEN(name, mode) fopen((name), (mode))
|
||||
#endif
|
||||
|
||||
/* functions */
|
||||
|
||||
#ifdef HAVE_STRERROR
|
||||
extern char *strerror OF((int));
|
||||
# define zstrerror(errnum) strerror(errnum)
|
||||
#else
|
||||
# define zstrerror(errnum) ""
|
||||
#endif
|
||||
|
||||
#if defined(pyr)
|
||||
# define NO_MEMCPY
|
||||
#endif
|
||||
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
|
||||
/* Use our own functions for small and medium model with MSC <= 5.0.
|
||||
* You may have to use the same strategy for Borland C (untested).
|
||||
* The __SC__ check is for Symantec.
|
||||
*/
|
||||
# define NO_MEMCPY
|
||||
#endif
|
||||
#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
|
||||
# define HAVE_MEMCPY
|
||||
#endif
|
||||
#ifdef HAVE_MEMCPY
|
||||
# ifdef SMALL_MEDIUM /* MSDOS small or medium model */
|
||||
# define zmemcpy _fmemcpy
|
||||
# define zmemcmp _fmemcmp
|
||||
# define zmemzero(dest, len) _fmemset(dest, 0, len)
|
||||
# else
|
||||
# define zmemcpy memcpy
|
||||
# define zmemcmp memcmp
|
||||
# define zmemzero(dest, len) memset(dest, 0, len)
|
||||
# endif
|
||||
#else
|
||||
extern void zmemcpy OF((Bytef* dest, const Bytef* source, uInt len));
|
||||
extern int zmemcmp OF((const Bytef* s1, const Bytef* s2, uInt len));
|
||||
extern void zmemzero OF((Bytef* dest, uInt len));
|
||||
#endif
|
||||
|
||||
/* Diagnostic functions */
|
||||
#ifdef DEBUG
|
||||
# include <stdio.h>
|
||||
extern int z_verbose;
|
||||
extern void z_error OF((char *m));
|
||||
# define Assert(cond,msg) {if(!(cond)) z_error(msg);}
|
||||
# define Trace(x) {if (z_verbose>=0) fprintf x ;}
|
||||
# define Tracev(x) {if (z_verbose>0) fprintf x ;}
|
||||
# define Tracevv(x) {if (z_verbose>1) fprintf x ;}
|
||||
# define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
|
||||
# define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
|
||||
#else
|
||||
# define Assert(cond,msg)
|
||||
# define Trace(x)
|
||||
# define Tracev(x)
|
||||
# define Tracevv(x)
|
||||
# define Tracec(c,x)
|
||||
# define Tracecv(c,x)
|
||||
#endif
|
||||
|
||||
typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf, uInt len));
|
||||
|
||||
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
|
||||
void zcfree OF((voidpf opaque, voidpf ptr));
|
||||
|
||||
#define ZALLOC(strm, items, size) (*((strm)->zalloc))((strm)->opaque, (items), (size))
|
||||
#define ZFREE(strm, addr) (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
|
||||
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
|
||||
|
||||
#endif /* _Z_UTIL_H */
|
||||
@@ -98,7 +98,7 @@ static void ResetAttribs( void )
|
||||
hb_itemRelease( FileToZip );
|
||||
}
|
||||
|
||||
static void UnzipCreateArray( char *szZipFileName, char *szSkleton, int uiOption)
|
||||
static void UnzipCreateArray( char *szSkleton, int uiOption)
|
||||
{
|
||||
int ul;
|
||||
char * szEntry;
|
||||
@@ -713,7 +713,7 @@ HB_FUNC( HB_UNZIPFILE )
|
||||
{
|
||||
if( HB_IS_STRING( pUnzip ) )
|
||||
{
|
||||
UnzipCreateArray( szZipFileName, hb_itemGetCPtr( pUnzip ), 1 );
|
||||
UnzipCreateArray( hb_itemGetCPtr( pUnzip ), 1 );
|
||||
}
|
||||
else if( HB_IS_ARRAY( pUnzip ) )
|
||||
{
|
||||
@@ -726,7 +726,7 @@ HB_FUNC( HB_UNZIPFILE )
|
||||
|
||||
if ( szUnzip )
|
||||
{
|
||||
UnzipCreateArray( szZipFileName, szUnzip, 1 );
|
||||
UnzipCreateArray( szUnzip, 1 );
|
||||
hb_xfree( szUnzip );
|
||||
}
|
||||
}
|
||||
@@ -735,7 +735,7 @@ HB_FUNC( HB_UNZIPFILE )
|
||||
else
|
||||
{
|
||||
//s.r. change "*.*" to "*" because file without extension were ignored
|
||||
UnzipCreateArray( szZipFileName, (char*) "*", 1 );
|
||||
UnzipCreateArray( (char*) "*", 1 );
|
||||
}
|
||||
if ( hb_arrayLen(UnzipFiles) > 0 )
|
||||
{
|
||||
@@ -802,7 +802,7 @@ HB_FUNC( HB_ZIPDELETEFILES )
|
||||
{
|
||||
if ( hb_itemGetCLen( pDelZip ) > 0 )
|
||||
{
|
||||
UnzipCreateArray( szZipFileName, hb_itemGetCPtr( pDelZip ), 2 );
|
||||
UnzipCreateArray( hb_itemGetCPtr( pDelZip ), 2 );
|
||||
}
|
||||
}
|
||||
else if ( HB_IS_ARRAY( pDelZip ) )
|
||||
@@ -820,7 +820,7 @@ HB_FUNC( HB_ZIPDELETEFILES )
|
||||
|
||||
if( szInput )
|
||||
{
|
||||
UnzipCreateArray( szZipFileName, szInput, 2 );
|
||||
UnzipCreateArray( szInput, 2 );
|
||||
hb_xfree( szInput );
|
||||
}
|
||||
}
|
||||
@@ -1011,14 +1011,13 @@ HB_FUNC(HB_UNZIPALLFILE)
|
||||
}
|
||||
}
|
||||
|
||||
HB_FUNC_EXIT(HBZIPCLEANUP)
|
||||
HB_FUNC_EXIT( HBZIPCLEANUP )
|
||||
{
|
||||
if ( ChangeDiskBlock )
|
||||
if( ChangeDiskBlock )
|
||||
{
|
||||
hb_itemRelease( ChangeDiskBlock );
|
||||
ChangeDiskBlock = NULL ;
|
||||
ChangeDiskBlock = NULL;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1026,12 +1025,13 @@ HB_FUNC_EXIT(HBZIPCLEANUP)
|
||||
|
||||
int GetFileAttributes( char *szEntry )
|
||||
{
|
||||
struct stat sStat;
|
||||
stat( szEntry, &sStat );
|
||||
return (int) sStat.st_mode;
|
||||
struct stat sStat;
|
||||
stat( szEntry, &sStat );
|
||||
return (int) sStat.st_mode;
|
||||
}
|
||||
void SetFileAttributes( char * szEntry,ULONG ulAttr)
|
||||
{
|
||||
chmod(szEntry,ulAttr);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
@@ -15,7 +15,6 @@
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
#include "hbcomprs.h"
|
||||
#include "stdafx.h"
|
||||
#include "ziparchive.h"
|
||||
// #include "ZipPathComponent.h"
|
||||
|
||||
Reference in New Issue
Block a user