Subversion Repositories SvarDOS

Rev

Rev 1963 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1963 Rev 1965
Line 9... Line 9...
9
 
9
 
10
#include <stdio.h>
10
#include <stdio.h>
11
 
11
 
12
#include "fileexst.h"
12
#include "fileexst.h"
13
#include "helpers.h"
13
#include "helpers.h"
14
#include "kprintf.h"
-
 
15
#include "libunzip.h"
14
#include "libunzip.h"
16
#include "svarlang.lib\svarlang.h"
15
#include "svarlang.lib\svarlang.h"
17
 
16
 
18
#include "unzip.h"
17
#include "unzip.h"
19
 
18
 
20
 
19
 
21
int unzip(const char *zipfile, unsigned char listonly) {
20
int unzip(const char *zipfile, unsigned char listonly, unsigned char *buff15k) {
22
  struct ziplist *zlist, *znode;
21
  struct ziplist *zlist, *znode;
23
  FILE *fd;
22
  FILE *fd;
24
  int r = 0;
23
  int r = 0;
25
 
24
 
26
  fd = fopen(zipfile, "rb");
25
  fd = fopen(zipfile, "rb");
Line 58... Line 57...
58
        outputnl(svarlang_str(10, 3)); /* "ERROR: File already exists" */
57
        outputnl(svarlang_str(10, 3)); /* "ERROR: File already exists" */
59
        r = 1;
58
        r = 1;
60
        continue;
59
        continue;
61
      }
60
      }
62
      /* uncompress */
61
      /* uncompress */
63
      zres = zip_unzip(fd, znode, znode->filename);
62
      zres = zip_unzip(fd, znode, znode->filename, buff15k);
64
      if (zres != 0) {
63
      if (zres != 0) {
65
        kitten_printf(10, 4, "ERROR: unzip failure (%d)", zres);
64
        sprintf(buff15k, svarlang_str(10,4), zres);
66
        outputnl("");
65
        outputnl(buff15k);
67
        continue;
66
        continue;
68
      }
67
      }
69
      OK:
68
      OK:
70
      outputnl(svarlang_str(10, 0)); /* "OK" */
69
      outputnl(svarlang_str(10, 0)); /* "OK" */
71
    }
70
    }