#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
#include "rdd.h"
#include "writer.h"
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 z_inbuf_empty | ( | z | ) | ((z)->avail_in <= 0) |
Definition at line 61 of file zlibwriter.c.
#define z_outbuf_full | ( | z | ) | ((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 struct _RDD_ZLIB_WRITER RDD_ZLIB_WRITER |
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.
int rdd_open_zlib_writer | ( | RDD_WRITER ** | w, | |
RDD_WRITER * | parent | |||
) |
Creates a writer that compresses its input before writing it.
w | output value: the new writer object | |
parent,: | all compressed output is written to parent |
RDD_OK
on success.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.
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.
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.
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().
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.
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.
RDD_WRITE_OPS zlib_write_ops [static] |
Initial value:
Definition at line 70 of file zlibwriter.c.