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 | Variables
gun.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <utime.h>
#include "zlib.h"

Go to the source code of this file.

Macros

#define local   static
 
#define SIZE   32768U /* input and output buffer sizes */
 
#define PIECE   16384 /* limits i/o chunks for 16-bit int case */
 
#define NEXT()
 
#define FLUSHCODE()
 

Functions

local unsigned in (void *in_desc, z_const unsigned char **buf)
 
local int out (void *out_desc, unsigned char *buf, unsigned len)
 
local int lunpipe (unsigned have, z_const unsigned char *next, struct ind *indp, int outfile, z_stream *strm)
 
local int gunpipe (z_stream *strm, int infile, int outfile)
 
local void copymeta (char *from, char *to)
 
local int gunzip (z_stream *strm, char *inname, char *outname, int test)
 
int main (int argc, char **argv)
 

Variables

unsigned char inbuf [SIZE]
 
unsigned char outbuf [SIZE]
 
unsigned short prefix [65536]
 
unsigned char suffix [65536]
 
unsigned char match [65280+2]
 

Macro Definition Documentation

◆ FLUSHCODE

#define FLUSHCODE ( )
Value:
do { \
left = 0; \
rem = 0; \
if (chunk > have) { \
chunk -= have; \
have = 0; \
if (NEXT() == -1) \
break; \
chunk--; \
if (chunk > have) { \
chunk = have = 0; \
break; \
} \
} \
have -= chunk; \
next += chunk; \
chunk = 0; \
} while (0)
#define NEXT()
Definition: gun.c:155
png_infop int chunk
Definition: png.h:2339

Definition at line 171 of file gun.c.

Referenced by lunpipe().

◆ local

#define local   static

Definition at line 73 of file gun.c.

◆ NEXT

#define NEXT ( )
Value:
(have ? 0 : (have = in(indp, &next)), \
last = have ? (have--, (int)(*next++)) : -1)
local unsigned in(void *in_desc, z_const unsigned char **buf)
Definition: gun.c:89

Definition at line 155 of file gun.c.

Referenced by gunpipe(), and lunpipe().

◆ PIECE

#define PIECE   16384 /* limits i/o chunks for 16-bit int case */

Definition at line 77 of file gun.c.

Referenced by in(), and out().

◆ SIZE

#define SIZE   32768U /* input and output buffer sizes */

Definition at line 76 of file gun.c.

Referenced by in(), and lunpipe().

Function Documentation

◆ copymeta()

local void copymeta ( char *  from,
char *  to 
)

Definition at line 517 of file gun.c.

References void().

◆ gunpipe()

local int gunpipe ( z_stream strm,
int  infile,
int  outfile 
)

◆ gunzip()

local int gunzip ( z_stream strm,
char *  inname,
char *  outname,
int  test 
)

Definition at line 548 of file gun.c.

◆ in()

local unsigned in ( void in_desc,
z_const unsigned char **  buf 
)

Definition at line 89 of file gun.c.

References int, outfile, PIECE, read(), and SIZE.

◆ lunpipe()

local int lunpipe ( unsigned  have,
z_const unsigned char *  next,
struct ind *  indp,
int  outfile,
z_stream strm 
)

Definition at line 200 of file gun.c.

References bits, chunk, code, FLUSHCODE, match, max, z_stream_s::msg, NEXT, z_stream_s::next_in, out(), outbuf, outfile, prefix, SIZE, suffix, Z_BUF_ERROR, Z_DATA_ERROR, and Z_OK.

Referenced by gunpipe().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 631 of file gun.c.

◆ out()

local int out ( void out_desc,
unsigned char *  buf,
unsigned  len 
)

Definition at line 131 of file gun.c.

References crc32(), int, PIECE, and write().

Referenced by gzfilebuf::attach(), gzofstream::attach(), vl::compress(), vl::Camera::computeRay(), convert1(), vl::decompress(), def(), vl::PixelLODEvaluator::evaluate(), extract(), file_compress(), file_uncompress(), FT_GlyphLoader_CopyPoints(), FT_Outline_EmboldenXY(), vl::Matrix2< T_Scalar >::getIdentity(), vl::Matrix3< T_Scalar >::getIdentity(), vl::Matrix4< float >::getIdentity(), vl::Quaternion< T_Scalar >::getInverse(), vl::Matrix4< float >::getInverse(), vl::Quaternion< T_Scalar >::getNlerp(), vl::Matrix2< T_Scalar >::getNull(), vl::Matrix3< T_Scalar >::getNull(), vl::Matrix4< float >::getNull(), vl::Matrix4< float >::getRotation(), vl::Matrix3< T_Scalar >::getScaling(), vl::Matrix4< float >::getScaling(), vl::Matrix3< T_Scalar >::getTranslation(), vl::Matrix4< float >::getTranslation(), gunpipe(), gz_compress(), gztack(), inf(), inflate(), inflate_fast(), inflateBack(), inflateSync(), init_error_limit(), vl::Matrix4< float >::invert(), gzifstream::is_open(), gzofstream::is_open(), lunpipe(), main(), vl::Matrix2< T_Scalar >::multiply(), vl::Matrix3< T_Scalar >::multiply(), vl::Matrix4< float >::multiply(), gzfilebuf::open(), gzofstream::open(), gzfilebuf::open_mode(), gzfilebuf::overflow(), vl::Say::parse(), vlX::VisitorExportToVLT::rawtextEncode(), vlX::VisitorExportToVLT::stringEncode(), vl::TriangleStripGenerator::stripfy(), vl::Quaternion< T_Scalar >::toMatrix3(), vl::Quaternion< T_Scalar >::toMatrix4(), and try().

Variable Documentation

◆ inbuf

unsigned char inbuf[SIZE]

Definition at line 161 of file gun.c.

Referenced by gunpipe().

◆ match

unsigned char match[65280+2]

◆ outbuf

unsigned char outbuf[SIZE]

Definition at line 162 of file gun.c.

Referenced by lunpipe().

◆ prefix

unsigned short prefix[65536]

Definition at line 163 of file gun.c.

Referenced by lunpipe(), vlX::VLXSerializer::reset(), and try().

◆ suffix

unsigned char suffix[65536]

Definition at line 164 of file gun.c.

Referenced by lunpipe().