Visualization Library 2.0.0-b5

A lightweight C++ OpenGL middleware for 2D/3D graphics

VL     Star     Watch     Fork     Issue

[Download] [Tutorials] [All Classes] [Grouped Classes]
Macros | Functions
gzjoin.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <unistd.h>
#include "zlib.h"

Go to the source code of this file.

Macros

#define local   static
 
#define CHUNK   32768 /* must be a power of two and fit in unsigned */
 
#define bget(in)
 

Functions

local int bail (char *why1, char *why2)
 
local void bclose (bin *in)
 
local bin * bopen (char *name)
 
local int bload (bin *in)
 
local unsigned long bget4 (bin *in)
 
local void bskip (bin *in, unsigned skip)
 
local void gzhead (bin *in)
 
local void put4 (unsigned long val, FILE *out)
 
local void zpull (z_streamp strm, bin *in)
 
local void gzinit (unsigned long *crc, unsigned long *tot, FILE *out)
 
local void gzcopy (char *name, int clr, unsigned long *crc, unsigned long *tot, FILE *out)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ bget

#define bget (   in)
Value:
(in->left ? 0 : bload(in), \
in->left ? (in->left--, *(in->next)++) : \
bail("unexpected end of file on ", in->name))
local int bload(bin *in)
Definition: gzjoin.c:121
GLuint in

Definition at line 140 of file gzjoin.c.

Referenced by bget4(), and gzhead().

◆ CHUNK

#define CHUNK   32768 /* must be a power of two and fit in unsigned */

Definition at line 75 of file gzjoin.c.

Referenced by bload(), bopen(), bskip(), and gzcopy().

◆ local

#define local   static

Definition at line 63 of file gzjoin.c.

Function Documentation

◆ bail()

local int bail ( char *  why1,
char *  why2 
)

Definition at line 66 of file gzjoin.c.

Referenced by bskip(), gzcopy(), gzhead(), and zpull().

◆ bclose()

local void bclose ( bin *  in)

Definition at line 87 of file gzjoin.c.

References close(), free(), and NULL.

Referenced by bopen(), and gzcopy().

◆ bget4()

local unsigned long bget4 ( bin *  in)

Definition at line 145 of file gzjoin.c.

References bget, and long().

Referenced by gzcopy().

◆ bload()

local int bload ( bin *  in)

Definition at line 121 of file gzjoin.c.

References CHUNK, long(), NULL, and read().

Referenced by bskip(), and zpull().

◆ bopen()

local bin* bopen ( char *  name)

Definition at line 100 of file gzjoin.c.

References bclose(), CHUNK, malloc(), NULL, and open().

Referenced by gzcopy().

◆ bskip()

local void bskip ( bin *  in,
unsigned  skip 
)

Definition at line 157 of file gzjoin.c.

References bail(), bload(), CHUNK, lseek(), NULL, read(), SEEK_CUR, and skip().

Referenced by gzhead().

◆ gzcopy()

local void gzcopy ( char *  name,
int  clr,
unsigned long crc,
unsigned long tot,
FILE *  out 
)

◆ gzhead()

local void gzhead ( bin *  in)

Definition at line 204 of file gzjoin.c.

References bail(), bget, and bskip().

Referenced by gzcopy().

◆ gzinit()

local void gzinit ( unsigned long crc,
unsigned long tot,
FILE *  out 
)

Definition at line 265 of file gzjoin.c.

References crc32(), and Z_NULL.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 427 of file gzjoin.c.

References gzcopy(), and gzinit().

◆ put4()

local void put4 ( unsigned long  val,
FILE *  out 
)

Definition at line 245 of file gzjoin.c.

Referenced by gzcopy().

◆ zpull()

local void zpull ( z_streamp  strm,
bin *  in 
)

Definition at line 254 of file gzjoin.c.

References bail(), and bload().

Referenced by gzcopy().