ReactOS 0.4.15-dev-7918-g2a2556c
zutil.c File Reference
#include "zutil.h"
#include "gzguts.h"
Include dependency graph for zutil.c:

Go to the source code of this file.

Functions

const char *ZEXPORT zlibVersion ()
 
uLong ZEXPORT zlibCompileFlags ()
 
const char *ZEXPORT zError (int err)
 
void ZLIB_INTERNAL zmemcpy (Bytef *dest, const Bytef *source, uInt len)
 
int ZLIB_INTERNAL zmemcmp (Bytef *s1, const Bytef *s2, uInt len) const
 
void ZLIB_INTERNAL zmemzero (Bytef *dest, uInt len)
 
voidp malloc OF ((uInt size))
 
voidp calloc OF ((uInt items, uInt size))
 
void free OF ((voidpf ptr))
 
voidpf ZLIB_INTERNAL zcalloc (voidpf opaque, unsigned items, unsigned size)
 
void ZLIB_INTERNAL zcfree (voidpf opaque, voidpf ptr)
 

Variables

z_const char *const z_errmsg [10]
 

Function Documentation

◆ OF() [1/3]

voidp calloc OF ( (uInt items, uInt size )

◆ OF() [2/3]

voidp malloc OF ( (uInt size )

◆ OF() [3/3]

void free OF ( (voidpf ptr )

◆ zcalloc()

voidpf ZLIB_INTERNAL zcalloc ( voidpf  opaque,
unsigned  items,
unsigned  size 
)

Definition at line 307 of file zutil.c.

311{
312 (void)opaque;
313 return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
315}
#define malloc
Definition: debug_ros.c:4
void FAR * voidpf
Definition: zlib.h:42
unsigned int uInt
Definition: zlib.h:38
GLsizeiptr size
Definition: glext.h:5919
static TCHAR * items[]
Definition: page1.c:45
#define calloc
Definition: rosglue.h:14

◆ zcfree()

void ZLIB_INTERNAL zcfree ( voidpf  opaque,
voidpf  ptr 
)

Definition at line 317 of file zutil.c.

320{
321 (void)opaque;
322 free(ptr);
323}
#define free
Definition: debug_ros.c:5
static PVOID ptr
Definition: dispmode.c:27

◆ zError()

const char *ZEXPORT zError ( int  err)

Definition at line 135 of file zutil.c.

137{
138 return ERR_MSG(err);
139}
#define err(...)
#define ERR_MSG(err)
Definition: zutil.h:59

◆ zlibCompileFlags()

uLong ZEXPORT zlibCompileFlags ( )

Definition at line 32 of file zutil.c.

33{
35
36 flags = 0;
37 switch ((int)(sizeof(uInt))) {
38 case 2: break;
39 case 4: flags += 1; break;
40 case 8: flags += 2; break;
41 default: flags += 3;
42 }
43 switch ((int)(sizeof(uLong))) {
44 case 2: break;
45 case 4: flags += 1 << 2; break;
46 case 8: flags += 2 << 2; break;
47 default: flags += 3 << 2;
48 }
49 switch ((int)(sizeof(voidpf))) {
50 case 2: break;
51 case 4: flags += 1 << 4; break;
52 case 8: flags += 2 << 4; break;
53 default: flags += 3 << 4;
54 }
55 switch ((int)(sizeof(z_off_t))) {
56 case 2: break;
57 case 4: flags += 1 << 6; break;
58 case 8: flags += 2 << 6; break;
59 default: flags += 3 << 6;
60 }
61#ifdef ZLIB_DEBUG
62 flags += 1 << 8;
63#endif
64 /*
65#if defined(ASMV) || defined(ASMINF)
66 flags += 1 << 9;
67#endif
68 */
69#ifdef ZLIB_WINAPI
70 flags += 1 << 10;
71#endif
72#ifdef BUILDFIXED
73 flags += 1 << 12;
74#endif
75#ifdef DYNAMIC_CRC_TABLE
76 flags += 1 << 13;
77#endif
78#ifdef NO_GZCOMPRESS
79 flags += 1L << 16;
80#endif
81#ifdef NO_GZIP
82 flags += 1L << 17;
83#endif
84#ifdef PKZIP_BUG_WORKAROUND
85 flags += 1L << 20;
86#endif
87#ifdef FASTEST
88 flags += 1L << 21;
89#endif
90#if defined(STDC) || defined(Z_HAVE_STDARG_H)
91# ifdef NO_vsnprintf
92 flags += 1L << 25;
93# ifdef HAS_vsprintf_void
94 flags += 1L << 26;
95# endif
96# else
97# ifdef HAS_vsnprintf_void
98 flags += 1L << 26;
99# endif
100# endif
101#else
102 flags += 1L << 24;
103# ifdef NO_snprintf
104 flags += 1L << 25;
105# ifdef HAS_sprintf_void
106 flags += 1L << 26;
107# endif
108# else
109# ifdef HAS_snprintf_void
110 flags += 1L << 26;
111# endif
112# endif
113#endif
114 return flags;
115}
unsigned long uLong
Definition: zlib.h:39
GLbitfield flags
Definition: glext.h:7161
#define z_off_t
Definition: zconf.h:517

◆ zlibVersion()

const char *ZEXPORT zlibVersion ( )

Definition at line 27 of file zutil.c.

28{
29 return ZLIB_VERSION;
30}
#define ZLIB_VERSION
Definition: zlib.h:40

◆ zmemcmp()

int ZLIB_INTERNAL zmemcmp ( Bytef s1,
const Bytef s2,
uInt  len 
) const

Definition at line 162 of file zutil.c.

166{
167 uInt j;
168
169 for (j = 0; j < len; j++) {
170 if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
171 }
172 return 0;
173}
GLenum GLsizei len
Definition: glext.h:6722
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
struct S1 s1
struct S2 s2

◆ zmemcpy()

void ZLIB_INTERNAL zmemcpy ( Bytef dest,
const Bytef source,
uInt  len 
)

Definition at line 151 of file zutil.c.

155{
156 if (len == 0) return;
157 do {
158 *dest++ = *source++; /* ??? to be unrolled */
159 } while (--len != 0);
160}
static char * dest
Definition: rtl.c:135

◆ zmemzero()

void ZLIB_INTERNAL zmemzero ( Bytef dest,
uInt  len 
)

Definition at line 175 of file zutil.c.

178{
179 if (len == 0) return;
180 do {
181 *dest++ = 0; /* ??? to be unrolled */
182 } while (--len != 0);
183}

Variable Documentation

◆ z_errmsg

z_const char* const z_errmsg[10]
Initial value:
= {
(z_const char *)"need dictionary",
(z_const char *)"stream end",
(z_const char *)"",
(z_const char *)"file error",
(z_const char *)"stream error",
(z_const char *)"data error",
(z_const char *)"insufficient memory",
(z_const char *)"buffer error",
(z_const char *)"incompatible version",
(z_const char *)""
}
#define z_const
Definition: zlib.h:35

Definition at line 13 of file zutil.c.