From 8feb553794efc2a328f8ce2beed5eeacc43238f4 Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 10 Jul 2007 09:17:51 +0000 Subject: mpq-file working. --- mpq-bios.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'mpq-bios.c') diff --git a/mpq-bios.c b/mpq-bios.c index 4051627..8af3ef6 100644 --- a/mpq-bios.c +++ b/mpq-bios.c @@ -156,6 +156,8 @@ struct mpq_archive_t * mpqlib_reopen_archive(int fd) { uint16_t * mpq_extblocks = NULL; int i; + __mpqlib_errno = MPQLIB_ERROR_NO_ERROR; + /****TODO****/ /* Implement endianess a bit everywhere */ @@ -285,15 +287,15 @@ void mpqlib_printtables(struct mpq_archive_t * mpq_a) { int i; printf("Archive details:\n"); - printf("Header size: %8d\n", mpq_a->header_size); - printf("Archive size: %8d\n", mpq_a->archive_size); - printf("Format version: %8d\n", mpq_a->format_version); - printf("Sector size: %8d\n\n", mpq_a->sector_size); + printf("Header size: %10u\n", mpq_a->header_size); + printf("Archive size: %10u\n", mpq_a->archive_size); + printf("Format version: %10u\n", mpq_a->format_version); + printf("Sector size: %10u\n\n", mpq_a->sector_size); printf("Hash table offset: %016llX\n", mpq_a->hash_table_offset); printf("Block table offset: %016llX\n", mpq_a->block_table_offset); - printf("Hash table entries: %8d\n", mpq_a->hash_table_entries); - printf("Block table entries: %8d\n", mpq_a->block_table_entries); + printf("Hash table entries: %8u\n", mpq_a->hash_table_entries); + printf("Block table entries: %8u\n", mpq_a->block_table_entries); printf("Extended block table offset: %016llX\n\n\n", mpq_a->extended_block_table_offset); @@ -347,6 +349,8 @@ int __mpqlib_read(struct mpq_archive_t * mpq_a, void * buffer, uint32_t size) { } uint64_t mpqlib_ioctl(struct mpq_archive_t * mpq_a, enum mpqlib_ioctl_t command, int entry) { + __mpqlib_errno = MPQLIB_ERROR_NO_ERROR; + switch(command) { case MPQLIB_IOCTL_NO_ACTION: return 0; -- cgit v1.2.3