From fabd02b4bb0c1df2b65ea682b29087a1776954ed Mon Sep 17 00:00:00 2001 From: pixel Date: Mon, 9 Jul 2007 16:34:30 +0000 Subject: Adding basic file handling. --- mpq-bios.h | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) (limited to 'mpq-bios.h') diff --git a/mpq-bios.h b/mpq-bios.h index 8eb3150..138367d 100644 --- a/mpq-bios.h +++ b/mpq-bios.h @@ -6,11 +6,27 @@ struct mpq_internals_t; typedef struct { - char * name; - struct mpq_internals_t * mpq_i; } mpq_archive_t; +#define MPQ_FLAGS_ISFILE 0x80000000 +#define MPQ_FLAGS_HAS_META 0x04000000 +#define MPQ_FLAGS_UNIT 0x01000000 +#define MPQ_FLAGS_ADJUST 0x00020000 +#define MPQ_FLAGS_ENCRYPTED 0x00010000 +#define MPQ_FLAGS_COMPRESSED 0x00000200 +#define MPQ_FLAGS_IMPLODED 0x00000100 + +enum mpqlib_ioctl_t { + MPQLIB_IOCTL_NO_ACTION = 0, + MPQLIB_IOCTL_GET_FORMAT_VERSION, + MPQLIB_IOCTL_GET_SECTOR_SIZE, + MPQLIB_IOCTL_GET_BLOCK_OFFSET, + MPQLIB_IOCTL_GET_BLOCK_SIZE, + MPQLIB_IOCTL_GET_FILE_SIZE, + MPQLIB_IOCTL_GET_FLAGS, +}; + #ifdef __cplusplus extern "C" { #endif @@ -21,6 +37,7 @@ mpq_archive_t * mpqlib_reopen_archive(int fd); void mpqlib_printtables(mpq_archive_t *); void mpqlib_close_archive(mpq_archive_t *); int mpqlib_find_hash_entry(mpq_archive_t *, const char * name, uint32_t language, uint32_t platform); +uint64_t mpqlib_ioctl(mpq_archive_t *, enum mpqlib_ioctl_t command, int entry); #ifdef __cplusplus } -- cgit v1.2.3