COSMOS core  1.0.2 (beta)
Comprehensive Open-architecture Solution for Mission Operations Systems
zutil.c File Reference
#include "zutil.h"
#include "gzguts.h"
Include dependency graph for zutil.c:

Classes

struct  internal_state
 

Functions

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

Variables

z_const char *const z_errmsg [10]
 

Function Documentation

const char* ZEXPORT zlibVersion ( )
31 {
32  return ZLIB_VERSION;
33 }
#define ZLIB_VERSION
Definition: zlib.h:40
uLong ZEXPORT zlibCompileFlags ( )
36 {
37  uLong flags;
38 
39  flags = 0;
40  switch ((int)(sizeof(uInt))) {
41  case 2: break;
42  case 4: flags += 1; break;
43  case 8: flags += 2; break;
44  default: flags += 3;
45  }
46  switch ((int)(sizeof(uLong))) {
47  case 2: break;
48  case 4: flags += 1 << 2; break;
49  case 8: flags += 2 << 2; break;
50  default: flags += 3 << 2;
51  }
52  switch ((int)(sizeof(voidpf))) {
53  case 2: break;
54  case 4: flags += 1 << 4; break;
55  case 8: flags += 2 << 4; break;
56  default: flags += 3 << 4;
57  }
58  switch ((int)(sizeof(z_off_t))) {
59  case 2: break;
60  case 4: flags += 1 << 6; break;
61  case 8: flags += 2 << 6; break;
62  default: flags += 3 << 6;
63  }
64 #ifdef DEBUG
65  flags += 1 << 8;
66 #endif
67 #if defined(ASMV) || defined(ASMINF)
68  flags += 1 << 9;
69 #endif
70 #ifdef ZLIB_WINAPI
71  flags += 1 << 10;
72 #endif
73 #ifdef BUILDFIXED
74  flags += 1 << 12;
75 #endif
76 #ifdef DYNAMIC_CRC_TABLE
77  flags += 1 << 13;
78 #endif
79 #ifdef NO_GZCOMPRESS
80  flags += 1L << 16;
81 #endif
82 #ifdef NO_GZIP
83  flags += 1L << 17;
84 #endif
85 #ifdef PKZIP_BUG_WORKAROUND
86  flags += 1L << 20;
87 #endif
88 #ifdef FASTEST
89  flags += 1L << 21;
90 #endif
91 #if defined(STDC) || defined(Z_HAVE_STDARG_H)
92 # ifdef NO_vsnprintf
93  flags += 1L << 25;
94 # ifdef HAS_vsprintf_void
95  flags += 1L << 26;
96 # endif
97 # else
98 # ifdef HAS_vsnprintf_void
99  flags += 1L << 26;
100 # endif
101 # endif
102 #else
103  flags += 1L << 24;
104 # ifdef NO_snprintf
105  flags += 1L << 25;
106 # ifdef HAS_sprintf_void
107  flags += 1L << 26;
108 # endif
109 # else
110 # ifdef HAS_snprintf_void
111  flags += 1L << 26;
112 # endif
113 # endif
114 #endif
115  return flags;
116 }
#define z_off_t
Definition: zconf.h:457
Byte * voidpf
Definition: zconf.h:390
unsigned long uLong
Definition: zconf.h:371
unsigned int uInt
Definition: zconf.h:370
const char* ZEXPORT zError ( int  err)
138 {
139  return ERR_MSG(err);
140 }
#define ERR_MSG(err)
Definition: zutil.h:50
string & err
Definition: json11.cpp:362
void zmemcpy ( Bytef dest,
const Bytef source,
uInt  len 
)
156 {
157  if (len == 0) return;
158  do {
159  *dest++ = *source++; /* ??? to be unrolled */
160  } while (--len != 0);
161 }
static string source
Definition: ax25_recv.cpp:42
int zmemcmp ( Bytef s1,
const Bytef s2,
uInt  len 
) const
167 {
168  uInt j;
169 
170  for (j = 0; j < len; j++) {
171  if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1;
172  }
173  return 0;
174 }
unsigned int uInt
Definition: zconf.h:370
void zmemzero ( Bytef dest,
uInt  len 
)
179 {
180  if (len == 0) return;
181  do {
182  *dest++ = 0; /* ??? to be unrolled */
183  } while (--len != 0);
184 }
voidp malloc OF ( (uInt size)  )
voidp calloc OF ( (uInt items, uInt size)  )
void free OF ( (voidpf ptr)  )
voidpf zcalloc ( voidpf  opaque,
unsigned  items,
unsigned  size 
)
308 {
309  if (opaque) items += size - size; /* make compiler happy */
310  return sizeof(uInt) > 2 ? (voidpf)malloc(items * size) :
311  (voidpf)calloc(items, size);
312 }
Byte * voidpf
Definition: zconf.h:390
unsigned int uInt
Definition: zconf.h:370
void zcfree ( voidpf  opaque,
voidpf  ptr 
)
317 {
318  free(ptr);
319  if (opaque) return; /* make compiler happy */
320 }

Variable Documentation

z_const char* const z_errmsg[10]
Initial value:
= {
"need dictionary",
"stream end",
"",
"file error",
"stream error",
"data error",
"insufficient memory",
"buffer error",
"incompatible version",
""}