Rizin
unix-like reverse engineering framework and cli tools
msszdd_decompressor Struct Reference

#include <mspack.h>

Public Attributes

struct msszddd_header *(* open )(struct msszdd_decompressor *self, const char *filename)
 
void(* close )(struct msszdd_decompressor *self, struct msszddd_header *szdd)
 
int(* extract )(struct msszdd_decompressor *self, struct msszddd_header *szdd, const char *filename)
 
int(* decompress )(struct msszdd_decompressor *self, const char *input, const char *output)
 
int(* last_error )(struct msszdd_decompressor *self)
 

Detailed Description

A decompressor for SZDD compressed files.

All fields are READ ONLY.

See also
mspack_create_szdd_decompressor(), mspack_destroy_szdd_decompressor()

Definition at line 1876 of file mspack.h.

Member Data Documentation

◆ close

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
selfa self-referential pointer to the msszdd_decompressor instance being called
szddthe SZDD file to close
See also
open()

Definition at line 1912 of file mspack.h.

◆ decompress

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
selfa self-referential pointer to the msszdd_decompressor instance being called
inputthe filename of the input SZDD file. This is passed directly to mspack_system::open().
outputthe 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

Definition at line 1949 of file mspack.h.

Referenced by main().

◆ extract

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
selfa self-referential pointer to the msszdd_decompressor instance being called
szddthe SZDD file to extract data from
filenamethe 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

Definition at line 1928 of file mspack.h.

◆ last_error

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
selfa self-referential pointer to the msszdd_decompressor instance being called
Returns
the most recent error code
See also
open(), extract(), decompress()

Definition at line 1964 of file mspack.h.

◆ open

struct msszddd_header *(* msszdd_decompressor::open)(struct msszdd_decompressor *self, const char *filename)

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
selfa self-referential pointer to the msszdd_decompressor instance being called
filenamethe 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()

Definition at line 1866 of file mspack.h.


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