components/bzip2/llib-lbz2
author Mike Sullivan <Mike.Sullivan@Oracle.COM>
Mon, 11 Mar 2013 10:38:09 -0700
branchs11-update
changeset 2520 ceec631e74d1
parent 61 7684fe2a9eb5
permissions -rw-r--r--
Close of build 10.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
61
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     1
/*
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     2
 * CDDL HEADER START
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     3
 *
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     4
 * The contents of this file are subject to the terms of the
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     5
 * Common Development and Distribution License (the "License").
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     6
 * You may not use this file except in compliance with the License.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     7
 *
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     8
 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
     9
 * or http://www.opensolaris.org/os/licensing.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    10
 * See the License for the specific language governing permissions
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    11
 * and limitations under the License.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    12
 *
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    13
 * When distributing Covered Code, include this CDDL HEADER in each
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    14
 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    15
 * If applicable, add the following below this CDDL HEADER, with the
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    16
 * fields enclosed by brackets "[]" replaced with your own identifying
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    17
 * information: Portions Copyright [yyyy] [name of copyright owner]
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    18
 *
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    19
 * CDDL HEADER END
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    20
 */
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    21
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    22
/*
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    23
 * Copyright (c) 2001, 2011, Oracle and/or its affiliates. All rights reserved.
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    24
 */
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    25
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    26
/* LINTLIBRARY */
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    27
/* PROTOLIB1 */
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    28
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    29
#include <stdlib.h>
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    30
#include <stdio.h>
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    31
#include <stdarg.h>
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    32
#include <bzlib.h>
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    33
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    34
/*
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    35
 * usr/src/cmd/bzip2
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    36
 */
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    37
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    38
/*-- Core (low-level) library functions --*/
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    39
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    40
extern int BZ2_bzCompressInit(bz_stream *strm, int blockSize100k, int verbosity,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    41
    int workFactor);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    42
extern int BZ2_bzCompress(bz_stream *strm, int action);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    43
extern int BZ2_bzCompressEnd(bz_stream *strm);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    44
extern int BZ2_bzDecompressInit(bz_stream *strm, int verbosity, int small);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    45
extern int BZ2_bzDecompress(bz_stream *strm);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    46
extern int BZ2_bzDecompressEnd(bz_stream *strm);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    47
extern BZFILE *BZ2_bzReadOpen(int *bzerror, FILE *f, int verbosity, int small,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    48
    void *unused, int nUnused);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    49
extern void BZ2_bzReadClose(int *bzerror, BZFILE *b);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    50
extern void BZ2_bzReadGetUnused(int *bzerror, BZFILE *b, void **unused,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    51
    int *nUnused);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    52
extern int BZ2_bzRead(int *bzerror, BZFILE *b, void *buf, int len);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    53
extern BZFILE *BZ2_bzWriteOpen(int *bzerror, FILE *f, int blockSize100k,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    54
    int verbosity, int workFactor);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    55
extern void BZ2_bzWrite(int *bzerror, BZFILE *b, void *buf, int len);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    56
extern void BZ2_bzWriteClose(int *bzerror, BZFILE *b, int abandon,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    57
    unsigned int *nbytes_in, unsigned int *nbytes_out);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    58
extern void BZ2_bzWriteClose64(int *bzerror, BZFILE *b, int abandon,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    59
    unsigned int *nbytes_in_lo32, unsigned int *nbytes_in_hi32,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    60
    unsigned int *nbytes_out_lo32, unsigned int *nbytes_out_hi32);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    61
extern int BZ2_bzBuffToBuffCompress(char *dest, unsigned int *destLen,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    62
    char *source, unsigned int sourceLen, int blockSize100k, int verbosity,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    63
    int workFactor);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    64
extern int BZ2_bzBuffToBuffDecompress(char *dest, unsigned int *destLen,
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    65
    char *source, unsigned int sourceLen, int small, int verbosity);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    66
extern const char *BZ2_bzlibVersion(void);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    67
extern BZFILE *BZ2_bzopen(const char *path, const char *mode);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    68
extern BZFILE *BZ2_bzdopen(int fd, const char *mode);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    69
extern int BZ2_bzread(BZFILE *b, void *buf, int len);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    70
extern int BZ2_bzwrite(BZFILE *b, void *buf, int len);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    71
extern int BZ2_bzflush(BZFILE *b);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    72
extern void BZ2_bzclose(BZFILE *b);
7684fe2a9eb5 7011958 some things lost during move to userland
Mike Sullivan <Mike.Sullivan@Oracle.COM>
parents:
diff changeset
    73
extern const char *BZ2_bzerror(BZFILE *b, int *errnum);