Home | History | Annotate | Download | only in bzip2
      1 /*
      2  * CDDL HEADER START
      3  *
      4  * The contents of this file are subject to the terms of the
      5  * Common Development and Distribution License (the "License").
      6  * You may not use this file except in compliance with the License.
      7  *
      8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
      9  * or http://www.opensolaris.org/os/licensing.
     10  * See the License for the specific language governing permissions
     11  * and limitations under the License.
     12  *
     13  * When distributing Covered Code, include this CDDL HEADER in each
     14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     15  * If applicable, add the following below this CDDL HEADER, with the
     16  * fields enclosed by brackets "[]" replaced with your own identifying
     17  * information: Portions Copyright [yyyy] [name of copyright owner]
     18  *
     19  * CDDL HEADER END
     20  */
     21 
     22 /*
     23  * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
     24  * Use is subject to license terms.
     25  */
     26 
     27 #pragma ident	"@(#)llib-lbz2	1.2	07/02/21 SMI"
     28 
     29 /* LINTLIBRARY */
     30 /* PROTOLIB1 */
     31 
     32 #include <stdlib.h>
     33 #include <stdio.h>
     34 #include <stdarg.h>
     35 #include <bzlib.h>
     36 
     37 /*
     38  * usr/src/cmd/bzip2
     39  */
     40 
     41 /*-- Core (low-level) library functions --*/
     42 
     43 extern int BZ2_bzCompressInit(bz_stream *strm, int blockSize100k, int verbosity,
     44     int workFactor);
     45 extern int BZ2_bzCompress(bz_stream *strm, int action);
     46 extern int BZ2_bzCompressEnd(bz_stream *strm);
     47 extern int BZ2_bzDecompressInit(bz_stream *strm, int verbosity, int small);
     48 extern int BZ2_bzDecompress(bz_stream *strm);
     49 extern int BZ2_bzDecompressEnd(bz_stream *strm);
     50 extern BZFILE *BZ2_bzReadOpen(int *bzerror, FILE *f, int verbosity, int small,
     51     void *unused, int nUnused);
     52 extern void BZ2_bzReadClose(int *bzerror, BZFILE *b);
     53 extern void BZ2_bzReadGetUnused(int *bzerror, BZFILE *b, void **unused,
     54     int *nUnused);
     55 extern int BZ2_bzRead(int *bzerror, BZFILE *b, void *buf, int len);
     56 extern BZFILE *BZ2_bzWriteOpen(int *bzerror, FILE *f, int blockSize100k,
     57     int verbosity, int workFactor);
     58 extern void BZ2_bzWrite(int *bzerror, BZFILE *b, void *buf, int len);
     59 extern void BZ2_bzWriteClose(int *bzerror, BZFILE *b, int abandon,
     60     unsigned int *nbytes_in, unsigned int *nbytes_out);
     61 extern void BZ2_bzWriteClose64(int *bzerror, BZFILE *b, int abandon,
     62     unsigned int *nbytes_in_lo32, unsigned int *nbytes_in_hi32,
     63     unsigned int *nbytes_out_lo32, unsigned int *nbytes_out_hi32);
     64 extern int BZ2_bzBuffToBuffCompress(char *dest, unsigned int *destLen,
     65     char *source, unsigned int sourceLen, int blockSize100k, int verbosity,
     66     int workFactor);
     67 extern int BZ2_bzBuffToBuffDecompress(char *dest, unsigned int *destLen,
     68     char *source, unsigned int sourceLen, int small, int verbosity);
     69 extern const char *BZ2_bzlibVersion(void);
     70 extern BZFILE *BZ2_bzopen(const char *path, const char *mode);
     71 extern BZFILE *BZ2_bzdopen(int fd, const char *mode);
     72 extern int BZ2_bzread(BZFILE *b, void *buf, int len);
     73 extern int BZ2_bzwrite(BZFILE *b, void *buf, int len);
     74 extern int BZ2_bzflush(BZFILE *b);
     75 extern void BZ2_bzclose(BZFILE *b);
     76 extern const char *BZ2_bzerror(BZFILE *b, int *errnum);
     77