misc/libfreetype/src/gzip/zutil.h
author koda
Wed, 06 Mar 2013 16:42:56 +0100
changeset 8672 4cccc0520988
parent 5172 88f2e05288ba
permissions -rw-r--r--
our cmake modules have become good enough, prefer them over system ones
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5172
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     1
/* zutil.h -- internal interface and configuration of the compression library
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     2
 * Copyright (C) 1995-2002 Jean-loup Gailly.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     3
 * For conditions of distribution and use, see copyright notice in zlib.h
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     4
 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     5
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     6
/* WARNING: this file should *not* be used by applications. It is
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     7
   part of the implementation of the compression library and is
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     8
   subject to change. Applications should only use zlib.h.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
     9
 */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    10
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    11
/* @(#) $Id$ */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    12
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    13
#ifndef _Z_UTIL_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    14
#define _Z_UTIL_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    15
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    16
#include "zlib.h"
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    17
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    18
#ifdef STDC
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    19
#  include <stddef.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    20
#  include <string.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    21
#  include <stdlib.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    22
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    23
#ifdef NO_ERRNO_H
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    24
    extern int errno;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    25
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    26
#   include <errno.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    27
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    28
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    29
#ifndef local
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    30
#  define local static
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    31
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    32
/* compile with -Dlocal if your debugger can't find static symbols */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    33
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    34
typedef unsigned char  uch;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    35
typedef uch FAR uchf;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    36
typedef unsigned short ush;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    37
typedef ush FAR ushf;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    38
typedef unsigned long  ulg;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    39
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    40
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    41
#define ERR_RETURN(strm,err) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    42
  return (strm->msg = (char*)ERR_MSG(err), (err))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    43
/* To be used only when the state is known to be valid */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    44
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    45
        /* common constants */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    46
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    47
#ifndef DEF_WBITS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    48
#  define DEF_WBITS MAX_WBITS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    49
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    50
/* default windowBits for decompression. MAX_WBITS is for compression only */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    51
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    52
#if MAX_MEM_LEVEL >= 8
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    53
#  define DEF_MEM_LEVEL 8
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    54
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    55
#  define DEF_MEM_LEVEL  MAX_MEM_LEVEL
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    56
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    57
/* default memLevel */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    58
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    59
#define STORED_BLOCK 0
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    60
#define STATIC_TREES 1
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    61
#define DYN_TREES    2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    62
/* The three kinds of block type */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    63
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    64
#define MIN_MATCH  3
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    65
#define MAX_MATCH  258
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    66
/* The minimum and maximum match lengths */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    67
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    68
#define PRESET_DICT 0x20 /* preset dictionary flag in zlib header */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    69
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    70
        /* target dependencies */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    71
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    72
#ifdef MSDOS
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    73
#  define OS_CODE  0x00
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    74
#  if defined(__TURBOC__) || defined(__BORLANDC__)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    75
#    if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    76
       /* Allow compilation with ANSI keywords only enabled */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    77
       void _Cdecl farfree( void *block );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    78
       void *_Cdecl farmalloc( unsigned long nbytes );
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    79
#    else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    80
#     include <alloc.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    81
#    endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    82
#  else /* MSC or DJGPP */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    83
#  endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    84
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    85
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    86
#ifdef OS2
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    87
#  define OS_CODE  0x06
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    88
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    89
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    90
#ifdef WIN32 /* Window 95 & Windows NT */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    91
#  define OS_CODE  0x0b
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    92
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    93
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    94
#if defined(VAXC) || defined(VMS)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    95
#  define OS_CODE  0x02
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    96
#  define F_OPEN(name, mode) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    97
     ft_fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    98
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
    99
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   100
#ifdef AMIGA
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   101
#  define OS_CODE  0x01
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   102
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   103
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   104
#if defined(ATARI) || defined(atarist)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   105
#  define OS_CODE  0x05
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   106
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   107
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   108
#if defined(MACOS) || defined(TARGET_OS_MAC)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   109
#  define OS_CODE  0x07
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   110
#  if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   111
#    include <unix.h> /* for fdopen */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   112
#  else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   113
#    ifndef fdopen
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   114
#      define fdopen(fd,mode) NULL /* No fdopen() */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   115
#    endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   116
#  endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   117
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   118
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   119
#ifdef __50SERIES /* Prime/PRIMOS */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   120
#  define OS_CODE  0x0F
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   121
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   122
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   123
#ifdef TOPS20
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   124
#  define OS_CODE  0x0a
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   125
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   126
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   127
#if defined(_BEOS_) || defined(RISCOS)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   128
#  define fdopen(fd,mode) NULL /* No fdopen() */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   129
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   130
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   131
#if (defined(_MSC_VER) && (_MSC_VER > 600))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   132
#  define fdopen(fd,type)  _fdopen(fd,type)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   133
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   134
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   135
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   136
        /* Common defaults */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   137
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   138
#ifndef OS_CODE
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   139
#  define OS_CODE  0x03  /* assume Unix */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   140
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   141
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   142
#ifndef F_OPEN
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   143
#  define F_OPEN(name, mode) ft_fopen((name), (mode))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   144
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   145
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   146
         /* functions */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   147
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   148
#ifdef HAVE_STRERROR
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   149
   extern char *strerror OF((int));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   150
#  define zstrerror(errnum) strerror(errnum)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   151
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   152
#  define zstrerror(errnum) ""
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   153
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   154
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   155
#if defined(pyr)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   156
#  define NO_MEMCPY
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   157
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   158
#if defined(SMALL_MEDIUM) && !defined(_MSC_VER) && !defined(__SC__)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   159
 /* Use our own functions for small and medium model with MSC <= 5.0.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   160
  * You may have to use the same strategy for Borland C (untested).
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   161
  * The __SC__ check is for Symantec.
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   162
  */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   163
#  define NO_MEMCPY
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   164
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   165
#if defined(STDC) && !defined(HAVE_MEMCPY) && !defined(NO_MEMCPY)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   166
#  define HAVE_MEMCPY
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   167
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   168
#ifdef HAVE_MEMCPY
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   169
#  ifdef SMALL_MEDIUM /* MSDOS small or medium model */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   170
#    define zmemcpy _fmemcpy
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   171
#    define zmemcmp _fmemcmp
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   172
#    define zmemzero(dest, len) _fmemset(dest, 0, len)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   173
#  else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   174
#    define zmemcpy ft_memcpy
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   175
#    define zmemcmp ft_memcmp
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   176
#    define zmemzero(dest, len) ft_memset(dest, 0, len)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   177
#  endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   178
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   179
   extern void zmemcpy  OF((Bytef* dest, const Bytef* source, uInt len));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   180
   extern int  zmemcmp  OF((const Bytef* s1, const Bytef* s2, uInt len));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   181
   extern void zmemzero OF((Bytef* dest, uInt len));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   182
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   183
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   184
/* Diagnostic functions */
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   185
#ifdef DEBUG
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   186
#  include <stdio.h>
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   187
   extern int z_verbose;
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   188
   extern void z_error    OF((char *m));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   189
#  define Assert(cond,msg) {if(!(cond)) z_error(msg);}
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   190
#  define Trace(x) {if (z_verbose>=0) fprintf x ;}
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   191
#  define Tracev(x) {if (z_verbose>0) fprintf x ;}
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   192
#  define Tracevv(x) {if (z_verbose>1) fprintf x ;}
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   193
#  define Tracec(c,x) {if (z_verbose>0 && (c)) fprintf x ;}
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   194
#  define Tracecv(c,x) {if (z_verbose>1 && (c)) fprintf x ;}
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   195
#else
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   196
#  define Assert(cond,msg)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   197
#  define Trace(x)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   198
#  define Tracev(x)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   199
#  define Tracevv(x)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   200
#  define Tracec(c,x)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   201
#  define Tracecv(c,x)
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   202
#endif
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   203
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   204
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   205
typedef uLong (*check_func) OF((uLong check, const Bytef *buf,
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   206
                                uInt len));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   207
local voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   208
local void   zcfree  OF((voidpf opaque, voidpf ptr));
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   209
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   210
#define ZALLOC(strm, items, size) \
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   211
           (*((strm)->zalloc))((strm)->opaque, (items), (size))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   212
#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   213
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   214
88f2e05288ba aaand let's add freetype as well while we are at it
koda
parents:
diff changeset
   215
#endif /* _Z_UTIL_H */