Biomedical Image Analysis Library
The Biomedical Image Analysis Library is a poweful tool for developers, physicians, researchers, engineers, and so on.
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"
Include dependency graph for gun.c:

Go to the source code of this file.

Classes

struct  ind
 
struct  outd
 

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

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

Variables

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

Class Documentation

struct ind

Definition at line 81 of file gun.c.

Collaboration diagram for ind:
Collaboration graph
Class Members
unsigned char * inbuf
int infile
struct outd

Definition at line 119 of file gun.c.

Collaboration diagram for outd:
Collaboration graph
Class Members
int check
unsigned long crc
int outfile
unsigned long total

Macro Definition Documentation

#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

Definition at line 171 of file gun.c.

#define local   static

Definition at line 73 of file gun.c.

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

Definition at line 155 of file gun.c.

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

Definition at line 77 of file gun.c.

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

Definition at line 76 of file gun.c.

Function Documentation

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

Definition at line 517 of file gun.c.

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

Definition at line 383 of file gun.c.

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

Definition at line 548 of file gun.c.

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

Definition at line 89 of file gun.c.

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

Definition at line 200 of file gun.c.

int main ( int  argc,
char **  argv 
)

Definition at line 631 of file gun.c.

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

Definition at line 131 of file gun.c.

Variable Documentation

unsigned char inbuf[32768U ]

Definition at line 161 of file gun.c.

unsigned char match[65280+2]

Definition at line 165 of file gun.c.

unsigned char outbuf[32768U ]

Definition at line 162 of file gun.c.

unsigned short prefix[65536]

Definition at line 163 of file gun.c.

unsigned char suffix[65536]

Definition at line 164 of file gun.c.