Prusa MINI Firmware overview
zutil.c File Reference
#include "zutil.h"
#include "gzguts.h"

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

◆ zlibVersion()

const char* ZEXPORT zlibVersion ( )
28 {
29  return ZLIB_VERSION;
30 }

◆ zlibCompileFlags()

uLong ZEXPORT zlibCompileFlags ( )
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 }

◆ zError()

const char* ZEXPORT zError ( int  err)
135 {
136  return ERR_MSG(err);
137 }

◆ zmemcpy()

void ZLIB_INTERNAL zmemcpy ( Bytef dest,
const Bytef source,
uInt  len 
)
153 {
154  if (len == 0) return;
155  do {
156  *dest++ = *source++; /* ??? to be unrolled */
157  } while (--len != 0);
158 }
Here is the caller graph for this function:

◆ zmemcmp()

int ZLIB_INTERNAL zmemcmp ( Bytef s1,
const Bytef s2,
uInt  len 
) const
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 }

◆ zmemzero()

void ZLIB_INTERNAL zmemzero ( Bytef dest,
uInt  len 
)
176 {
177  if (len == 0) return;
178  do {
179  *dest++ = 0; /* ??? to be unrolled */
180  } while (--len != 0);
181 }
Here is the caller graph for this function:

◆ 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 
)
309 {
310  (void)opaque;
311  return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
312  (voidpf)calloc(items, size);
313 }
Here is the caller graph for this function:

◆ zcfree()

void ZLIB_INTERNAL zcfree ( voidpf  opaque,
voidpf  ptr 
)
318 {
319  (void)opaque;
320  free(ptr);
321 }
Here is the caller graph for this function:

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 *)""
}
items
const char items[11][6]
Definition: window_list.c:5
inflate_state::flags
int flags
Definition: inflate.h:89
uLong
unsigned long uLong
Definition: zconf.h:394
z_off_t
#define z_off_t
Definition: zconf.h:504
ZLIB_VERSION
#define ZLIB_VERSION
Definition: zlib.h:40
voidpf
Byte FAR * voidpf
Definition: zconf.h:413
z_const
#define z_const
Definition: zconf.h:237
ERR_MSG
#define ERR_MSG(err)
Definition: zutil.h:52
void
void
Definition: png.h:1083
L
#define L(CODE)
Definition: macros.h:76
uInt
unsigned int uInt
Definition: zconf.h:393
size
static png_bytep size_t size
Definition: pngwrite.c:2170