diff options
author | Ralf Baechle <ralf@linux-mips.org> | 2000-04-28 01:09:25 +0000 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2000-04-28 01:09:25 +0000 |
commit | b9ba7aeb165cffecdffb60aec8c3fa8d590d9ca9 (patch) | |
tree | 42d07b0c7246ae2536a702e7c5de9e2732341116 /fs/cramfs | |
parent | 7406b0a326f2d70ade2671c37d1beef62249db97 (diff) |
Merge with 2.3.99-pre6.
Diffstat (limited to 'fs/cramfs')
-rw-r--r-- | fs/cramfs/inflate/adler32.c | 2 | ||||
-rw-r--r-- | fs/cramfs/inflate/infblock.c | 36 | ||||
-rw-r--r-- | fs/cramfs/inflate/infblock.h | 10 | ||||
-rw-r--r-- | fs/cramfs/inflate/infcodes.c | 16 | ||||
-rw-r--r-- | fs/cramfs/inflate/infcodes.h | 6 | ||||
-rw-r--r-- | fs/cramfs/inflate/inffast.c | 14 | ||||
-rw-r--r-- | fs/cramfs/inflate/inffast.h | 2 | ||||
-rw-r--r-- | fs/cramfs/inflate/inflate.c | 34 | ||||
-rw-r--r-- | fs/cramfs/inflate/inftrees.c | 8 | ||||
-rw-r--r-- | fs/cramfs/inflate/inftrees.h | 6 | ||||
-rw-r--r-- | fs/cramfs/inflate/infutil.c | 4 | ||||
-rw-r--r-- | fs/cramfs/inflate/infutil.h | 8 | ||||
-rw-r--r-- | fs/cramfs/inflate/uncompr.c | 8 | ||||
-rw-r--r-- | fs/cramfs/inflate/zlib.h | 24 | ||||
-rw-r--r-- | fs/cramfs/uncompress.c | 14 |
15 files changed, 96 insertions, 96 deletions
diff --git a/fs/cramfs/inflate/adler32.c b/fs/cramfs/inflate/adler32.c index 16cf9a703..813f89cd6 100644 --- a/fs/cramfs/inflate/adler32.c +++ b/fs/cramfs/inflate/adler32.c @@ -18,7 +18,7 @@ #define DO16(buf) DO8(buf,0); DO8(buf,8); /* ========================================================================= */ -uLong ZEXPORT adler32(adler, buf, len) +uLong ZEXPORT cramfs_adler32(adler, buf, len) uLong adler; const Bytef *buf; uInt len; diff --git a/fs/cramfs/inflate/infblock.c b/fs/cramfs/inflate/infblock.c index b6cc1fc86..3cb241d71 100644 --- a/fs/cramfs/inflate/infblock.c +++ b/fs/cramfs/inflate/infblock.c @@ -65,7 +65,7 @@ local const uInt border[] = { /* Order of the bit length code lengths */ */ -void inflate_blocks_reset(s, z, c) +void cramfs_inflate_blocks_reset(s, z, c) inflate_blocks_statef *s; z_streamp z; uLongf *c; @@ -73,7 +73,7 @@ uLongf *c; if (c != Z_NULL) *c = s->check; if (s->mode == CODES) - inflate_codes_free(s->sub.decode.codes, z); + cramfs_inflate_codes_free(s->sub.decode.codes, z); s->mode = TYPE; s->bitk = 0; s->bitb = 0; @@ -83,7 +83,7 @@ uLongf *c; } -inflate_blocks_statef *inflate_blocks_new(z, c, w) +inflate_blocks_statef *cramfs_inflate_blocks_new(z, c, w) z_streamp z; check_func c; uInt w; @@ -99,12 +99,12 @@ uInt w; s->end = s->window + w; s->checkfn = c; s->mode = TYPE; - inflate_blocks_reset(s, z, Z_NULL); + cramfs_inflate_blocks_reset(s, z, Z_NULL); return s; } -int inflate_blocks(s, z, r) +int cramfs_inflate_blocks(s, z, r) inflate_blocks_statef *s; z_streamp z; int r; @@ -140,8 +140,8 @@ int r; uInt bl, bd; inflate_huft *tl, *td; - inflate_trees_fixed(&bl, &bd, &tl, &td, z); - s->sub.decode.codes = inflate_codes_new(bl, bd, tl, td, z); + cramfs_inflate_trees_fixed(&bl, &bd, &tl, &td, z); + s->sub.decode.codes = cramfs_inflate_codes_new(bl, bd, tl, td, z); if (s->sub.decode.codes == Z_NULL) { r = Z_MEM_ERROR; @@ -219,7 +219,7 @@ int r; while (s->sub.trees.index < 19) s->sub.trees.blens[border[s->sub.trees.index++]] = 0; s->sub.trees.bb = 7; - t = inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, + t = cramfs_inflate_trees_bits(s->sub.trees.blens, &s->sub.trees.bb, &s->sub.trees.tb, s->hufts, z); if (t != Z_OK) { @@ -239,7 +239,7 @@ int r; t = s->sub.trees.bb; NEEDBITS(t) - h = s->sub.trees.tb + ((uInt)b & inflate_mask[t]); + h = s->sub.trees.tb + ((uInt)b & cramfs_inflate_mask[t]); t = h->bits; c = h->base; if (c < 16) @@ -253,7 +253,7 @@ int r; j = c == 18 ? 11 : 3; NEEDBITS(t + i) DUMPBITS(t) - j += (uInt)b & inflate_mask[i]; + j += (uInt)b & cramfs_inflate_mask[i]; DUMPBITS(i) i = s->sub.trees.index; t = s->sub.trees.table; @@ -281,7 +281,7 @@ int r; bl = 9; /* must be <= 9 for lookahead assumptions */ bd = 6; /* must be <= 9 for lookahead assumptions */ t = s->sub.trees.table; - t = inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), + t = cramfs_inflate_trees_dynamic(257 + (t & 0x1f), 1 + ((t >> 5) & 0x1f), s->sub.trees.blens, &bl, &bd, &tl, &td, s->hufts, z); if (t != Z_OK) @@ -291,7 +291,7 @@ int r; r = t; LEAVE } - if ((c = inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) + if ((c = cramfs_inflate_codes_new(bl, bd, tl, td, z)) == Z_NULL) { r = Z_MEM_ERROR; LEAVE @@ -301,10 +301,10 @@ int r; s->mode = CODES; case CODES: UPDATE - if ((r = inflate_codes(s, z, r)) != Z_STREAM_END) - return inflate_flush(s, z, r); + if ((r = cramfs_inflate_codes(s, z, r)) != Z_STREAM_END) + return cramfs_inflate_flush(s, z, r); r = Z_OK; - inflate_codes_free(s->sub.decode.codes, z); + cramfs_inflate_codes_free(s->sub.decode.codes, z); LOAD if (!s->last) { @@ -330,16 +330,16 @@ int r; } -int inflate_blocks_free(s, z) +int cramfs_inflate_blocks_free(s, z) inflate_blocks_statef *s; z_streamp z; { - inflate_blocks_reset(s, z, Z_NULL); + cramfs_inflate_blocks_reset(s, z, Z_NULL); return Z_OK; } -void inflate_set_dictionary(s, d, n) +void cramfs_inflate_set_dictionary(s, d, n) inflate_blocks_statef *s; const Bytef *d; uInt n; diff --git a/fs/cramfs/inflate/infblock.h b/fs/cramfs/inflate/infblock.h index bd25c8075..bb13ad6ff 100644 --- a/fs/cramfs/inflate/infblock.h +++ b/fs/cramfs/inflate/infblock.h @@ -11,26 +11,26 @@ struct inflate_blocks_state; typedef struct inflate_blocks_state FAR inflate_blocks_statef; -extern inflate_blocks_statef * inflate_blocks_new OF(( +extern inflate_blocks_statef * cramfs_inflate_blocks_new OF(( z_streamp z, check_func c, /* check function */ uInt w)); /* window size */ -extern int inflate_blocks OF(( +extern int cramfs_inflate_blocks OF(( inflate_blocks_statef *, z_streamp , int)); /* initial return code */ -extern void inflate_blocks_reset OF(( +extern void cramfs_inflate_blocks_reset OF(( inflate_blocks_statef *, z_streamp , uLongf *)); /* check value on output */ -extern int inflate_blocks_free OF(( +extern int cramfs_inflate_blocks_free OF(( inflate_blocks_statef *, z_streamp)); -extern void inflate_set_dictionary OF(( +extern void cramfs_inflate_set_dictionary OF(( inflate_blocks_statef *s, const Bytef *d, /* dictionary */ uInt n)); /* dictionary length */ diff --git a/fs/cramfs/inflate/infcodes.c b/fs/cramfs/inflate/infcodes.c index ea7f6aba8..77762ff63 100644 --- a/fs/cramfs/inflate/infcodes.c +++ b/fs/cramfs/inflate/infcodes.c @@ -56,7 +56,7 @@ struct inflate_codes_state { }; -inflate_codes_statef *inflate_codes_new(bl, bd, tl, td, z) +inflate_codes_statef *cramfs_inflate_codes_new(bl, bd, tl, td, z) uInt bl, bd; inflate_huft *tl; inflate_huft *td; /* need separate declaration for Borland C++ */ @@ -77,7 +77,7 @@ z_streamp z; } -int inflate_codes(s, z, r) +int cramfs_inflate_codes(s, z, r) inflate_blocks_statef *s; z_streamp z; int r; @@ -105,7 +105,7 @@ int r; if (m >= 258 && n >= 10) { UPDATE - r = inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); + r = cramfs_inflate_fast(c->lbits, c->dbits, c->ltree, c->dtree, s, z); LOAD if (r != Z_OK) { @@ -120,7 +120,7 @@ int r; case LEN: /* i: get length/literal/eob next */ j = c->sub.code.need; NEEDBITS(j) - t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + t = c->sub.code.tree + ((uInt)b & cramfs_inflate_mask[j]); DUMPBITS(t->bits) e = (uInt)(t->exop); if (e == 0) /* literal */ @@ -154,7 +154,7 @@ int r; case LENEXT: /* i: getting length extra (have base) */ j = c->sub.copy.get; NEEDBITS(j) - c->len += (uInt)b & inflate_mask[j]; + c->len += (uInt)b & cramfs_inflate_mask[j]; DUMPBITS(j) c->sub.code.need = c->dbits; c->sub.code.tree = c->dtree; @@ -162,7 +162,7 @@ int r; case DIST: /* i: get distance next */ j = c->sub.code.need; NEEDBITS(j) - t = c->sub.code.tree + ((uInt)b & inflate_mask[j]); + t = c->sub.code.tree + ((uInt)b & cramfs_inflate_mask[j]); DUMPBITS(t->bits) e = (uInt)(t->exop); if (e & 16) /* distance */ @@ -185,7 +185,7 @@ int r; case DISTEXT: /* i: getting distance extra */ j = c->sub.copy.get; NEEDBITS(j) - c->sub.copy.dist += (uInt)b & inflate_mask[j]; + c->sub.copy.dist += (uInt)b & cramfs_inflate_mask[j]; DUMPBITS(j) c->mode = COPY; case COPY: /* o: copying bytes in window, waiting for space */ @@ -240,7 +240,7 @@ int r; } -void inflate_codes_free(c, z) +void cramfs_inflate_codes_free(c, z) inflate_codes_statef *c; z_streamp z; { diff --git a/fs/cramfs/inflate/infcodes.h b/fs/cramfs/inflate/infcodes.h index 6c750d896..283b29201 100644 --- a/fs/cramfs/inflate/infcodes.h +++ b/fs/cramfs/inflate/infcodes.h @@ -11,17 +11,17 @@ struct inflate_codes_state; typedef struct inflate_codes_state FAR inflate_codes_statef; -extern inflate_codes_statef *inflate_codes_new OF(( +extern inflate_codes_statef *cramfs_inflate_codes_new OF(( uInt, uInt, inflate_huft *, inflate_huft *, z_streamp )); -extern int inflate_codes OF(( +extern int cramfs_inflate_codes OF(( inflate_blocks_statef *, z_streamp , int)); -extern void inflate_codes_free OF(( +extern void cramfs_inflate_codes_free OF(( inflate_codes_statef *, z_streamp )); diff --git a/fs/cramfs/inflate/inffast.c b/fs/cramfs/inflate/inffast.c index 5da2cd0a9..00995d4cd 100644 --- a/fs/cramfs/inflate/inffast.c +++ b/fs/cramfs/inflate/inffast.c @@ -25,7 +25,7 @@ struct inflate_codes_state {int dummy;}; /* for buggy compilers */ at least ten. The ten bytes are six bytes for the longest length/ distance pair plus four bytes for overloading the bit buffer. */ -int inflate_fast(bl, bd, tl, td, s, z) +int cramfs_inflate_fast(bl, bd, tl, td, s, z) uInt bl, bd; inflate_huft *tl; inflate_huft *td; /* need separate declaration for Borland C++ */ @@ -50,8 +50,8 @@ z_streamp z; LOAD /* initialize masks */ - ml = inflate_mask[bl]; - md = inflate_mask[bd]; + ml = cramfs_inflate_mask[bl]; + md = cramfs_inflate_mask[bd]; /* do until not enough input or output space for fast loop */ do { /* assume called with m >= 258 && n >= 10 */ @@ -70,7 +70,7 @@ z_streamp z; { /* get extra bits for length */ e &= 15; - c = t->base + ((uInt)b & inflate_mask[e]); + c = t->base + ((uInt)b & cramfs_inflate_mask[e]); DUMPBITS(e) /* decode distance base of block to copy */ @@ -83,7 +83,7 @@ z_streamp z; /* get extra bits to add to distance base */ e &= 15; GRABBITS(e) /* get extra bits (up to 13) */ - d = t->base + ((uInt)b & inflate_mask[e]); + d = t->base + ((uInt)b & cramfs_inflate_mask[e]); DUMPBITS(e) /* do the copy */ @@ -115,7 +115,7 @@ z_streamp z; else if ((e & 64) == 0) { t += t->base; - e = (t += ((uInt)b & inflate_mask[e]))->exop; + e = (t += ((uInt)b & cramfs_inflate_mask[e]))->exop; } else { @@ -130,7 +130,7 @@ z_streamp z; if ((e & 64) == 0) { t += t->base; - if ((e = (t += ((uInt)b & inflate_mask[e]))->exop) == 0) + if ((e = (t += ((uInt)b & cramfs_inflate_mask[e]))->exop) == 0) { DUMPBITS(t->bits) *q++ = (Byte)t->base; diff --git a/fs/cramfs/inflate/inffast.h b/fs/cramfs/inflate/inffast.h index 8facec553..9d7697589 100644 --- a/fs/cramfs/inflate/inffast.h +++ b/fs/cramfs/inflate/inffast.h @@ -8,7 +8,7 @@ subject to change. Applications should only use zlib.h. */ -extern int inflate_fast OF(( +extern int cramfs_inflate_fast OF(( uInt, uInt, inflate_huft *, diff --git a/fs/cramfs/inflate/inflate.c b/fs/cramfs/inflate/inflate.c index c5b7a0c44..b5bfb67bf 100644 --- a/fs/cramfs/inflate/inflate.c +++ b/fs/cramfs/inflate/inflate.c @@ -50,7 +50,7 @@ struct internal_state { }; -int ZEXPORT inflateReset(z) +int ZEXPORT cramfs_inflateReset(z) z_streamp z; { if (z == Z_NULL || z->state == Z_NULL) @@ -58,24 +58,24 @@ z_streamp z; z->total_in = z->total_out = 0; z->msg = Z_NULL; z->state->mode = z->state->nowrap ? BLOCKS : METHOD; - inflate_blocks_reset(z->state->blocks, z, Z_NULL); + cramfs_inflate_blocks_reset(z->state->blocks, z, Z_NULL); return Z_OK; } -int ZEXPORT inflateEnd(z) +int ZEXPORT cramfs_inflateEnd(z) z_streamp z; { if (z == Z_NULL || z->state == Z_NULL) return Z_STREAM_ERROR; if (z->state->blocks != Z_NULL) - inflate_blocks_free(z->state->blocks, z); + cramfs_inflate_blocks_free(z->state->blocks, z); z->state = Z_NULL; return Z_OK; } -int ZEXPORT inflateInit2_(z, w, version, stream_size) +int ZEXPORT cramfs_inflateInit2_(z, w, version, stream_size) z_streamp z; int w; const char *version; @@ -105,39 +105,39 @@ int stream_size; /* set window size */ if (w < 8 || w > 15) { - inflateEnd(z); + cramfs_inflateEnd(z); return Z_STREAM_ERROR; } z->state->wbits = (uInt)w; /* create inflate_blocks state */ if ((z->state->blocks = - inflate_blocks_new(z, z->state->nowrap ? Z_NULL : adler32, (uInt)1 << w)) + cramfs_inflate_blocks_new(z, z->state->nowrap ? Z_NULL : cramfs_adler32, (uInt)1 << w)) == Z_NULL) { - inflateEnd(z); + cramfs_inflateEnd(z); return Z_MEM_ERROR; } /* reset state */ - inflateReset(z); + cramfs_inflateReset(z); return Z_OK; } -int ZEXPORT inflateInit_(z, version, stream_size) +int ZEXPORT cramfs_inflateInit_(z, version, stream_size) z_streamp z; const char *version; int stream_size; { - return inflateInit2_(z, DEF_WBITS, version, stream_size); + return cramfs_inflateInit2_(z, DEF_WBITS, version, stream_size); } #define NEEDBYTE {if(z->avail_in==0)return r;r=f;} #define NEXTBYTE (z->avail_in--,z->total_in++,*z->next_in++) -int ZEXPORT inflate(z, f) +int ZEXPORT cramfs_inflate(z, f) z_streamp z; int f; { @@ -207,7 +207,7 @@ int f; z->state->sub.marker = 0; /* can try inflateSync */ return Z_STREAM_ERROR; case BLOCKS: - r = inflate_blocks(z->state->blocks, z, r); + r = cramfs_inflate_blocks(z->state->blocks, z, r); if (r == Z_DATA_ERROR) { z->state->mode = BAD; @@ -219,7 +219,7 @@ int f; if (r != Z_STREAM_END) return r; r = f; - inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); + cramfs_inflate_blocks_reset(z->state->blocks, z, &z->state->sub.check.was); if (z->state->nowrap) { z->state->mode = DONE; @@ -263,7 +263,7 @@ int f; } -int ZEXPORT inflateSync(z) +int ZEXPORT cramfs_inflateSync(z) z_streamp z; { uInt n; /* number of bytes to look at */ @@ -307,7 +307,7 @@ z_streamp z; if (m != 4) return Z_DATA_ERROR; r = z->total_in; w = z->total_out; - inflateReset(z); + cramfs_inflateReset(z); z->total_in = r; z->total_out = w; z->state->mode = BLOCKS; return Z_OK; @@ -321,7 +321,7 @@ z_streamp z; * decompressing, PPP checks that at the end of input packet, inflate is * waiting for these length bytes. */ -int ZEXPORT inflateSyncPoint(z) +int ZEXPORT cramfs_inflateSyncPoint(z) z_streamp z; { if (z == Z_NULL || z->state == Z_NULL || z->state->blocks == Z_NULL) diff --git a/fs/cramfs/inflate/inftrees.c b/fs/cramfs/inflate/inftrees.c index 250c8833e..b71a0c578 100644 --- a/fs/cramfs/inflate/inftrees.c +++ b/fs/cramfs/inflate/inftrees.c @@ -6,7 +6,7 @@ #include "zutil.h" #include "inftrees.h" -const char inflate_copyright[] = +static const char inflate_copyright[] = " inflate 1.1.3 Copyright 1995-1998 Mark Adler "; /* If you use the zlib library in a product, an acknowledgment is welcome @@ -287,7 +287,7 @@ uIntf *v; /* working area: values in order of bit length */ } -int inflate_trees_bits(c, bb, tb, hp, z) +int cramfs_inflate_trees_bits(c, bb, tb, hp, z) uIntf *c; /* 19 code lengths */ uIntf *bb; /* bits tree desired/actual depth */ inflate_huft * FAR *tb; /* bits tree result */ @@ -312,7 +312,7 @@ z_streamp z; /* for messages */ return r; } -int inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z) +int cramfs_inflate_trees_dynamic(nl, nd, c, bl, bd, tl, td, hp, z) uInt nl; /* number of literal/length codes */ uInt nd; /* number of distance codes */ uIntf *c; /* that many (total) code lengths */ @@ -377,7 +377,7 @@ z_streamp z; /* for messages */ #include "inffixed.h" -int inflate_trees_fixed(bl, bd, tl, td, z) +int cramfs_inflate_trees_fixed(bl, bd, tl, td, z) uIntf *bl; /* literal desired/actual bit depth */ uIntf *bd; /* distance desired/actual bit depth */ inflate_huft * FAR *tl; /* literal/length tree result */ diff --git a/fs/cramfs/inflate/inftrees.h b/fs/cramfs/inflate/inftrees.h index 85853e097..5d5296985 100644 --- a/fs/cramfs/inflate/inftrees.h +++ b/fs/cramfs/inflate/inftrees.h @@ -32,14 +32,14 @@ struct inflate_huft_s { value below is more than safe. */ #define MANY 1440 -extern int inflate_trees_bits OF(( +extern int cramfs_inflate_trees_bits OF(( uIntf *, /* 19 code lengths */ uIntf *, /* bits tree desired/actual depth */ inflate_huft * FAR *, /* bits tree result */ inflate_huft *, /* space for trees */ z_streamp)); /* for messages */ -extern int inflate_trees_dynamic OF(( +extern int cramfs_inflate_trees_dynamic OF(( uInt, /* number of literal/length codes */ uInt, /* number of distance codes */ uIntf *, /* that many (total) code lengths */ @@ -50,7 +50,7 @@ extern int inflate_trees_dynamic OF(( inflate_huft *, /* space for trees */ z_streamp)); /* for messages */ -extern int inflate_trees_fixed OF(( +extern int cramfs_inflate_trees_fixed OF(( uIntf *, /* literal desired/actual bit depth */ uIntf *, /* distance desired/actual bit depth */ inflate_huft * FAR *, /* literal/length tree result */ diff --git a/fs/cramfs/inflate/infutil.c b/fs/cramfs/inflate/infutil.c index 23b6d96d0..3fffc1059 100644 --- a/fs/cramfs/inflate/infutil.c +++ b/fs/cramfs/inflate/infutil.c @@ -12,7 +12,7 @@ struct inflate_codes_state {int dummy;}; /* for buggy compilers */ /* And'ing with mask[n] masks the lower n bits */ -uInt inflate_mask[17] = { +uInt cramfs_inflate_mask[17] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000f, 0x001f, 0x003f, 0x007f, 0x00ff, 0x01ff, 0x03ff, 0x07ff, 0x0fff, 0x1fff, 0x3fff, 0x7fff, 0xffff @@ -20,7 +20,7 @@ uInt inflate_mask[17] = { /* copy as much as possible from the sliding window to the output area */ -int inflate_flush(s, z, r) +int cramfs_inflate_flush(s, z, r) inflate_blocks_statef *s; z_streamp z; int r; diff --git a/fs/cramfs/inflate/infutil.h b/fs/cramfs/inflate/infutil.h index 99d1135d0..4abbb65f5 100644 --- a/fs/cramfs/inflate/infutil.h +++ b/fs/cramfs/inflate/infutil.h @@ -67,7 +67,7 @@ struct inflate_blocks_state { #define UPDIN {z->avail_in=n;z->total_in+=p-z->next_in;z->next_in=p;} #define UPDOUT {s->write=q;} #define UPDATE {UPDBITS UPDIN UPDOUT} -#define LEAVE {UPDATE return inflate_flush(s,z,r);} +#define LEAVE {UPDATE return cramfs_inflate_flush(s,z,r);} /* get bytes and bits */ #define LOADIN {p=z->next_in;n=z->avail_in;b=s->bitb;k=s->bitk;} #define NEEDBYTE {if(n)r=Z_OK;else LEAVE} @@ -78,17 +78,17 @@ struct inflate_blocks_state { #define WAVAIL (uInt)(q<s->read?s->read-q-1:s->end-q) #define LOADOUT {q=s->write;m=(uInt)WAVAIL;} #define WRAP {if(q==s->end&&s->read!=s->window){q=s->window;m=(uInt)WAVAIL;}} -#define FLUSH {UPDOUT r=inflate_flush(s,z,r); LOADOUT} +#define FLUSH {UPDOUT r=cramfs_inflate_flush(s,z,r); LOADOUT} #define NEEDOUT {if(m==0){WRAP if(m==0){FLUSH WRAP if(m==0) LEAVE}}r=Z_OK;} #define OUTBYTE(a) {*q++=(Byte)(a);m--;} /* load local pointers */ #define LOAD {LOADIN LOADOUT} /* masks for lower bits (size given to avoid silly warnings with Visual C++) */ -extern uInt inflate_mask[17]; +extern uInt cramfs_inflate_mask[17]; /* copy as much as possible from the sliding window to the output area */ -extern int inflate_flush OF(( +extern int cramfs_inflate_flush OF(( inflate_blocks_statef *, z_streamp , int)); diff --git a/fs/cramfs/inflate/uncompr.c b/fs/cramfs/inflate/uncompr.c index 45eb47b72..864eeb27f 100644 --- a/fs/cramfs/inflate/uncompr.c +++ b/fs/cramfs/inflate/uncompr.c @@ -40,16 +40,16 @@ int ZEXPORT uncompress (dest, destLen, source, sourceLen) stream.avail_out = (uInt)*destLen; if ((uLong)stream.avail_out != *destLen) return Z_BUF_ERROR; - err = inflateInit(&stream); + err = cramfs_inflateInit(&stream); if (err != Z_OK) return err; - err = inflate(&stream, Z_FINISH); + err = cramfs_inflate(&stream, Z_FINISH); if (err != Z_STREAM_END) { - inflateEnd(&stream); + cramfs_inflateEnd(&stream); return err == Z_OK ? Z_BUF_ERROR : err; } *destLen = stream.total_out; - err = inflateEnd(&stream); + err = cramfs_inflateEnd(&stream); return err; } diff --git a/fs/cramfs/inflate/zlib.h b/fs/cramfs/inflate/zlib.h index f35937912..d68c523f1 100644 --- a/fs/cramfs/inflate/zlib.h +++ b/fs/cramfs/inflate/zlib.h @@ -291,7 +291,7 @@ ZEXTERN int ZEXPORT deflateEnd OF((z_streamp strm)); /* -ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); +ZEXTERN int ZEXPORT cramfs_inflateInit OF((z_streamp strm)); Initializes the internal stream state for decompression. The fields next_in, avail_in, zalloc, zfree and opaque must be initialized before by @@ -311,7 +311,7 @@ ZEXTERN int ZEXPORT inflateInit OF((z_streamp strm)); */ -ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); +ZEXTERN int ZEXPORT cramfs_inflate OF((z_streamp strm, int flush)); /* inflate decompresses as much data as possible, and stops when the input buffer becomes empty or the output buffer becomes full. It may some @@ -380,7 +380,7 @@ ZEXTERN int ZEXPORT inflate OF((z_streamp strm, int flush)); */ -ZEXTERN int ZEXPORT inflateEnd OF((z_streamp strm)); +ZEXTERN int ZEXPORT cramfs_inflateEnd OF((z_streamp strm)); /* All dynamically allocated data structures for this stream are freed. This function discards any unprocessed input and does not flush any @@ -569,7 +569,7 @@ ZEXTERN int ZEXPORT inflateSetDictionary OF((z_streamp strm, inflate(). */ -ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); +ZEXTERN int ZEXPORT cramfs_inflateSync OF((z_streamp strm)); /* Skips invalid compressed data until a full flush point (see above the description of deflate with Z_FULL_FLUSH) can be found, or until all @@ -584,7 +584,7 @@ ZEXTERN int ZEXPORT inflateSync OF((z_streamp strm)); until success or end of the input data. */ -ZEXTERN int ZEXPORT inflateReset OF((z_streamp strm)); +ZEXTERN int ZEXPORT cramfs_inflateReset OF((z_streamp strm)); /* This function is equivalent to inflateEnd followed by inflateInit, but does not free and reallocate all the internal decompression state. @@ -818,7 +818,7 @@ ZEXTERN const char * ZEXPORT gzerror OF((gzFile file, int *errnum)); compression library. */ -ZEXTERN uLong ZEXPORT adler32 OF((uLong adler, const Bytef *buf, uInt len)); +ZEXTERN uLong ZEXPORT cramfs_adler32 OF((uLong adler, const Bytef *buf, uInt len)); /* Update a running Adler-32 checksum with the bytes buf[0..len-1] and @@ -859,23 +859,23 @@ ZEXTERN uLong ZEXPORT crc32 OF((uLong crc, const Bytef *buf, uInt len)); */ ZEXTERN int ZEXPORT deflateInit_ OF((z_streamp strm, int level, const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit_ OF((z_streamp strm, +ZEXTERN int ZEXPORT cramfs_inflateInit_ OF((z_streamp strm, const char *version, int stream_size)); ZEXTERN int ZEXPORT deflateInit2_ OF((z_streamp strm, int level, int method, int windowBits, int memLevel, int strategy, const char *version, int stream_size)); -ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, +ZEXTERN int ZEXPORT cramfs_inflateInit2_ OF((z_streamp strm, int windowBits, const char *version, int stream_size)); #define deflateInit(strm, level) \ deflateInit_((strm), (level), ZLIB_VERSION, sizeof(z_stream)) -#define inflateInit(strm) \ - inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) +#define cramfs_inflateInit(strm) \ + cramfs_inflateInit_((strm), ZLIB_VERSION, sizeof(z_stream)) #define deflateInit2(strm, level, method, windowBits, memLevel, strategy) \ deflateInit2_((strm),(level),(method),(windowBits),(memLevel),\ (strategy), ZLIB_VERSION, sizeof(z_stream)) #define inflateInit2(strm, windowBits) \ - inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) + cramfs_inflateInit2_((strm), (windowBits), ZLIB_VERSION, sizeof(z_stream)) #if !defined(_Z_UTIL_H) && !defined(NO_DUMMY_DECL) @@ -883,7 +883,7 @@ ZEXTERN int ZEXPORT inflateInit2_ OF((z_streamp strm, int windowBits, #endif ZEXTERN const char * ZEXPORT zError OF((int err)); -ZEXTERN int ZEXPORT inflateSyncPoint OF((z_streamp z)); +ZEXTERN int ZEXPORT cramfs_inflateSyncPoint OF((z_streamp z)); ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void)); #ifdef __cplusplus diff --git a/fs/cramfs/uncompress.c b/fs/cramfs/uncompress.c index 7a34b2b30..d946b56e7 100644 --- a/fs/cramfs/uncompress.c +++ b/fs/cramfs/uncompress.c @@ -33,14 +33,14 @@ int cramfs_uncompress_block(void *dst, int dstlen, void *src, int srclen) stream.next_out = dst; stream.avail_out = dstlen; - err = inflateReset(&stream); + err = cramfs_inflateReset(&stream); if (err != Z_OK) { - printk("inflateReset error %d\n", err); - inflateEnd(&stream); - inflateInit(&stream); + printk("cramfs_inflateReset error %d\n", err); + cramfs_inflateEnd(&stream); + cramfs_inflateInit(&stream); } - err = inflate(&stream, Z_FINISH); + err = cramfs_inflate(&stream, Z_FINISH); if (err != Z_STREAM_END) goto err; return stream.total_out; @@ -56,7 +56,7 @@ int cramfs_uncompress_init(void) if (!initialized++) { stream.next_in = NULL; stream.avail_in = 0; - inflateInit(&stream); + cramfs_inflateInit(&stream); } return 0; } @@ -64,6 +64,6 @@ int cramfs_uncompress_init(void) int cramfs_uncompress_exit(void) { if (!--initialized) - inflateEnd(&stream); + cramfs_inflateEnd(&stream); return 0; } |