compressutils.c File Reference

Functions related to data compression (gzip format.) More...

`#include "compressutils.h"`
`#include <glib.h>`
`#include <zlib.h>`

## Macros

#define | ZLIB_CONST
| For z_const to be defined as const.
#define | G_LOG_DOMAIN "libgvm util"
| GLib logging domain.

## Functions

void * | gvm_compress (const void *src, unsigned long srclen, unsigned long *dstlen)
| Compresses data in src buffer.
void * | gvm_uncompress (const void *src, unsigned long srclen, unsigned long *dstlen)
| Uncompresses data in src buffer.
void * | gvm_compress_gzipheader (const void *src, unsigned long srclen, unsigned long *dstlen)
| Compresses data in src buffer, gzip format compatible.

## Detailed Description

Functions related to data compression (gzip format.)

## Macro Definition Documentation

## G_LOG_DOMAIN

#define G_LOG_DOMAIN "libgvm util"

GLib logging domain.

## ZLIB_CONST

#define ZLIB_CONST

For z_const to be defined as const.

## Function Documentation

## gvm_compress()

void * gvm_compress | ( | const void * | src,
|  | unsigned long | srclen,
|  | unsigned long * | dstlen
| ) |  |

Compresses data in src buffer.

Parameters

  [in] | src | Buffer of data to compress.
  [in] | srclen | Length of data to compress.
  [out] | dstlen | Length of compressed data.

Returns
  Pointer to compressed data if success, NULL otherwise.

## gvm_compress_gzipheader()

void * gvm_compress_gzipheader | ( | const void * | src,
|  | unsigned long | srclen,
|  | unsigned long * | dstlen
| ) |  |

Compresses data in src buffer, gzip format compatible.

Parameters

  [in] | src | Buffer of data to compress.
  [in] | srclen | Length of data to compress.
  [out] | dstlen | Length of compressed data.

Returns
  Pointer to compressed data if success, NULL otherwise.

## gvm_uncompress()

void * gvm_uncompress | ( | const void * | src,
|  | unsigned long | srclen,
|  | unsigned long * | dstlen
| ) |  |

Uncompresses data in src buffer.

Parameters

  [in] | src | Buffer of data to uncompress.
  [in] | srclen | Length of data to uncompress.
  [out] | dstlen | Length of uncompressed data.

Returns
  Pointer to uncompressed data if success, NULL otherwise.