libgpac
Documentation of the core library of GPAC
gzio.c File Reference
#include <gpac/tools.h>
#include "zutil.h"
+ Include dependency graph for gzio.c:

Data Structures

struct  internal_state
 
struct  gz_stream
 

Macros

#define NO_GZCOMPRESS
 
#define Z_BUFSIZE   16384
 
#define Z_PRINTF_BUFSIZE   4096
 
#define ALLOC(size)   gf_malloc(size)
 
#define TRYFREE(p)   {if (p) gf_free(p);}
 
#define ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */
 
#define HEAD_CRC   0x02 /* bit 1 set: header CRC present */
 
#define EXTRA_FIELD   0x04 /* bit 2 set: extra field present */
 
#define ORIG_NAME   0x08 /* bit 3 set: original file name present */
 
#define COMMENT   0x10 /* bit 4 set: file comment present */
 
#define RESERVED   0xE0 /* bits 5..7: reserved */
 
#define zstrerror(errnum)   ""
 

Functions

void check_header OF ((gz_stream *s))
 
GF_EXPORT void * gf_gzopen (const char *path, const char *mode)
 
int get_byte (gz_stream *s)
 
void check_header (gz_stream *s)
 
int destroy (gz_stream *s)
 
GF_EXPORT int gf_gzread (void *file, voidp buf, unsigned len)
 
GF_EXPORT int gf_gzgetc (void *file)
 
GF_EXPORT char * gf_gzgets (void *file, char *buf, int len)
 
GF_EXPORT s64 gf_gzrewind (void *file)
 
GF_EXPORT u64 gf_gzseek (void *file, u64 _offset, int whence)
 
GF_EXPORT u64 gf_gztell (void *file)
 
GF_EXPORT int gf_gzeof (void *file)
 
GF_EXPORT int gf_gzdirect (void *file)
 
uLong getLong (gz_stream *s)
 
GF_EXPORT int gf_gzclose (void *file)
 
GF_EXPORT const char * gf_gzerror (void *file, int *errnum)
 
GF_EXPORT void gf_gzclearerr (void *file)
 

Variables

static int const gz_magic [2] = {0x1f, 0x8b}
 
const char *const gf_z_errmsg [10]
 

Data Structure Documentation

◆ internal_state

struct internal_state
Data Fields
int dummy

◆ gz_stream

struct gz_stream
Data Fields
z_stream stream
int z_err
int z_eof
FILE * file
Byte * inbuf
Byte * outbuf
uLong crc
char * msg
char * path
int transparent
char mode
z_off_t start
z_off_t in
z_off_t out
int back
int last

Macro Definition Documentation

◆ NO_GZCOMPRESS

#define NO_GZCOMPRESS

◆ Z_BUFSIZE

#define Z_BUFSIZE   16384

◆ Z_PRINTF_BUFSIZE

#define Z_PRINTF_BUFSIZE   4096

◆ ALLOC

#define ALLOC (   size)    gf_malloc(size)

◆ TRYFREE

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

◆ ASCII_FLAG

#define ASCII_FLAG   0x01 /* bit 0 set: file probably ascii text */

◆ HEAD_CRC

#define HEAD_CRC   0x02 /* bit 1 set: header CRC present */

◆ EXTRA_FIELD

#define EXTRA_FIELD   0x04 /* bit 2 set: extra field present */

◆ ORIG_NAME

#define ORIG_NAME   0x08 /* bit 3 set: original file name present */

◆ COMMENT

#define COMMENT   0x10 /* bit 4 set: file comment present */

◆ RESERVED

#define RESERVED   0xE0 /* bits 5..7: reserved */

◆ zstrerror

#define zstrerror (   errnum)    ""

Function Documentation

◆ OF()

uLong getLong OF ( (gz_stream *s)  )

◆ get_byte()

int get_byte ( gz_stream s)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ check_header()

void check_header ( gz_stream s)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ destroy()

int destroy ( gz_stream s)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLong()

uLong getLong ( gz_stream s)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Variable Documentation

◆ gz_magic

int const gz_magic[2] = {0x1f, 0x8b}
static

◆ gf_z_errmsg

const char* const gf_z_errmsg[10]
Initial value:
= {
"need dictionary",
"stream end",
"",
"file error",
"stream error",
"data error",
"insufficient memory",
"buffer error",
"incompatible version",
""
}