~ubuntu-branches/ubuntu/hardy/ghostscript/hardy

« back to all changes in this revision

Viewing changes to src/sbwbs.c

  • Committer: Bazaar Package Importer
  • Author(s): Till Kamppeter
  • Date: 2007-11-22 12:17:43 UTC
  • mfrom: (1.1.7 upstream)
  • Revision ID: james.westby@ubuntu.com-20071122121743-cd70s3ypq0r243mp
Tags: 8.61.dfsg.1-0ubtuntu1
* New upstream release
  o Final 8.61 release
* debian/patches/09_ijs_krgb_support.dpatch: Adapted to upstream changes.
* debian/rules: Updated CUPS-related variables for "make install" calls.
* debian/rules: Remove /usr/include/ghostscript from the ghostscript
  package, they go into lings-dev.

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
   San Rafael, CA  94903, U.S.A., +1(415)492-9861, for further information.
12
12
*/
13
13
 
14
 
/* $Id: sbwbs.c 8022 2007-06-05 22:23:38Z giles $ */
 
14
/* $Id: sbwbs.c 8250 2007-09-25 13:31:24Z giles $ */
15
15
/* Burrows/Wheeler block sorting compression filters */
16
16
#include "stdio_.h"
17
17
#include "memory_.h"
26
26
private_st_buffered_state();
27
27
 
28
28
/* Initialize */
29
 
private void
 
29
static void
30
30
s_buffered_set_defaults(stream_state * st)
31
31
{
32
32
    stream_buffered_state *const ss = (stream_buffered_state *) st;
34
34
    /* Clear pointers */
35
35
    ss->buffer = 0;
36
36
}
37
 
private int
 
37
static int
38
38
s_buffered_no_block_init(stream_state * st)
39
39
{
40
40
    stream_buffered_state *const ss = (stream_buffered_state *) st;
44
44
    ss->bpos = 0;
45
45
    return 0;
46
46
}
47
 
private int
 
47
static int
48
48
s_buffered_block_init(stream_state * st)
49
49
{
50
50
    stream_buffered_state *const ss = (stream_buffered_state *) st;
62
62
/* we reached the end of input data. */
63
63
/* In the latter case, also set filling = false. */
64
64
/* Note that this procedure doesn't take pw as an argument. */
65
 
private int
 
65
static int
66
66
s_buffered_process(stream_state * st, stream_cursor_read * pr, bool last)
67
67
{
68
68
    stream_buffered_state *const ss = (stream_buffered_state *) st;
88
88
}
89
89
 
90
90
/* Release */
91
 
private void
 
91
static void
92
92
s_buffered_release(stream_state * st)
93
93
{
94
94
    stream_buffered_state *const ss = (stream_buffered_state *) st;
99
99
/* ------ Common code for Burrows/Wheeler block sorting filters ------ */
100
100
 
101
101
private_st_BWBS_state();
102
 
private void s_BWBS_release(stream_state *);
 
102
static void s_BWBS_release(stream_state *);
103
103
 
104
104
/* Set default parameter values (actually, just clear pointers). */
105
 
private void
 
105
static void
106
106
s_BWBS_set_defaults(stream_state * st)
107
107
{
108
108
    stream_BWBS_state *const ss = (stream_BWBS_state *) st;
112
112
}
113
113
 
114
114
/* Initialize */
115
 
private int
 
115
static int
116
116
bwbs_init(stream_state * st, uint osize)
117
117
{
118
118
    stream_BWBS_state *const ss = (stream_BWBS_state *) st;
134
134
}
135
135
 
136
136
/* Release the filter. */
137
 
private void
 
137
static void
138
138
s_BWBS_release(stream_state * st)
139
139
{
140
140
    stream_BWBS_state *const ss = (stream_BWBS_state *) st;
146
146
/* ------ BWBlockSortEncode ------ */
147
147
 
148
148
/* Initialize */
149
 
private int
 
149
static int
150
150
s_BWBSE_init(stream_state * st)
151
151
{
152
152
    stream_BWBS_state *const ss = (stream_BWBS_state *) st;
155
155
}
156
156
 
157
157
/* Compare two rotated strings for sorting. */
158
 
private stream_BWBS_state *bwbs_compare_ss;
159
 
private int
 
158
static stream_BWBS_state *bwbs_compare_ss;
 
159
static int
160
160
bwbs_compare_rotations(const void *p1, const void *p2)
161
161
{
162
162
    const byte *buffer = bwbs_compare_ss->buffer;
193
193
    return 0;
194
194
}
195
195
/* Sort the strings. */
196
 
private void
 
196
static void
197
197
bwbse_sort(const byte * buffer, uint * indices, int N)
198
198
{
199
199
    offsets_full Cs;
223
223
}
224
224
 
225
225
/* Encode a buffer */
226
 
private int
 
226
static int
227
227
s_BWBSE_process(stream_state * st, stream_cursor_read * pr,
228
228
                stream_cursor_write * pw, bool last)
229
229
{
344
344
#endif /* (!)SHORT_OFFSETS */
345
345
 
346
346
/* Initialize */
347
 
private int
 
347
static int
348
348
s_BWBSD_init(stream_state * st)
349
349
{
350
350
    stream_BWBS_state *const ss = (stream_BWBS_state *) st;
357
357
 
358
358
#ifdef SHORT_OFFSETS
359
359
 
360
 
private void
 
360
static void
361
361
bwbsd_construct_offsets(stream_BWBS_state * sst, offsets_full * po64k,
362
362
                        offsets_4k * po4k, byte * po1, int N)
363
363
{
418
418
 
419
419
#else /* !SHORT_OFFSETS */
420
420
 
421
 
private void
 
421
static void
422
422
bwbsd_construct_offsets(stream_BWBS_state * sst, int *po, int N)
423
423
{
424
424
    offsets_full Cs;
449
449
#endif /* (!)SHORT_OFFSETS */
450
450
 
451
451
/* Decode a buffer */
452
 
private int
 
452
static int
453
453
s_BWBSD_process(stream_state * st, stream_cursor_read * pr,
454
454
                stream_cursor_write * pw, bool last)
455
455
{