summaryrefslogtreecommitdiff
path: root/src/fontfile/gunzip.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fontfile/gunzip.c')
-rw-r--r--src/fontfile/gunzip.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/fontfile/gunzip.c b/src/fontfile/gunzip.c
index a303f21..21894d0 100644
--- a/src/fontfile/gunzip.c
+++ b/src/fontfile/gunzip.c
@@ -2,6 +2,7 @@
/* lib/font/fontfile/gunzip.c
written by Mark Eichin <eichin@kitten.gen.ma.us> September 1996.
intended for inclusion in X11 public releases. */
+/* $XFree86: xc/lib/font/fontfile/gunzip.c,v 1.5 2001/01/17 19:43:30 dawes Exp $ */
#include "fontmisc.h"
#include <bufio.h>
@@ -15,14 +16,13 @@ typedef struct _xzip_buf {
BufFilePtr f;
} xzip_buf;
-static int BufZipFileSkip(); /* f, count */
-static int BufZipFileFill(); /* read: f; write: char, f */
-static int BufZipFileClose(); /* f, flag */
-static int BufCheckZipHeader(); /* f */
+static int BufZipFileClose ( BufFilePtr f, int flag );
+static int BufZipFileFill ( BufFilePtr f );
+static int BufZipFileSkip ( BufFilePtr f, int c );
+static int BufCheckZipHeader ( BufFilePtr f );
BufFilePtr
-BufFilePushZIP (f)
- BufFilePtr f;
+BufFilePushZIP (BufFilePtr f)
{
xzip_buf *x;
@@ -58,15 +58,15 @@ BufFilePushZIP (f)
return 0;
}
- return BufFileCreate(x,
+ return BufFileCreate((char *)x,
BufZipFileFill,
+ 0,
BufZipFileSkip,
BufZipFileClose);
}
-static int BufZipFileClose(f, flag)
- BufFilePtr f;
- int flag;
+static int
+BufZipFileClose(BufFilePtr f, int flag)
{
xzip_buf *x = (xzip_buf *)f->private;
inflateEnd (&(x->z));
@@ -84,8 +84,8 @@ static int BufZipFileClose(f, flag)
Z_STREAM_END, we then have 4bytes CRC and 4bytes length...
gzio.c:gzread shows most of the mechanism.
*/
-static int BufZipFileFill (f)
- BufFilePtr f;
+static int
+BufZipFileFill (BufFilePtr f)
{
xzip_buf *x = (xzip_buf *)f->private;
@@ -102,7 +102,8 @@ static int BufZipFileFill (f)
case Z_STREAM_END:
case Z_DATA_ERROR:
case Z_ERRNO:
- return BUFFILEEOF;
+ f->left = 0;
+ return BUFFILEEOF;
default:
return BUFFILEEOF;
}
@@ -148,9 +149,8 @@ static int BufZipFileFill (f)
}
/* there should be a BufCommonSkip... */
-static int BufZipFileSkip (f, c)
- BufFilePtr f;
- int c;
+static int
+BufZipFileSkip (BufFilePtr f, int c)
{
/* BufFileRawSkip returns the count unchanged.
BufCompressedSkip returns 0.
@@ -191,8 +191,8 @@ static int BufZipFileSkip (f, c)
#define RESERVED 0xE0 /* bits 5..7: reserved */
#define GET(f) do {c = BufFileGet(f); if (c == BUFFILEEOF) return c;} while(0)
-static int BufCheckZipHeader(f)
- BufFilePtr f;
+static int
+BufCheckZipHeader(BufFilePtr f)
{
int c, flags;
GET(f); if (c != 0x1f) return 1; /* magic 1 */