xref: /illumos-gate/usr/src/uts/common/sys/zmod.h (revision e616c49c)
17c478bd9Sstevel@tonic-gate /*
2a0b85df4Sstevel  * CDDL HEADER START
3a0b85df4Sstevel  *
4a0b85df4Sstevel  * The contents of this file are subject to the terms of the
5*c9431fa1Sahl  * Common Development and Distribution License (the "License").
6*c9431fa1Sahl  * You may not use this file except in compliance with the License.
7a0b85df4Sstevel  *
8a0b85df4Sstevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9a0b85df4Sstevel  * or http://www.opensolaris.org/os/licensing.
10a0b85df4Sstevel  * See the License for the specific language governing permissions
11a0b85df4Sstevel  * and limitations under the License.
12a0b85df4Sstevel  *
13a0b85df4Sstevel  * When distributing Covered Code, include this CDDL HEADER in each
14a0b85df4Sstevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15a0b85df4Sstevel  * If applicable, add the following below this CDDL HEADER, with the
16a0b85df4Sstevel  * fields enclosed by brackets "[]" replaced with your own identifying
17a0b85df4Sstevel  * information: Portions Copyright [yyyy] [name of copyright owner]
18a0b85df4Sstevel  *
19a0b85df4Sstevel  * CDDL HEADER END
20a0b85df4Sstevel  */
21a0b85df4Sstevel 
22a0b85df4Sstevel /*
23*c9431fa1Sahl  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
247c478bd9Sstevel@tonic-gate  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
277c478bd9Sstevel@tonic-gate #ifndef	_ZMOD_H
287c478bd9Sstevel@tonic-gate #define	_ZMOD_H
297c478bd9Sstevel@tonic-gate 
307c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
317c478bd9Sstevel@tonic-gate extern "C" {
327c478bd9Sstevel@tonic-gate #endif
337c478bd9Sstevel@tonic-gate 
347c478bd9Sstevel@tonic-gate /*
357c478bd9Sstevel@tonic-gate  * zmod - RFC-1950-compatible decompression routines
367c478bd9Sstevel@tonic-gate  *
377c478bd9Sstevel@tonic-gate  * This file provides the public interfaces to zmod, an in-kernel RFC 1950
387c478bd9Sstevel@tonic-gate  * decompression library.  More information about the implementation of these
397c478bd9Sstevel@tonic-gate  * interfaces can be found in the usr/src/uts/common/zmod/ directory.
407c478bd9Sstevel@tonic-gate  */
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate #define	Z_OK		0
437c478bd9Sstevel@tonic-gate #define	Z_STREAM_END	1
447c478bd9Sstevel@tonic-gate #define	Z_NEED_DICT	2
457c478bd9Sstevel@tonic-gate #define	Z_ERRNO		(-1)
467c478bd9Sstevel@tonic-gate #define	Z_STREAM_ERROR	(-2)
477c478bd9Sstevel@tonic-gate #define	Z_DATA_ERROR	(-3)
487c478bd9Sstevel@tonic-gate #define	Z_MEM_ERROR	(-4)
497c478bd9Sstevel@tonic-gate #define	Z_BUF_ERROR	(-5)
507c478bd9Sstevel@tonic-gate #define	Z_VERSION_ERROR	(-6)
517c478bd9Sstevel@tonic-gate 
52*c9431fa1Sahl #define	Z_NO_COMPRESSION	0
53*c9431fa1Sahl #define	Z_BEST_SPEED		1
54*c9431fa1Sahl #define	Z_BEST_COMPRESSION	9
55*c9431fa1Sahl #define	Z_DEFAULT_COMPRESSION	(-1)
56*c9431fa1Sahl 
577c478bd9Sstevel@tonic-gate extern int z_uncompress(void *, size_t *, const void *, size_t);
58*c9431fa1Sahl extern int z_compress(void *, size_t *, const void *, size_t);
59*c9431fa1Sahl extern int z_compress_level(void *, size_t *, const void *, size_t, int);
607c478bd9Sstevel@tonic-gate extern const char *z_strerror(int);
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate #ifdef	__cplusplus
637c478bd9Sstevel@tonic-gate }
647c478bd9Sstevel@tonic-gate #endif
657c478bd9Sstevel@tonic-gate 
667c478bd9Sstevel@tonic-gate #endif	/* _ZMOD_H */
67