make Runtime._syscall() protected so it can be overridden from outside the package
[nestedvm.git] / src / tests / MSPackBench.c
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <stdarg.h>
5 #include <sys/fcntl.h>
6
7 #include "mspack.h"
8
9 int main(int argc, char **argv) {
10     struct mscab_decompressor *decomp;
11     struct mscabd_cabinet *cab;
12     struct mscabd_file *file;
13     int i;
14     
15     if(argc < 2) {
16         fprintf(stderr,"Usage: %s cab\n",argv[0]);
17         exit(1);
18     }
19     
20     
21     decomp = mspack_create_cab_decompressor(NULL);
22     if(!decomp) exit(1);
23     
24     for(i=1;i<argc;i++) {
25         cab = decomp->search(decomp,argv[i]);
26         if(!cab) exit(2);
27     
28         for(file = cab->files;file;file=file->next)
29             decomp->extract(decomp,file,file->filename);
30          
31         decomp->close(decomp,cab);
32     }
33     mspack_destroy_cab_decompressor(decomp);
34
35     return 0;
36 }