~ubuntu-branches/ubuntu/oneiric/ghostscript/oneiric

« back to all changes in this revision

Viewing changes to base/shc.h

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2011-07-15 16:49:55 UTC
  • mfrom: (1.1.23 upstream)
  • Revision ID: james.westby@ubuntu.com-20110715164955-uga6qibao6kez05c
Tags: 9.04~dfsg~20110715-0ubuntu1
* New upstream release
   - GIT snapshot from Jult, 12 2011.
* debian/patches/020110406~a54df2d.patch,
  debian/patches/020110408~0791cc8.patch,
  debian/patches/020110408~507cbee.patch,
  debian/patches/020110411~4509a49.patch,
  debian/patches/020110412~78bb9a6.patch,
  debian/patches/020110418~a05ab8a.patch,
  debian/patches/020110420~20b6c78.patch,
  debian/patches/020110420~4ddefa2.patch: Removed upstream patches.
* debian/rules: Generate ABI version number (variable "abi") correctly,
  cutting off repackaging and pre-release parts.
* debian/rules: Added ./lcms2/ directory to DEB_UPSTREAM_REPACKAGE_EXCLUDES.
* debian/copyright: Added lcms2/* to the list of excluded files.
* debian/symbols.common: Updated for new upstream source. Applied patch
  which dpkg-gensymbols generated for debian/libgs9.symbols to this file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/* Copyright (C) 2001-2006 Artifex Software, Inc.
2
2
   All Rights Reserved.
3
 
  
 
3
 
4
4
   This software is provided AS-IS with no warranty, either express or
5
5
   implied.
6
6
 
11
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
12
*/
13
13
 
14
 
/* $Id: shc.h 8022 2007-06-05 22:23:38Z giles $ */
 
14
/* $Id$ */
15
15
/* Common definitions for filters using Huffman coding */
16
16
 
17
17
#ifndef shc_INCLUDED
59
59
 *        contain valid data.
60
60
 */
61
61
#define stream_hc_state_common\
62
 
        stream_state_common;\
63
 
                /* The client sets the following before initialization. */\
64
 
        bool FirstBitLowOrder;\
65
 
                /* The following are updated dynamically. */\
66
 
        uint bits;              /* most recent bits of input or */\
67
 
                                /* current bits of output */\
68
 
        int bits_left           /* # of valid low bits (input) or */\
69
 
                                /* unused low bits (output) in above, */\
70
 
                                /* 0 <= bits_left <= 7 */
 
62
        stream_state_common;\
 
63
                /* The client sets the following before initialization. */\
 
64
        bool FirstBitLowOrder;\
 
65
                /* The following are updated dynamically. */\
 
66
        uint bits;              /* most recent bits of input or */\
 
67
                                /* current bits of output */\
 
68
        int bits_left           /* # of valid low bits (input) or */\
 
69
                                /* unused low bits (output) in above, */\
 
70
                                /* 0 <= bits_left <= 7 */
71
71
typedef struct stream_hc_state_s {
72
72
    stream_hc_state_common;
73
73
} stream_hc_state;
116
116
 
117
117
/* Declare variables that hold the encoder state. */
118
118
#define hce_declare_state\
119
 
        register uint bits;\
120
 
        register int bits_left
 
119
        register uint bits;\
 
120
        register int bits_left
121
121
 
122
122
/* Load the state from the stream. */
123
123
/* Free variables: ss, bits, bits_left. */
124
124
#define hce_load_state()\
125
 
        bits = ss->bits, bits_left = ss->bits_left
 
125
        bits = ss->bits, bits_left = ss->bits_left
126
126
 
127
127
/* Store the state back in the stream. */
128
128
/* Free variables: ss, bits, bits_left. */
129
129
#define hce_store_state()\
130
 
        ss->bits = bits, ss->bits_left = bits_left
 
130
        ss->bits = bits, ss->bits_left = bits_left
131
131
 
132
132
/* Put a code on the stream. */
133
133
void hc_put_code_proc(bool, byte *, uint);
137
137
   ((bits_left -= (clen)) >= 0 ?\
138
138
    (bits += (code) << bits_left) :\
139
139
    (hc_put_code_proc((ss)->FirstBitLowOrder,\
140
 
                      q += hc_bits_size >> 3,\
141
 
                      (bits + ((code) >> -bits_left))),\
 
140
                      q += hc_bits_size >> 3,\
 
141
                      (bits + ((code) >> -bits_left))),\
142
142
     bits = (code) << (bits_left += hc_bits_size))))
143
143
#define hc_put_code(ss, q, cp)\
144
144
  hc_put_value(ss, q, (cp)->code, (cp)->code_length)
179
179
 
180
180
/* Declare variables that hold the decoder state. */
181
181
#define hcd_declare_state\
182
 
        register const byte *p;\
183
 
        const byte *rlimit;\
184
 
        uint bits;\
185
 
        int bits_left
 
182
        register const byte *p;\
 
183
        const byte *rlimit;\
 
184
        uint bits;\
 
185
        int bits_left
186
186
 
187
187
/* Load the state from the stream. */
188
188
/* Free variables: pr, ss, p, rlimit, bits, bits_left. */
189
189
#define hcd_load_state()\
190
 
        p = pr->ptr,\
191
 
        rlimit = pr->limit,\
192
 
        bits = ss->bits,\
193
 
        bits_left = ss->bits_left
 
190
        p = pr->ptr,\
 
191
        rlimit = pr->limit,\
 
192
        bits = ss->bits,\
 
193
        bits_left = ss->bits_left
194
194
 
195
195
/* Store the state back in the stream. */
196
196
/* Put back any complete bytes into the input buffer. */
197
197
/* Free variables: pr, ss, p, bits, bits_left. */
198
198
#define hcd_store_state()\
199
 
        pr->ptr = p -= (bits_left >> 3),\
200
 
        ss->bits = bits >>= (bits_left & ~7),\
201
 
        ss->bits_left = bits_left &= 7
 
199
        pr->ptr = p -= (bits_left >> 3),\
 
200
        ss->bits = bits >>= (bits_left & ~7),\
 
201
        ss->bits_left = bits_left &= 7
202
202
 
203
203
/* Macros to get blocks of bits from the input stream. */
204
204
/* Invariants: 0 <= bits_left <= bits_size; */