~ubuntu-branches/ubuntu/karmic/figlet/karmic

« back to all changes in this revision

Viewing changes to inflate.h

  • Committer: Bazaar Package Importer
  • Author(s): Francesco Tapparo
  • Date: 2001-04-13 11:05:54 UTC
  • Revision ID: james.westby@ubuntu.com-20010413110554-e5fqky9a68hn0ncg
Tags: upstream-2.2
ImportĀ upstreamĀ versionĀ 2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * inflate.h -  inflate decompression routine
 
3
 *
 
4
 * Version 1.1
 
5
 */
 
6
 
 
7
/*
 
8
 * Copyright (c) 1995, Edward B. Hamrick
 
9
 *
 
10
 * Permission to use, copy, modify, distribute, and sell this software and
 
11
 * its documentation for any purpose is hereby granted without fee, provided
 
12
 * that
 
13
 *
 
14
 * (i)  the above copyright notice and the text in this "C" comment block
 
15
 *      appear in all copies of the software and related documentation, and
 
16
 *
 
17
 * (ii) any modifications to this source file must be sent, via e-mail
 
18
 *      to the copyright owner (currently hamrick@primenet.com) within 
 
19
 *      30 days of such modification.
 
20
 *
 
21
 * THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
 
22
 * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
 
23
 * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
 
24
 *
 
25
 * IN NO EVENT SHALL EDWARD B. HAMRICK BE LIABLE FOR ANY SPECIAL, INCIDENTAL,
 
26
 * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER
 
27
 * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF
 
28
 * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT OF
 
29
 * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 
30
 */
 
31
 
 
32
/*
 
33
 * 1) All file i/o is done externally to these routines
 
34
 * 2) Routines are symmetrical so inflate can feed into deflate
 
35
 * 3) Routines can be easily integrated into wide range of applications
 
36
 * 4) Routines are very portable, and use only ANSI C
 
37
 * 5) No #defines in inflate.h to conflict with external #defines
 
38
 * 6) No external routines need be called by these routines
 
39
 * 7) Buffers are owned by the calling routine
 
40
 * 8) No static non-constant variables are allowed
 
41
 */
 
42
 
 
43
/*
 
44
 * Note that for each call to InflatePutBuffer, there will be
 
45
 * 0 or more calls to (*putbuffer_ptr).  All except the last
 
46
 * call to (*putbuffer_ptr) will be with 32768 bytes, although
 
47
 * this behaviour may change in the future.  Before InflatePutBuffer
 
48
 * returns, it will have output as much uncompressed data as
 
49
 * is possible.
 
50
 */
 
51
 
 
52
#ifndef __INFLATE_H
 
53
#define __INFLATE_H
 
54
 
 
55
#ifdef __cplusplus
 
56
extern "C" {
 
57
#endif
 
58
 
 
59
/* Routine to initialize inflate decompression */
 
60
void *InflateInitialize(                      /* returns InflateState       */
 
61
  void *AppState,                             /* for passing to putbuffer   */
 
62
  int (*putbuffer_ptr)(                       /* returns 0 on success       */
 
63
    void *AppState,                           /* opaque ptr from Initialize */
 
64
    unsigned char *buffer,                    /* buffer to put              */
 
65
    long length                               /* length of buffer           */
 
66
  ),
 
67
  void *(*malloc_ptr)(long length),           /* utility routine            */
 
68
  void (*free_ptr)(void *buffer)              /* utility routine            */
 
69
);
 
70
 
 
71
/* Call-in routine to put a buffer into inflate decompression */
 
72
int InflatePutBuffer(                         /* returns 0 on success       */
 
73
  void *InflateState,                         /* opaque ptr from Initialize */
 
74
  unsigned char *buffer,                      /* buffer to put              */
 
75
  long length                                 /* length of buffer           */
 
76
);
 
77
 
 
78
/* Routine to terminate inflate decompression */
 
79
int InflateTerminate(                         /* returns 0 on success       */
 
80
  void *InflateState                          /* opaque ptr from Initialize */
 
81
);
 
82
 
 
83
#ifdef __cplusplus
 
84
}
 
85
#endif
 
86
 
 
87
#endif