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
zran.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "zlib.h"

Go to the source code of this file.

Macros

#define local   static
 
#define SPAN   1048576L /* desired distance between access points */
 
#define WINSIZE   32768U /* sliding window size */
 
#define CHUNK   16384 /* file input buffer size */
 

Functions

local void free_index (struct access *index)
 
local struct accessaddpoint (struct access *index, int bits, off_t in, off_t out, unsigned left, unsigned char *window)
 
local int build_index (FILE *in, off_t span, struct access **built)
 
local int extract (FILE *in, struct access *index, off_t offset, unsigned char *buf, int len)
 
int main (int argc, char **argv)
 

Macro Definition Documentation

◆ CHUNK

#define CHUNK   16384 /* file input buffer size */

Definition at line 64 of file zran.c.

Referenced by build_index(), extract(), and main().

◆ local

#define local   static

Definition at line 60 of file zran.c.

◆ SPAN

#define SPAN   1048576L /* desired distance between access points */

Definition at line 62 of file zran.c.

Referenced by main().

◆ WINSIZE

#define WINSIZE   32768U /* sliding window size */

Definition at line 63 of file zran.c.

Referenced by extract().

Function Documentation

◆ addpoint()

local struct access* addpoint ( struct access index,
int  bits,
off_t  in,
off_t  out,
unsigned  left,
unsigned char *  window 
)

Definition at line 92 of file zran.c.

◆ build_index()

local int build_index ( FILE *  in,
off_t  span,
struct access **  built 
)

Definition at line 144 of file zran.c.

References CHUNK.

Referenced by main().

◆ extract()

local int extract ( FILE *  in,
struct access index,
off_t  offset,
unsigned char *  buf,
int  len 
)

◆ free_index()

local void free_index ( struct access index)

Definition at line 82 of file zran.c.

References free(), and NULL.

Referenced by main().

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 354 of file zran.c.

References build_index(), CHUNK, extract(), free_index(), NULL, SPAN, Z_DATA_ERROR, Z_ERRNO, and Z_MEM_ERROR.