src/zlibreader.c File Reference

#include <assert.h>
#include <stdlib.h>
#include <sys/types.h>
#include <errno.h>
#include <string.h>
#include <unistd.h>
#include <zlib.h>
#include "rdd.h"
#include "reader.h"

Include dependency graph for zlibreader.c:

Go to the source code of this file.

Data Structures

struct  _RDD_ZLIB_READER

Defines

#define z_inbuf_empty(z)   ((z)->avail_in <= 0)
#define z_outbuf_full(z)   ((z)->avail_out <= 0)
#define ZBUF_SIZE   32768

Typedefs

typedef struct _RDD_ZLIB_READER RDD_ZLIB_READER

Functions

int rdd_open_zlib_reader (RDD_READER **self, RDD_READER *parent)
 Instantiates a reader that decompresses zlib-compressed data.
static int rdd_zlib_close (RDD_READER *r, int recurse)
static int rdd_zlib_read (RDD_READER *r, unsigned char *buf, unsigned nbyte, unsigned *nread)
static int rdd_zlib_seek (RDD_READER *r, rdd_count_t pos)
static int rdd_zlib_tell (RDD_READER *r, rdd_count_t *pos)

Variables

static char copyright []
static RDD_READ_OPS zlib_read_ops


Define Documentation

#define z_inbuf_empty (  )     ((z)->avail_in <= 0)

Definition at line 57 of file zlibreader.c.

#define z_outbuf_full (  )     ((z)->avail_out <= 0)

Definition at line 58 of file zlibreader.c.

#define ZBUF_SIZE   32768

Definition at line 55 of file zlibreader.c.


Typedef Documentation


Function Documentation

int rdd_open_zlib_reader ( RDD_READER **  r,
RDD_READER p 
)

Instantiates a reader that decompresses zlib-compressed data.

Parameters:
r output value: a new reader object.
p an existing parent reader.
A zlib reader adds transparent decompression to an existing parent reader p that reads zlib-compressed data.

Note: a zlib reader does not implement the seek() routine.

Definition at line 84 of file zlibreader.c.

References error(), _RDD_ZLIB_READER::parent, _RDD_ZLIB_READER::pos, RDD_ECOMPRESS, rdd_new_reader(), RDD_NOMEM, RDD_OK, _RDD_READER::state, _RDD_ZLIB_READER::zbuf, ZBUF_SIZE, and _RDD_ZLIB_READER::zstate.

Here is the call graph for this function:

static int rdd_zlib_close ( RDD_READER r,
int  recurse 
) [static]

Definition at line 191 of file zlibreader.c.

References _RDD_ZLIB_READER::parent, RDD_ECOMPRESS, RDD_OK, rdd_reader_close(), _RDD_ZLIB_READER::zbuf, and _RDD_ZLIB_READER::zstate.

Here is the call graph for this function:

static int rdd_zlib_read ( RDD_READER r,
unsigned char *  buf,
unsigned  nbyte,
unsigned *  nread 
) [static]

Definition at line 136 of file zlibreader.c.

References _RDD_ZLIB_READER::parent, _RDD_ZLIB_READER::pos, RDD_ECOMPRESS, RDD_OK, rdd_reader_read(), _RDD_ZLIB_READER::zbuf, ZBUF_SIZE, and _RDD_ZLIB_READER::zstate.

Here is the call graph for this function:

static int rdd_zlib_seek ( RDD_READER r,
rdd_count_t  pos 
) [static]

Definition at line 185 of file zlibreader.c.

References RDD_ESEEK.

static int rdd_zlib_tell ( RDD_READER r,
rdd_count_t pos 
) [static]

Definition at line 176 of file zlibreader.c.

References _RDD_ZLIB_READER::pos, and RDD_OK.


Variable Documentation

char copyright[] [static]

Initial value:

"@(#) Copyright (c) 2002-2004\n\
    Netherlands Forensic Institute.  All rights reserved.\n"

Definition at line 34 of file zlibreader.c.

Initial value:

Definition at line 76 of file zlibreader.c.


Generated on Sun Feb 6 12:36:42 2011 for rdd by  doxygen 1.5.6