Debian Codegraph @

src/lib/util.c

raw symbols SCIP
1 /* util.c -- target dependent utility functions for the compression library
2 * Copyright (C) 1995-2017 Jean-loup Gailly
3 */
4
5 #include "util.h"
6
7 z_const char * const z_errmsg[10] = {
8 (z_const char *)"need dictionary", /* Z_NEED_DICT 2 */
9 (z_const char *)"stream end", /* Z_STREAM_END 1 */
10 (z_const char *)"", /* Z_OK 0 */
11 (z_const char *)"file error", /* Z_ERRNO (-1) */
12 (z_const char *)"stream error", /* Z_STREAM_ERROR (-2) */
13 (z_const char *)"data error", /* Z_DATA_ERROR (-3) */
14 (z_const char *)"insufficient memory", /* Z_MEM_ERROR (-4) */
15 (z_const char *)"buffer error", /* Z_BUF_ERROR (-5) */
16 (z_const char *)"incompatible version",/* Z_VERSION_ERROR (-6) */
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++; /* ??? to be unrolled */
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; /* ??? to be unrolled */
69 } while (--len != 0);
70 }
71 #endif