libmpq(3)

NAME
libmpq - cross-platform C library for manipulating mpq archives.

SYNOPSIS
#include <mpq.h>

int32_t libmpq__archive_open(
        mpq_archive_s **mpq_archive,
        const char     *mpq_filename,
        off_t           archive_offset
);

DESCRIPTION

Call libmpq__archive_open() to open a given mpq archive for later use to extract or manipulate files inside the archive. It will create all required file structures and you have to call libmpq__archive_close() on success to clean the opened structures. On failure there is no need to call libmpq__archive_close() because everything will be cleaned up.

The libmpq__archive_open() function takes as first argument a reference to the archive structure mpq_archive and will open the file mpq_filename to the structure pointed to by mpq_archive. The last argument, archive_offset is normally -1, but can be specified when the archive offset is known, or not 512-byte aligned.

RETURN VALUE
On success, *mpq_archive is set to a new mpq_archive_s* and zero is returned, and on error one of the following constants is returned.

LIBMPQ_ERROR_OPEN
    The given file could not be opened.

LIBMPQ_ERROR_MALLOC
    Not enough memory for creating required structures.

LIBMPQ_ERROR_SEEK
    Seeking in file failed.

LIBMPQ_ERROR_FORMAT
    The given file is no valid mpq archive.

LIBMPQ_ERROR_READ
    Reading in archive failed.

SEE ALSO
libmpq__archive_close(3), libmpq__archive_packed_size(3), libmpq__archive_unpacked_size(3), libmpq__archive_offset(3), libmpq__archive_version(3), libmpq__archive_files(3)

AUTHOR
Check documentation.

libmpq is (c) 2003-2008
    Maik Broemme <mbroemme@plusserver.de>

The above e-mail address can be used to send bug reports, feedbacks or library enhancements.