summaryrefslogtreecommitdiff
path: root/test-it.c
diff options
context:
space:
mode:
Diffstat (limited to 'test-it.c')
-rw-r--r--test-it.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/test-it.c b/test-it.c
index f34d07f..341fe8a 100644
--- a/test-it.c
+++ b/test-it.c
@@ -2,6 +2,7 @@
#include <stdlib.h>
#include "mpq-bios.h"
#include "mpq-file.h"
+#include "mpq-fs.h"
#include "mpq-errors.h"
int main(int argc, char ** argv) {
@@ -38,6 +39,26 @@ int main(int argc, char ** argv) {
printf("Dumping:\n");
printf("%s", b);
printf("\nDone.\n");
+ mpqlib_close(f1);
+ }
+
+ mpqlib_fs_add_archive(t1);
+ f1 = mpqlib_fs_open("Interface\\FrameXML\\WorldMapFrame.lua");
+
+ if (f1) {
+ int size;
+ char * b;
+ printf("Found!\n");
+ size = mpqlib_seek(f1, 0, MPQLIB_SEEK_END);
+ mpqlib_seek(f1, 0, MPQLIB_SEEK_SET);
+ printf("Filesize seems to be: %d.\n", size);
+ b = (char *) malloc(size + 1);
+ b[size] = 0;
+ mpqlib_read(f1, b, size);
+ printf("Dumping:\n");
+ printf("%s", b);
+ printf("\nDone.\n");
+ mpqlib_close(f1);
}
mpqlib_close_archive(t1);