From dcd04bd6d9569aff386d438dcaa1194e9ce7d36e Mon Sep 17 00:00:00 2001 From: pixel Date: Tue, 10 Jul 2007 13:09:37 +0000 Subject: mpq-fs working. --- test-it.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'test-it.c') 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 #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); -- cgit v1.2.3