Changeset View
Changeset View
Standalone View
Standalone View
head/sys/contrib/zlib/infback.c
Show All 36 Lines | int stream_size; | ||||
if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || | if (version == Z_NULL || version[0] != ZLIB_VERSION[0] || | ||||
stream_size != (int)(sizeof(z_stream))) | stream_size != (int)(sizeof(z_stream))) | ||||
return Z_VERSION_ERROR; | return Z_VERSION_ERROR; | ||||
if (strm == Z_NULL || window == Z_NULL || | if (strm == Z_NULL || window == Z_NULL || | ||||
windowBits < 8 || windowBits > 15) | windowBits < 8 || windowBits > 15) | ||||
return Z_STREAM_ERROR; | return Z_STREAM_ERROR; | ||||
strm->msg = Z_NULL; /* in case we return an error */ | strm->msg = Z_NULL; /* in case we return an error */ | ||||
if (strm->zalloc == (alloc_func)0) { | if (strm->zalloc == (alloc_func)0) { | ||||
#ifdef Z_SOLO | #if defined(Z_SOLO) && !defined(_KERNEL) | ||||
return Z_STREAM_ERROR; | return Z_STREAM_ERROR; | ||||
#else | #else | ||||
strm->zalloc = zcalloc; | strm->zalloc = zcalloc; | ||||
strm->opaque = (voidpf)0; | strm->opaque = (voidpf)0; | ||||
#endif | #endif | ||||
} | } | ||||
if (strm->zfree == (free_func)0) | if (strm->zfree == (free_func)0) | ||||
#ifdef Z_SOLO | #if defined(Z_SOLO) && !defined(_KERNEL) | ||||
return Z_STREAM_ERROR; | return Z_STREAM_ERROR; | ||||
#else | #else | ||||
strm->zfree = zcfree; | strm->zfree = zcfree; | ||||
#endif | #endif | ||||
state = (struct inflate_state FAR *)ZALLOC(strm, 1, | state = (struct inflate_state FAR *)ZALLOC(strm, 1, | ||||
sizeof(struct inflate_state)); | sizeof(struct inflate_state)); | ||||
if (state == Z_NULL) return Z_MEM_ERROR; | if (state == Z_NULL) return Z_MEM_ERROR; | ||||
Tracev((stderr, "inflate: allocated\n")); | Tracev((stderr, "inflate: allocated\n")); | ||||
▲ Show 20 Lines • Show All 579 Lines • Show Last 20 Lines |