ReactOS  0.4.14-dev-376-gaedba84
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 malloc OF ( (uInt size )

◆ OF() [2/3]

voidp calloc OF ( (uInt items, uInt size )

◆ OF() [3/3]

void free OF ( (voidpf ptr )

◆ zcalloc()

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

Definition at line 305 of file zutil.c.

309 {
310  (void)opaque;
311  return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
312  (voidpf)calloc(items, size);
313 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
GLsizeiptr size
Definition: glext.h:5919
Byte FAR * voidpf
Definition: zconf.h:413
#define calloc
Definition: rosglue.h:14
#define malloc
Definition: debug_ros.c:4
static TCHAR * items[]
Definition: page1.c:45
unsigned int uInt
Definition: zconf.h:393

◆ zcfree()

void ZLIB_INTERNAL zcfree ( voidpf  opaque,
voidpf  ptr 
)

Definition at line 315 of file zutil.c.

318 {
319  (void)opaque;
320  free(ptr);
321 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define free
Definition: debug_ros.c:5
static PVOID ptr
Definition: dispmode.c:27

◆ zError()

const char* ZEXPORT zError ( int  err)

Definition at line 133 of file zutil.c.

135 {
136  return ERR_MSG(err);
137 }
#define ERR_MSG(err)
Definition: zutil.h:52
#define err(...)

◆ zlibCompileFlags()

uLong ZEXPORT zlibCompileFlags ( )

Definition at line 32 of file zutil.c.

33 {
34  uLong flags;
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 #if defined(ASMV) || defined(ASMINF)
65  flags += 1 << 9;
66 #endif
67 #ifdef ZLIB_WINAPI
68  flags += 1 << 10;
69 #endif
70 #ifdef BUILDFIXED
71  flags += 1 << 12;
72 #endif
73 #ifdef DYNAMIC_CRC_TABLE
74  flags += 1 << 13;
75 #endif
76 #ifdef NO_GZCOMPRESS
77  flags += 1L << 16;
78 #endif
79 #ifdef NO_GZIP
80  flags += 1L << 17;
81 #endif
82 #ifdef PKZIP_BUG_WORKAROUND
83  flags += 1L << 20;
84 #endif
85 #ifdef FASTEST
86  flags += 1L << 21;
87 #endif
88 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
89 # ifdef NO_vsnprintf
90  flags += 1L << 25;
91 # ifdef HAS_vsprintf_void
92  flags += 1L << 26;
93 # endif
94 # else
95 # ifdef HAS_vsnprintf_void
96  flags += 1L << 26;
97 # endif
98 # endif
99 #else
100  flags += 1L << 24;
101 # ifdef NO_snprintf
102  flags += 1L << 25;
103 # ifdef HAS_sprintf_void
104  flags += 1L << 26;
105 # endif
106 # else
107 # ifdef HAS_snprintf_void
108  flags += 1L << 26;
109 # endif
110 # endif
111 #endif
112  return flags;
113 }
#define z_off_t
Definition: zconf.h:504
unsigned long uLong
Definition: zconf.h:394
GLbitfield flags
Definition: glext.h:7161
static const WCHAR L[]
Definition: oid.c:1250
Byte FAR * voidpf
Definition: zconf.h:413
unsigned int uInt
Definition: zconf.h:393

◆ 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 160 of file zutil.c.

164 {
165  uInt j;
166 
167  for (j = 0; j < len; j++) {
168  if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
169  }
170  return 0;
171 }
struct S2 s2
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
GLenum GLsizei len
Definition: glext.h:6722
unsigned int uInt
Definition: zconf.h:393

◆ zmemcpy()

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

Definition at line 149 of file zutil.c.

153 {
154  if (len == 0) return;
155  do {
156  *dest++ = *source++; /* ??? to be unrolled */
157  } while (--len != 0);
158 }
GLenum GLsizei len
Definition: glext.h:6722
static char * dest
Definition: rtl.c:135

◆ zmemzero()

void ZLIB_INTERNAL zmemzero ( Bytef dest,
uInt  len 
)

Definition at line 173 of file zutil.c.

176 {
177  if (len == 0) return;
178  do {
179  *dest++ = 0; /* ??? to be unrolled */
180  } while (--len != 0);
181 }
GLenum GLsizei len
Definition: glext.h:6722
static char * dest
Definition: rtl.c:135

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: zconf.h:237

Definition at line 13 of file zutil.c.