src/zlibwriter.c File Reference

#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "rdd.h"
#include "writer.h"

Include dependency graph for zlibwriter.c:

Go to the source code of this file.

Data Structures

struct  _RDD_ZLIB_WRITER

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_WRITER RDD_ZLIB_WRITER

Functions

static int flush (RDD_ZLIB_WRITER *state)
int rdd_open_zlib_writer (RDD_WRITER **self, RDD_WRITER *parent)
 Creates a writer that compresses its input before writing it.
static int zlib_cleanup (RDD_WRITER *self)
static int zlib_close (RDD_WRITER *w)
static int zlib_compare_address (RDD_WRITER *w, struct addrinfo *address, int *result)
static int zlib_write (RDD_WRITER *w, const unsigned char *buf, unsigned nbyte)

Variables

static char copyright []
static RDD_WRITE_OPS zlib_write_ops


Define Documentation

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

Definition at line 61 of file zlibwriter.c.

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

Definition at line 62 of file zlibwriter.c.

#define ZBUF_SIZE   32768

Definition at line 59 of file zlibwriter.c.


Typedef Documentation


Function Documentation

static int flush ( RDD_ZLIB_WRITER state  )  [static]

Definition at line 144 of file zlibwriter.c.

References _RDD_ZLIB_WRITER::parent, RDD_OK, rdd_writer_write(), _RDD_ZLIB_WRITER::zbuf, ZBUF_SIZE, and _RDD_ZLIB_WRITER::zstate.

Here is the call graph for this function:

int rdd_open_zlib_writer ( RDD_WRITER **  w,
RDD_WRITER parent 
)

Creates a writer that compresses its input before writing it.

Parameters:
w output value: the new writer object
parent,: all compressed output is written to parent
Returns:
Returns RDD_OK on success.
A zlib writer is stacked on top of a parent writer. Any data written to the zlib writer is written through to the parent writer in compressed zlib format.

Definition at line 83 of file zlibwriter.c.

References error(), _RDD_ZLIB_WRITER::parent, RDD_BADARG, RDD_ECOMPRESS, rdd_new_writer(), RDD_NOMEM, RDD_OK, _RDD_WRITER::state, _RDD_ZLIB_WRITER::zbuf, ZBUF_SIZE, and _RDD_ZLIB_WRITER::zstate.

Here is the call graph for this function:

static int zlib_cleanup ( RDD_WRITER self  )  [static]

Definition at line 191 of file zlibwriter.c.

References _RDD_ZLIB_WRITER::parent, RDD_BADARG, RDD_OK, rdd_writer_close(), and _RDD_ZLIB_WRITER::zbuf.

Here is the call graph for this function:

static int zlib_close ( RDD_WRITER w  )  [static]

Definition at line 213 of file zlibwriter.c.

References flush(), RDD_ECOMPRESS, RDD_OK, z_inbuf_empty, z_outbuf_full, zlib_cleanup(), and _RDD_ZLIB_WRITER::zstate.

Here is the call graph for this function:

static int zlib_compare_address ( RDD_WRITER w,
struct addrinfo *  address,
int *  result 
) [static]

Definition at line 251 of file zlibwriter.c.

References _RDD_ZLIB_WRITER::parent, and rdd_compare_address().

Here is the call graph for this function:

static int zlib_write ( RDD_WRITER w,
const unsigned char *  buf,
unsigned  nbyte 
) [static]

Definition at line 165 of file zlibwriter.c.

References flush(), RDD_ECOMPRESS, RDD_OK, _RDD_WRITER::state, z_outbuf_full, and _RDD_ZLIB_WRITER::zstate.

Here is the call graph for this function:


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 zlibwriter.c.

Initial value:

Definition at line 70 of file zlibwriter.c.


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