1 /*****************************************************************************
2 ** $Source: /cvsroot/bluemsx/blueMSX/Src/Utils/ziphelper.h,v $
3 **
4 ** $Revision: 1.4 $
5 **
6 ** $Date: 2008/03/30 18:38:47 $
7 **
8 ** More info: http://www.bluemsx.com
9 **
10 ** Copyright (C) 2003-2006 Daniel Vik
11 **
12 ** This program is free software; you can redistribute it and/or modify
13 ** it under the terms of the GNU General Public License as published by
14 ** the Free Software Foundation; either version 2 of the License, or
15 ** (at your option) any later version.
16 **
17 ** This program is distributed in the hope that it will be useful,
18 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20 ** GNU General Public License for more details.
21 **
22 ** You should have received a copy of the GNU General Public License
23 ** along with this program; if not, write to the Free Software
24 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
25 **
26 ******************************************************************************
27 */
28 #ifndef ZIPHELPER_H
29 #define ZIPHELPER_H
30 
31 #include "unzip.h"
32 
33 #ifdef __cplusplus
34 extern "C" {
35 #endif
36 
37 typedef void(*ZIP_EXTRACT_CB)(int, int);
38 
39 void memZipFileSystemCreate(int maxFiles);
40 void memZipFileSystemDestroy();
41 
42 void zipCacheReadOnlyZip(const char* zipName);
43 void* zipLoadFile(const char* zipName, const char* fileName, int* size);
44 int zipSaveFile(const char* zipName, const char* fileName, int append, void* buffer, int size);
45 int zipFileExists(const char* zipName, const char* fileName);
46 char* zipGetFileList(const char* zipName, const char* ext, int* count);
47 int zipHasFileType(char* zipName, char* ext);
48 int zipExtractCurrentfile(unzFile uf, int overwrite, const char* password);
49 int zipExtract(unzFile uf, int overwrite, const char* password, ZIP_EXTRACT_CB progress_callback);
50 void* zipCompress(void* buffer, int size, unsigned long* retSize);
51 // Note: retSize in zipUncompress is input/output parameter and need to be set to unzipped buffer size
52 void* zipUncompress(void* buffer, int size, unsigned long* retSize);
53 
54 #ifdef __cplusplus
55 }
56 #endif
57 
58 #endif
59