~ubuntu-branches/ubuntu/lucid/perl-tk/lucid

« back to all changes in this revision

Viewing changes to PNG/zlib/zutil.h

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2008-02-15 13:56:59 UTC
  • mfrom: (1.1.3 upstream) (4.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080215135659-ru2oqlykuju20fav
Tags: 1:804.028-1
* New Upstream Release (Closes: #463080).
* Update to Debhelper v5.
* Build with XFT=1 (Closes: #411129).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* zutil.h -- internal interface and configuration of the compression library
2
 
 * Copyright (C) 1995-2002 Jean-loup Gailly.
 
2
 * Copyright (C) 1995-2005 Jean-loup Gailly.
3
3
 * For conditions of distribution and use, see copyright notice in zlib.h
4
4
 */
5
5
 
10
10
 
11
11
/* @(#) $Id$ */
12
12
 
13
 
#ifndef _Z_UTIL_H
14
 
#define _Z_UTIL_H
 
13
#ifndef ZUTIL_H
 
14
#define ZUTIL_H
15
15
 
 
16
#define ZLIB_INTERNAL
16
17
#include "zlib.h"
17
18
 
18
19
#ifdef STDC
19
 
#  include <stddef.h>
 
20
#  ifndef _WIN32_WCE
 
21
#    include <stddef.h>
 
22
#  endif
20
23
#  include <string.h>
21
24
#  include <stdlib.h>
22
25
#endif
23
26
#ifdef NO_ERRNO_H
 
27
#   ifdef _WIN32_WCE
 
28
      /* The Microsoft C Run-Time Library for Windows CE doesn't have
 
29
       * errno.  We define it as a global variable to simplify porting.
 
30
       * Its value is always 0 and should not be used.  We rename it to
 
31
       * avoid conflict with other libraries that use the same workaround.
 
32
       */
 
33
#     define errno z_errno
 
34
#   endif
24
35
    extern int errno;
25
36
#else
26
 
#   include <errno.h>
 
37
#  ifndef _WIN32_WCE
 
38
#    include <errno.h>
 
39
#  endif
27
40
#endif
28
41
 
29
42
#ifndef local
37
50
typedef ush FAR ushf;
38
51
typedef unsigned long  ulg;
39
52
 
40
 
extern const char *z_errmsg[10]; /* indexed by 2-zlib_error */
 
53
extern const char * const z_errmsg[10]; /* indexed by 2-zlib_error */
41
54
/* (size given to avoid silly warnings with Visual C++) */
42
55
 
43
56
#define ERR_MSG(err) z_errmsg[Z_NEED_DICT-(err)]
73
86
 
74
87
        /* target dependencies */
75
88
 
76
 
#ifdef MSDOS
 
89
#if defined(MSDOS) || (defined(WINDOWS) && !defined(WIN32))
77
90
#  define OS_CODE  0x00
78
91
#  if defined(__TURBOC__) || defined(__BORLANDC__)
79
92
#    if(__STDC__ == 1) && (defined(__LARGE__) || defined(__COMPACT__))
81
94
       void _Cdecl farfree( void *block );
82
95
       void *_Cdecl farmalloc( unsigned long nbytes );
83
96
#    else
84
 
#     include <alloc.h>
 
97
#      include <alloc.h>
85
98
#    endif
86
99
#  else /* MSC or DJGPP */
87
100
#    include <malloc.h>
88
101
#  endif
89
102
#endif
90
103
 
91
 
#ifdef OS2
92
 
#  define OS_CODE  0x06
93
 
#endif
94
 
 
95
 
#ifdef WIN32 /* Window 95 & Windows NT */
96
 
#  define OS_CODE  0x0b
 
104
#ifdef AMIGA
 
105
#  define OS_CODE  0x01
97
106
#endif
98
107
 
99
108
#if defined(VAXC) || defined(VMS)
102
111
     fopen((name), (mode), "mbc=60", "ctx=stm", "rfm=fix", "mrs=512")
103
112
#endif
104
113
 
105
 
#ifdef AMIGA
106
 
#  define OS_CODE  0x01
107
 
#endif
108
 
 
109
114
#if defined(ATARI) || defined(atarist)
110
115
#  define OS_CODE  0x05
111
116
#endif
112
117
 
 
118
#ifdef OS2
 
119
#  define OS_CODE  0x06
 
120
#  ifdef M_I86
 
121
     #include <malloc.h>
 
122
#  endif
 
123
#endif
 
124
 
113
125
#if defined(MACOS) || defined(TARGET_OS_MAC)
114
126
#  define OS_CODE  0x07
115
127
#  if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
121
133
#  endif
122
134
#endif
123
135
 
124
 
#ifdef __50SERIES /* Prime/PRIMOS */
125
 
#  define OS_CODE  0x0F
126
 
#endif
127
 
 
128
136
#ifdef TOPS20
129
137
#  define OS_CODE  0x0a
130
138
#endif
131
139
 
 
140
#ifdef WIN32
 
141
#  ifndef __CYGWIN__  /* Cygwin is Unix, not Win32 */
 
142
#    define OS_CODE  0x0b
 
143
#  endif
 
144
#endif
 
145
 
 
146
#ifdef __50SERIES /* Prime/PRIMOS */
 
147
#  define OS_CODE  0x0f
 
148
#endif
 
149
 
132
150
#if defined(_BEOS_) || defined(RISCOS)
133
151
#  define fdopen(fd,mode) NULL /* No fdopen() */
134
152
#endif
135
153
 
136
154
#if (defined(_MSC_VER) && (_MSC_VER > 600))
137
 
#  define fdopen(fd,type)  _fdopen(fd,type)
 
155
#  if defined(_WIN32_WCE)
 
156
#    define fdopen(fd,mode) NULL /* No fdopen() */
 
157
#    ifndef _PTRDIFF_T_DEFINED
 
158
       typedef int ptrdiff_t;
 
159
#      define _PTRDIFF_T_DEFINED
 
160
#    endif
 
161
#  else
 
162
#    define fdopen(fd,type)  _fdopen(fd,type)
 
163
#  endif
138
164
#endif
139
165
 
140
 
 
141
 
        /* Common defaults */
 
166
        /* common defaults */
142
167
 
143
168
#ifndef OS_CODE
144
169
#  define OS_CODE  0x03  /* assume Unix */
150
175
 
151
176
         /* functions */
152
177
 
153
 
#ifdef HAVE_STRERROR
154
 
   extern char *strerror OF((int));
155
 
#  define zstrerror(errnum) strerror(errnum)
156
 
#else
157
 
#  define zstrerror(errnum) ""
 
178
#if defined(STDC99) || (defined(__TURBOC__) && __TURBOC__ >= 0x550)
 
179
#  ifndef HAVE_VSNPRINTF
 
180
#    define HAVE_VSNPRINTF
 
181
#  endif
 
182
#endif
 
183
#if defined(__CYGWIN__)
 
184
#  ifndef HAVE_VSNPRINTF
 
185
#    define HAVE_VSNPRINTF
 
186
#  endif
 
187
#endif
 
188
#ifndef HAVE_VSNPRINTF
 
189
#  ifdef MSDOS
 
190
     /* vsnprintf may exist on some MS-DOS compilers (DJGPP?),
 
191
        but for now we just assume it doesn't. */
 
192
#    define NO_vsnprintf
 
193
#  endif
 
194
#  ifdef __TURBOC__
 
195
#    define NO_vsnprintf
 
196
#  endif
 
197
#  ifdef WIN32
 
198
     /* In Win32, vsnprintf is available as the "non-ANSI" _vsnprintf. */
 
199
#    if !defined(vsnprintf) && !defined(NO_vsnprintf)
 
200
#      define vsnprintf _vsnprintf
 
201
#    endif
 
202
#  endif
 
203
#  ifdef __SASC
 
204
#    define NO_vsnprintf
 
205
#  endif
 
206
#endif
 
207
#ifdef VMS
 
208
#  define NO_vsnprintf
158
209
#endif
159
210
 
160
211
#if defined(pyr)
207
258
#endif
208
259
 
209
260
 
210
 
typedef uLong (ZEXPORT *check_func) OF((uLong check, const Bytef *buf,
211
 
                                       uInt len));
212
261
voidpf zcalloc OF((voidpf opaque, unsigned items, unsigned size));
213
262
void   zcfree  OF((voidpf opaque, voidpf ptr));
214
263
 
217
266
#define ZFREE(strm, addr)  (*((strm)->zfree))((strm)->opaque, (voidpf)(addr))
218
267
#define TRY_FREE(s, p) {if (p) ZFREE(s, p);}
219
268
 
220
 
#endif /* _Z_UTIL_H */
 
269
#endif /* ZUTIL_H */