Subversion Repositories SvarDOS

Rev

Rev 614 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
219 mateuszvis 1
/*
2
 * This file is part of the FDNPKG project
3
 * http://fdnpkg.sourceforge.net
4
 *
5
 * Copyright (C) 2012-2016 Mateusz Viste. All rights reserved.
6
 *
7
 * Simple library providing functions to unzip files from zip archives.
8
 */
9
 
10
 
11
#ifndef libunzip_sentinel
12
#define libunzip_sentinel
13
 
14
#include <time.h>  /* required for the time_t definition */
15
 
16
#define ZIP_FLAG_ISADIR    1
17
#define ZIP_FLAG_ENCRYPTED 2
18
 
295 mateuszvis 19
#define ZIP_METH_STORE 0
20
#define ZIP_METH_DEFLATE 8
21
 
219 mateuszvis 22
struct ziplist {
23
  long filelen;
24
  long compressedfilelen;
25
  unsigned long crc32;
26
  long dataoffset;      /* offset in the file where compressed data starts */
27
  struct ziplist *nextfile;
28
  time_t timestamp;     /* the timestamp of the file */
295 mateuszvis 29
  short compmethod;     /* compression method (ZIP_METH_xxx) */
272 mateuszvis 30
  unsigned char flags;  /* see ZIP_FLAG_xxx above */
219 mateuszvis 31
  char filename[1];     /* must be last element (gets expanded at runtime) */
32
};
33
 
34
struct ziplist *zip_listfiles(FILE *fd);
268 mateuszvis 35
int zip_unzip(FILE *zipfd, struct ziplist *curzipnode, const char *fulldestfilename);
219 mateuszvis 36
void zip_freelist(struct ziplist **ziplist);
37
 
38
#endif