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

#include <mspack.h>

Public Attributes

struct mskwajd_header *(* open )(struct mskwaj_decompressor *self, const char *filename)
 
void(* close )(struct mskwaj_decompressor *self, struct mskwajd_header *kwaj)
 
int(* extract )(struct mskwaj_decompressor *self, struct mskwajd_header *kwaj, const char *filename)
 
int(* decompress )(struct mskwaj_decompressor *self, const char *input, const char *output)
 
int(* last_error )(struct mskwaj_decompressor *self)
 

Detailed Description

A decompressor for KWAJ compressed files.

All fields are READ ONLY.

See also
mspack_create_kwaj_decompressor(), mspack_destroy_kwaj_decompressor()

Definition at line 2156 of file mspack.h.

Member Data Documentation

◆ close

void(* mskwaj_decompressor::close)(struct mskwaj_decompressor *self, struct mskwajd_header *kwaj)

Closes a previously opened KWAJ file.

This closes a KWAJ file and frees the mskwajd_header associated with it. The KWAJ header pointer is now invalid and cannot be used again.

Parameters
selfa self-referential pointer to the mskwaj_decompressor instance being called
kwajthe KWAJ file to close
See also
open()

Definition at line 2191 of file mspack.h.

◆ decompress

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

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

This opens an KWAJ 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 KWAJ output size or output filename.

Parameters
selfa self-referential pointer to the mskwaj_decompressor instance being called
inputthe filename of the input KWAJ 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 2228 of file mspack.h.

Referenced by main().

◆ extract

int(* mskwaj_decompressor::extract)(struct mskwaj_decompressor *self, struct mskwajd_header *kwaj, const char *filename)

Extracts the compressed data from a KWAJ file.

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

Parameters
selfa self-referential pointer to the mskwaj_decompressor instance being called
kwajthe KWAJ 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 2207 of file mspack.h.

◆ last_error

int(* mskwaj_decompressor::last_error)(struct mskwaj_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 mskwaj_decompressor instance being called
Returns
the most recent error code
See also
open(), search()

Definition at line 2243 of file mspack.h.

◆ open

struct mskwajd_header *(* mskwaj_decompressor::open)(struct mskwaj_decompressor *self, const char *filename)

Opens a KWAJ file and reads the header.

If the file opened is a valid KWAJ file, all headers will be read and a mskwajd_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 KWAJ file.

Parameters
selfa self-referential pointer to the mskwaj_decompressor instance being called
filenamethe filename of the KWAJ compressed file. This is passed directly to mspack_system::open().
Returns
a pointer to a mskwajd_header structure, or NULL on failure
See also
close()

Definition at line 2146 of file mspack.h.


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