summaryrefslogtreecommitdiff
path: root/test-it.c
blob: 0d13e87e2da73000e9d8ba27d749468330650c16 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include <stdio.h>
#include <stdlib.h>
#include "mpq-bios.h"
#include "mpq-errors.h"

int main(int argc, char ** argv) {
    mpq_archive_t * t1;
    char * fname = "test.mpq";
    
    mpqlib_init();
    
    if (argc == 2)
        fname = argv[1];
    
    t1 = mpqlib_open_archive(fname);
    if (!t1) {
        printf("Open error: %s.\n", mpqlib_error());
        perror("Details");
        exit(-1);
    }
    
    mpqlib_printtables(t1);
    
    mpqlib_close_archive(t1);
}