Lines Matching +full:zlib +full:- +full:dev
1 /*-
4 * Copyright (c) 2006-2016 Maxim Sobolev <sobomax@FreeBSD.org>
33 #include <contrib/zlib/zlib.h>
34 #include <dev/zlib/zcalloc.h>
43 /* Zlib decoder structs */
54 zp = (struct g_uzip_zlib *)zpp->pvt; in g_uzip_zlib_free()
55 inflateEnd(&zp->zs); in g_uzip_zlib_free()
66 zp = (struct g_uzip_zlib *)zpp->pvt; in g_uzip_zlib_decompress()
68 zp->zs.next_in = ibp; in g_uzip_zlib_decompress()
69 zp->zs.avail_in = ilen; in g_uzip_zlib_decompress()
70 zp->zs.next_out = obp; in g_uzip_zlib_decompress()
71 zp->zs.avail_out = zp->blksz; in g_uzip_zlib_decompress()
73 err = (inflate(&zp->zs, Z_FINISH) != Z_STREAM_END) ? 1 : 0; in g_uzip_zlib_decompress()
75 printf("%s: UZIP(zlib) inflate() failed\n", gp_name); in g_uzip_zlib_decompress()
86 zp = (struct g_uzip_zlib *)zpp->pvt; in g_uzip_zlib_rewind()
89 if (inflateReset(&zp->zs) != Z_OK) { in g_uzip_zlib_rewind()
90 printf("%s: UZIP(zlib) decoder reset failed\n", gp_name); in g_uzip_zlib_rewind()
102 if (inflateInit(&zp->zs) != Z_OK) { in g_uzip_zlib_ctor()
105 zp->blksz = blksz; in g_uzip_zlib_ctor()
106 zp->pub.max_blen = compressBound(blksz); in g_uzip_zlib_ctor()
107 zp->pub.decompress = &g_uzip_zlib_decompress; in g_uzip_zlib_ctor()
108 zp->pub.free = &g_uzip_zlib_free; in g_uzip_zlib_ctor()
109 zp->pub.rewind = &g_uzip_zlib_rewind; in g_uzip_zlib_ctor()
110 zp->pub.pvt = (void *)zp; in g_uzip_zlib_ctor()
111 return (&zp->pub); in g_uzip_zlib_ctor()