| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
#include "util.h" |
| 6 |
|
| 7 |
z_const char * const z_errmsg[10] = { |
| 8 |
(z_const char *)"need dictionary", |
| 9 |
(z_const char *)"stream end", |
| 10 |
(z_const char *)"", |
| 11 |
(z_const char *)"file error", |
| 12 |
(z_const char *)"stream error", |
| 13 |
(z_const char *)"data error", |
| 14 |
(z_const char *)"insufficient memory", |
| 15 |
(z_const char *)"buffer error", |
| 16 |
(z_const char *)"incompatible version", |
| 17 |
(z_const char *)"" |
| 18 |
}; |
| 19 |
|
| 20 |
|
| 21 |
#ifdef ZLIB_DEBUG |
| 22 |
#include <stdlib.h> |
| 23 |
# ifndef verbose |
| 24 |
# define verbose (ZLIB_DEBUG) |
| 25 |
# endif |
| 26 |
int ZLIB_INTERNAL z_verbose = verbose; |
| 27 |
|
| 28 |
void ZLIB_INTERNAL z_error (m) |
| 29 |
char *m; |
| 30 |
{ |
| 31 |
fprintf(stderr, "%s\n", m); |
| 32 |
exit(1); |
| 33 |
} |
| 34 |
#endif |
| 35 |
|
| 36 |
#ifndef HAVE_MEMCPY |
| 37 |
|
| 38 |
void ZLIB_INTERNAL zmemcpy(dest, source, len) |
| 39 |
Byte FAR* dest; |
| 40 |
const Byte FAR* source; |
| 41 |
uInt len; |
| 42 |
{ |
| 43 |
if (len == 0) return; |
| 44 |
do { |
| 45 |
*dest++ = *source++; |
| 46 |
} while (--len != 0); |
| 47 |
} |
| 48 |
|
| 49 |
int ZLIB_INTERNAL zmemcmp(s1, s2, len) |
| 50 |
const Byte FAR* s1; |
| 51 |
const Byte FAR* s2; |
| 52 |
uInt len; |
| 53 |
{ |
| 54 |
uInt j; |
| 55 |
|
| 56 |
for (j = 0; j < len; j++) { |
| 57 |
if (s1[j] != s2[j]) return 2*(s1[j] > s2[j])-1; |
| 58 |
} |
| 59 |
return 0; |
| 60 |
} |
| 61 |
|
| 62 |
void ZLIB_INTERNAL zmemzero(dest, len) |
| 63 |
Byte FAR* dest; |
| 64 |
uInt len; |
| 65 |
{ |
| 66 |
if (len == 0) return; |
| 67 |
do { |
| 68 |
*dest++ = 0; |
| 69 |
} while (--len != 0); |
| 70 |
} |
| 71 |
#endif |