summaryrefslogtreecommitdiff
path: root/mpq-bios.c
diff options
context:
space:
mode:
authorpixel <pixel>2007-07-10 09:17:51 +0000
committerpixel <pixel>2007-07-10 09:17:51 +0000
commit8feb553794efc2a328f8ce2beed5eeacc43238f4 (patch)
treee1e210e854290078586ea88763b9751a8d6d08a9 /mpq-bios.c
parente3be7db2c856dc67286a5c873f65af1f40126f46 (diff)
mpq-file working.
Diffstat (limited to 'mpq-bios.c')
-rw-r--r--mpq-bios.c16
1 files changed, 10 insertions, 6 deletions
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;