fltk 1.3.0rc3
About: FLTK (Fast Light Tool Kit) is a cross-platform C++ GUI toolkit for UNIX/Linux (X11), Microsoft Windows, and MacOS X. Release candidate.
  SfR Fresh Dox: fltk-1.3.0rc3-source.tar.gz ("inofficial" and yet experimental doxygen-generated source code documentation)  

gzio.c File Reference

#include <stdio.h>
#include "zutil.h"
Include dependency graph for gzio.c:

Go to the source code of this file.

Classes

struct  internal_state
struct  gz_stream

Defines

#define Z_BUFSIZE   16384
#define Z_PRINTF_BUFSIZE   4096
#define ALLOC(size)   malloc(size)
#define TRYFREE(p)   {if (p) free(p);}
#define ASCII_FLAG   0x01
#define HEAD_CRC   0x02
#define EXTRA_FIELD   0x04
#define ORIG_NAME   0x08
#define COMMENT   0x10
#define RESERVED   0xE0
#define zstrerror(errnum)   ""

Typedefs

typedef struct gz_stream gz_stream

Functions

voidp malloc OF ((uInt size))
void free OF ((voidpf ptr))
local gzFile gz_open OF ((const char *path, const char *mode, intfd))
local int do_flush OF ((gzFile file, int flush))
local int get_byte OF ((gz_stream *s))
local void putLong OF ((FILE *file, uLong x))
local gzFile gz_open (char *path, const char *mode, int fd) const
gzFile ZEXPORT gzopen (char *path, const char *mode) const
gzFile ZEXPORT gzdopen (int fd, const char *mode)
int ZEXPORT gzsetparams (gzFile file, int level, int strategy)
local int get_byte (gz_stream *s)
local void check_header (gz_stream *s)
local int destroy (gz_stream *s)
int ZEXPORT gzread (gzFile file, voidp buf, unsigned len)
int ZEXPORT gzgetc (gzFile file)
int ZEXPORT gzungetc (int c, gzFile file)
char *ZEXPORT gzgets (gzFile file, char *buf, int len)
int ZEXPORT gzwrite (gzFile file, voidpc buf, unsigned len)
int ZEXPORTVA gzprintf (gzFile file, const char *format, int a1, int a2, int a3, int a4, int a5, int a6, int a7, int a8, int a9, int a10, int a11, int a12, int a13, int a14, int a15, int a16, int a17, int a18, int a19, int a20)
int ZEXPORT gzputc (gzFile file, int c)
int ZEXPORT gzputs (gzFile file, const char *s)
local int do_flush (gzFile file, int flush)
int ZEXPORT gzflush (gzFile file, int flush)
z_off_t ZEXPORT gzseek (gzFile file, z_off_t offset, int whence)
int ZEXPORT gzrewind (gzFile file)
z_off_t ZEXPORT gztell (gzFile file)
int ZEXPORT gzeof (gzFile file)
int ZEXPORT gzdirect (gzFile file)
local void putLong (FILE *file, uLong x)
local uLong getLong (gz_stream *s)
int ZEXPORT gzclose (gzFile file)
const char *ZEXPORT gzerror (gzFile file, int *errnum)
void ZEXPORT gzclearerr (gzFile file)

Define Documentation

#define ALLOC (   size)    malloc(size)

Definition at line 43 of file gzio.c.

Referenced by gz_open(), gzerror(), and gzseek().

#define ASCII_FLAG   0x01

Definition at line 49 of file gzio.c.

#define COMMENT   0x10

Definition at line 53 of file gzio.c.

Referenced by check_header().

#define EXTRA_FIELD   0x04

Definition at line 51 of file gzio.c.

Referenced by check_header().

#define HEAD_CRC   0x02

Definition at line 50 of file gzio.c.

Referenced by check_header().

#define ORIG_NAME   0x08

Definition at line 52 of file gzio.c.

Referenced by check_header().

#define RESERVED   0xE0

Definition at line 54 of file gzio.c.

Referenced by check_header().

#define TRYFREE (   p)    {if (p) free(p);}

Definition at line 44 of file gzio.c.

Referenced by destroy(), and gzerror().

#define Z_BUFSIZE   16384

Definition at line 26 of file gzio.c.

Referenced by check_header(), do_flush(), get_byte(), gz_open(), gzread(), gzseek(), gzsetparams(), and gzwrite().

#define Z_PRINTF_BUFSIZE   4096

Definition at line 30 of file gzio.c.

Referenced by gzprintf().

#define zstrerror (   errnum)    ""

Definition at line 977 of file gzio.c.

Referenced by gzerror().


Typedef Documentation

typedef struct gz_stream gz_stream

Function Documentation

local void check_header ( gz_stream s)

Definition at line 288 of file gzio.c.

References COMMENT, EXTRA_FIELD, flags, get_byte(), HEAD_CRC, method, ORIG_NAME, RESERVED, Z_BUFSIZE, Z_DATA_ERROR, Z_DEFLATED, Z_ERRNO, and Z_OK.

Referenced by gz_open(), and gzread().

local int destroy ( gz_stream s)

Definition at line 355 of file gzio.c.

References deflateEnd(), inflateEnd(), NULL, TRYFREE, Z_ERRNO, Z_OK, and Z_STREAM_ERROR.

Referenced by gz_open(), and gzclose().

local int get_byte ( gz_stream s)

Definition at line 261 of file gzio.c.

References z_stream_s::avail_in, gz_stream::stream, Z_BUFSIZE, and Z_ERRNO.

Referenced by check_header(), and getLong().

local uLong getLong ( gz_stream s)

Definition at line 935 of file gzio.c.

References get_byte(), x, and Z_DATA_ERROR.

Referenced by gzread().

void ZEXPORT gzclearerr ( gzFile  file)

Definition at line 1017 of file gzio.c.

References gz_stream::file, NULL, gz_stream::z_eof, gz_stream::z_err, Z_OK, and Z_STREAM_END.

int ZEXPORT gzclose ( gzFile  file)
int ZEXPORT gzdirect ( gzFile  file)

Definition at line 908 of file gzio.c.

References gz_stream::mode, NULL, and gz_stream::transparent.

gzFile ZEXPORT gzdopen ( int  fd,
const char *  mode 
)

Definition at line 219 of file gzio.c.

References gz_open(), name, and Z_NULL.

int ZEXPORT gzeof ( gzFile  file)

Definition at line 891 of file gzio.c.

References gz_stream::mode, NULL, gz_stream::z_eof, gz_stream::z_err, and Z_STREAM_END.

const char* ZEXPORT gzerror ( gzFile  file,
int *  errnum 
)
int ZEXPORT gzflush ( gzFile  file,
int  flush 
)

Definition at line 746 of file gzio.c.

References do_flush(), gz_stream::file, gz_stream::z_err, Z_OK, and Z_STREAM_END.

int ZEXPORT gzgetc ( gzFile  file)

Definition at line 503 of file gzio.c.

References gzread().

char* ZEXPORT gzgets ( gzFile  file,
char *  buf,
int  len 
)

Definition at line 540 of file gzio.c.

References b, buf, gzread(), and Z_NULL.

gzFile ZEXPORT gzopen ( char *  path,
const char *  mode 
) const

Definition at line 208 of file gzio.c.

References gz_open().

int ZEXPORTVA gzprintf ( gzFile  file,
const char *  format,
int  a1,
int  a2,
int  a3,
int  a4,
int  a5,
int  a6,
int  a7,
int  a8,
int  a9,
int  a10,
int  a11,
int  a12,
int  a13,
int  a14,
int  a15,
int  a16,
int  a17,
int  a18,
int  a19,
int  a20 
)

Definition at line 637 of file gzio.c.

References buf, gzwrite(), snprintf, and Z_PRINTF_BUFSIZE.

int ZEXPORT gzputc ( gzFile  file,
int  c 
)

Definition at line 678 of file gzio.c.

References gzwrite(), and int.

int ZEXPORT gzputs ( gzFile  file,
const char *  s 
)

Definition at line 693 of file gzio.c.

References gzwrite().

int ZEXPORT gzsetparams ( gzFile  file,
int  level,
int  strategy 
)
z_off_t ZEXPORT gztell ( gzFile  file)

Definition at line 881 of file gzio.c.

References gzseek(), and SEEK_CUR.

int ZEXPORT gzungetc ( int  c,
gzFile  file 
)
local int do_flush OF ( (gzFile file, int flush)  )
local gzFile gz_open OF ( (const char *path, const char *mode, intfd)  )
local void putLong OF ( (FILE *file, uLong x )
voidp malloc OF ( (uInt size )
void free OF ( (voidpf ptr )
local int get_byte OF ( (gz_stream *s)  )
local void putLong ( FILE *  file,
uLong  x 
)

Definition at line 920 of file gzio.c.

Referenced by gzclose().