]>
git.ipfire.org Git - people/ms/u-boot.git/blob - lib/zlib/zutil.c
1 /* zutil.c -- target dependent utility functions for the compression library
2 * Copyright (C) 1995-2005 Jean-loup Gailly.
3 * For conditions of distribution and use, see copyright notice in zlib.h
11 struct internal_state
{int dummy
;}; /* for buggy compilers */
14 const char * const z_errmsg
[10] = {
15 "need dictionary", /* Z_NEED_DICT 2 */
16 "stream end", /* Z_STREAM_END 1 */
18 "file error", /* Z_ERRNO (-1) */
19 "stream error", /* Z_STREAM_ERROR (-2) */
20 "data error", /* Z_DATA_ERROR (-3) */
21 "insufficient memory", /* Z_MEM_ERROR (-4) */
22 "buffer error", /* Z_BUF_ERROR (-5) */
23 "incompatible version",/* Z_VERSION_ERROR (-6) */
31 int z_verbose
= verbose
;
36 fprintf(stderr
, "%s\n", m
);
41 /* exported to allow conversion of error code to string for compress() and
44 #ifndef MY_ZCALLOC /* Any system without a special alloc function */
50 extern voidp malloc
OF((uInt size
));
51 extern voidp calloc
OF((uInt items
, uInt size
));
52 extern void free
OF((voidpf ptr
));
56 voidpf
zcalloc(voidpf opaque
, unsigned items
, unsigned size
)
59 items
+= size
- size
; /* make compiler happy */
60 return sizeof(uInt
) > 2 ? (voidpf
)malloc(items
* size
) :
61 (voidpf
)calloc(items
, size
);
64 void zcfree(voidpf opaque
, voidpf ptr
, unsigned nb
)
68 return; /* make compiler happy */
71 #endif /* MY_ZCALLOC */