summaryrefslogtreecommitdiff
path: root/mpq-file.c
diff options
context:
space:
mode:
Diffstat (limited to 'mpq-file.c')
-rw-r--r--mpq-file.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/mpq-file.c b/mpq-file.c
index 56fe2b5..8356483 100644
--- a/mpq-file.c
+++ b/mpq-file.c
@@ -4,7 +4,6 @@
#include "mpq-bios.h"
#include "mpq-file.h"
#include "mpq-errors.h"
-#include "int-bios.h"
#include "extract.h"
#include "errors.h"
@@ -64,7 +63,7 @@ struct mpq_file_t * mpqlib_open_file(struct mpq_archive_t * mpq_a, int entry) {
return NULL;
}
- r->sector_size = mpqlib_ioctl(mpq_a, MPQLIB_IOCTL_GET_SECTOR_SIZE, 0);
+ r->sector_size = mpqlib_ioctl(mpq_a, MPQLIB_IOCTL_GET_SECTOR_SIZE);
/* Allocating and filling up the mpq_file_t structure. */
if (!(r->buffer = malloc(r->sector_size))) {
@@ -102,9 +101,9 @@ struct mpq_file_t * mpqlib_open_file(struct mpq_archive_t * mpq_a, int entry) {
}
/* Reading the offset table and building the size table */
- __mpqlib_seek(mpq_a, r->offset);
+ mpqlib_ioctl(mpq_a, MPQLIB_IOCTL_SEEK, r->offset);
for (i = 0; i <= r->number_of_sectors; i++) {
- __mpqlib_read(mpq_a, &o, 4);
+ mpqlib_ioctl(mpq_a, MPQLIB_IOCTL_READ, &o, 4);
r->offsets[i] = r->offset + o;
}
@@ -138,8 +137,8 @@ static int cache_sector(struct mpq_file_t * mpq_f, int sector) {
/* current_sector should be initialized to -1 */
if (mpq_f->current_sector != sector) {
int il, ol;
- __mpqlib_seek(mpq_f->mpq_a, mpq_f->offsets[sector]);
- __mpqlib_read(mpq_f->mpq_a, in_buf, mpq_f->sizes[sector]);
+ mpqlib_ioctl(mpq_f->mpq_a, MPQLIB_IOCTL_SEEK, mpq_f->offsets[sector]);
+ mpqlib_ioctl(mpq_f->mpq_a, MPQLIB_IOCTL_READ, mpq_f->sizes[sector]);
mpq_f->current_sector = sector;
il = ol = sector == (mpq_f->number_of_sectors - 1) ? mpq_f->remaining_bytes : mpq_f->sector_size;