#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"
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 z_inbuf_empty | ( | z | ) | ((z)->avail_in <= 0) |
Definition at line 57 of file zlibreader.c.
#define z_outbuf_full | ( | z | ) | ((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 struct _RDD_ZLIB_READER RDD_ZLIB_READER |
int rdd_open_zlib_reader | ( | RDD_READER ** | r, | |
RDD_READER * | p | |||
) |
Instantiates a reader that decompresses zlib-compressed data.
r | output value: a new reader object. | |
p | 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.
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.
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.
static int rdd_zlib_seek | ( | RDD_READER * | r, | |
rdd_count_t | pos | |||
) | [static] |
static int rdd_zlib_tell | ( | RDD_READER * | r, | |
rdd_count_t * | pos | |||
) | [static] |
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.
RDD_READ_OPS zlib_read_ops [static] |
Initial value:
Definition at line 76 of file zlibreader.c.