libmspack

- Main Page
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Data Fields

Data Fields
msszdd_decompressor Struct Reference

A decompressor for SZDD compressed files. More...

`#include <mspack.h>`

## Data Fields

struct msszddd_header *(* | open )(struct msszdd_decompressor *self, const char *filename)
| Opens a SZDD file and reads the header.
void(* | close )(struct msszdd_decompressor *self, struct msszddd_header *szdd)
| Closes a previously opened SZDD file.
int(* | extract )(struct msszdd_decompressor *self, struct msszddd_header *szdd, const char *filename)
| Extracts the compressed data from a SZDD file.
int(* | decompress )(struct msszdd_decompressor *self, const char *input, const char *output)
| Decompresses an SZDD file to an output file in one step.
int(* | last_error )(struct msszdd_decompressor *self)
| Returns the error code set by the most recently called method.

## Detailed Description

A decompressor for SZDD compressed files.

All fields are READ ONLY.

See also:
  mspack_create_szdd_decompressor(), mspack_destroy_szdd_decompressor()

## Field Documentation

void(* msszdd_decompressor::close)(struct msszdd_decompressor *self, struct msszddd_header *szdd)

Closes a previously opened SZDD file.

This closes a SZDD file and frees the msszddd_header associated with it.

The SZDD header pointer is now invalid and cannot be used again.

Parameters:

  self | a self-referential pointer to the msszdd_decompressor instance being called
  szdd | the SZDD file to close

See also:
  open()

int(* msszdd_decompressor::decompress)(struct msszdd_decompressor *self, const char *input, const char *output)

Decompresses an SZDD file to an output file in one step.

This opens an SZDD file as input, reads the header, then decompresses the compressed data immediately to an output file, finally closing both the input and output file. It is more convenient to use than open() then extract() then close(), if you do not need to know the SZDD output size or missing character.

Parameters:

  self | a self-referential pointer to the msszdd_decompressor instance being called
  input | the filename of the input SZDD file. This is passed directly to mspack_system::open().
  output | the filename to write the decompressed data to. This is passed directly to mspack_system::open().

Returns:
  an error code, or MSPACK_ERR_OK if successful

int(* msszdd_decompressor::extract)(struct msszdd_decompressor *self, struct msszddd_header *szdd, const char *filename)

Extracts the compressed data from a SZDD file.

This decompresses the compressed SZDD data stream and writes it to an output file.

Parameters:

  self | a self-referential pointer to the msszdd_decompressor instance being called
  szdd | the SZDD file to extract data from
  filename | the filename to write the decompressed data to. This is passed directly to mspack_system::open().

Returns:
  an error code, or MSPACK_ERR_OK if successful

int(* msszdd_decompressor::last_error)(struct msszdd_decompressor *self)

Returns the error code set by the most recently called method.

This is useful for open() which does not return an error code directly.

Parameters:

  self | a self-referential pointer to the msszdd_decompressor instance being called

Returns:
  the most recent error code

See also:
  open(), extract(), decompress()

struct msszddd_header*(* msszdd_decompressor::open)(struct msszdd_decompressor *self, const char *filename)`[read]`

Opens a SZDD file and reads the header.

If the file opened is a valid SZDD file, all headers will be read and a msszddd_header structure will be returned.

In the case of an error occuring, NULL is returned and the error code is available from last_error().

The filename pointer should be considered "in use" until close() is called on the SZDD file.

Parameters:

  self | a self-referential pointer to the msszdd_decompressor instance being called
  filename | the filename of the SZDD compressed file. This is passed directly to mspack_system::open().

Returns:
  a pointer to a msszddd_header structure, or NULL on failure

See also:
  close()

The documentation for this struct was generated from the following file:

- mspack.h

All Data Structures Files Functions Variables Defines