/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code 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
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
/* zutil.c -- target dependent utility functions for the compression library
* Copyright (C) 1995-2005 Jean-loup Gailly.
* For conditions of distribution and use, see copyright notice in zlib.h
*/
/* @(#) $Id$ */
#include "zutil.h"
#ifndef NO_DUMMY_DECL
#endif
"need dictionary", /* Z_NEED_DICT 2 */
"stream end", /* Z_STREAM_END 1 */
"", /* Z_OK 0 */
"file error", /* Z_ERRNO (-1) */
"stream error", /* Z_STREAM_ERROR (-2) */
"data error", /* Z_DATA_ERROR (-3) */
"insufficient memory", /* Z_MEM_ERROR (-4) */
"buffer error", /* Z_BUF_ERROR (-5) */
"incompatible version",/* Z_VERSION_ERROR (-6) */
""};
{
return ZLIB_VERSION;
}
{
flags = 0;
switch (sizeof(uInt)) {
case 2: break;
default: flags += 3;
}
switch (sizeof(uLong)) {
case 2: break;
}
switch (sizeof(voidpf)) {
case 2: break;
}
switch (sizeof(z_off_t)) {
case 2: break;
}
#ifdef DEBUG
#endif
#endif
#ifdef ZLIB_WINAPI
#endif
#ifdef BUILDFIXED
#endif
#ifdef DYNAMIC_CRC_TABLE
#endif
#ifdef NO_GZCOMPRESS
#endif
#ifdef NO_GZIP
#endif
#ifdef PKZIP_BUG_WORKAROUND
#endif
#ifdef FASTEST
#endif
#ifdef STDC
# ifdef NO_vsnprintf
# ifdef HAS_vsprintf_void
# endif
# else
# ifdef HAS_vsnprintf_void
# endif
# endif
#else
# ifdef NO_snprintf
# ifdef HAS_sprintf_void
# endif
# else
# ifdef HAS_snprintf_void
# endif
# endif
#endif
return flags;
}
#ifdef DEBUG
# ifndef verbose
# define verbose 0
# endif
void z_error (m)
char *m;
{
exit(1);
}
#endif
/* exported to allow conversion of error code to string for compress() and
* uncompress()
*/
int err;
{
}
#if defined(_WIN32_WCE)
/* The Microsoft C Run-Time Library for Windows CE doesn't have
* errno. We define it as a global variable to simplify porting.
* Its value is always 0 and should not be used.
*/
int errno = 0;
#endif
#ifndef HAVE_MEMCPY
{
if (len == 0) return;
do {
} while (--len != 0);
}
{
uInt j;
for (j = 0; j < len; j++) {
}
return 0;
}
{
if (len == 0) return;
do {
*dest++ = 0; /* ??? to be unrolled */
} while (--len != 0);
}
#endif
#ifdef SYS16BIT
#ifdef __TURBOC__
/* Turbo C in 16-bit mode */
# define MY_ZCALLOC
/* Turbo C malloc() does not allow dynamic allocation of 64K bytes
* and farmalloc(64K) returns a pointer with an offset of 8, so we
* must fix the pointer. Warning: the pointer must be put back to its
* original form in order to free it, use zcfree().
*/
/* 10*64K = 640K */
typedef struct ptr_table_s {
} ptr_table;
/* This table is used to remember the original form of pointers
* to large buffers (64K). Such pointers are normalized with a zero offset.
* Since MSDOS is not a preemptive multitasking OS, this table is not
* protected from concurrent access. This hack doesn't work anyway on
* a protected system like OS/2. Use Microsoft C instead.
*/
{
/* If we allocate less than 65520 bytes, we assume that farmalloc
* will return a usable pointer which doesn't have to be normalized.
*/
if (bsize < 65520L) {
} else {
}
/* Normalize the pointer to seg:0 */
return buf;
}
{
int n;
return;
}
/* Find the original pointer */
for (n = 0; n < next_ptr; n++) {
while (++n < next_ptr) {
}
next_ptr--;
return;
}
Assert(0, "zcfree: ptr not found");
}
#endif /* __TURBOC__ */
#ifdef M_I86
/* Microsoft C in 16-bit mode */
# define MY_ZCALLOC
#endif
{
}
{
}
#endif /* M_I86 */
#endif /* SYS16BIT */
#ifndef MY_ZCALLOC /* Any system without a special alloc function */
#ifndef STDC
#endif
unsigned items;
unsigned size;
{
}
{
if (opaque) return; /* make compiler happy */
}
#endif /* MY_ZCALLOC */