aboutsummaryrefslogtreecommitdiff
path: root/src/common/unzip.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/unzip.h')
-rw-r--r--src/common/unzip.h125
1 files changed, 88 insertions, 37 deletions
diff --git a/src/common/unzip.h b/src/common/unzip.h
index f0c2c4e..0359fa5 100644
--- a/src/common/unzip.h
+++ b/src/common/unzip.h
@@ -1,10 +1,10 @@
1/* 1]/*
2 This file is part of libextractor. 2 This file is part of libextractor.
3 (C) 2008 Christian Grothoff (and other contributing authors) 3 (C) 2008 Christian Grothoff (and other contributing authors)
4 4
5 libextractor is free software; you can redistribute it and/or modify 5 libextractor is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published 6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 2, or (at your 7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version. 8 option) any later version.
9 9
10 libextractor is distributed in the hope that it will be useful, but 10 libextractor is distributed in the hope that it will be useful, but
@@ -34,18 +34,20 @@
34 34
35typedef voidp EXTRACTOR_unzip_file; 35typedef voidp EXTRACTOR_unzip_file;
36 36
37
37typedef struct EXTRACTOR_unzip_filefunc_def_s 38typedef struct EXTRACTOR_unzip_filefunc_def_s
38{ 39{
39 voidpf ( *zopen_file) (voidpf opaque, const char* filename, int mode); 40 voidpf ( *zopen_file) (voidpf opaque, const char* filename, int mode);
40 uLong ( *zread_file) (voidpf opaque, voidpf stream, void* buf, uLong size); 41 uLong ( *zread_file) (voidpf opaque, voidpf stream, void* buf, uLong size);
41 uLong ( *zwrite_file) (voidpf opaque, voidpf stream, const void* buf, uLong size); 42 uLong ( *zwrite_file) (voidpf opaque, voidpf stream, const void* buf, uLong size);
42 long ( *ztell_file) (voidpf opaque, voidpf stream); 43 long ( *ztell_file) (voidpf opaque, voidpf stream);
43 long ( *zseek_file) (voidpf opaque, voidpf stream, uLong offset, int origin); 44 long ( *zseek_file) (voidpf opaque, voidpf stream, uLong offset, int origin);
44 int ( *zclose_file) (voidpf opaque, voidpf stream); 45 int ( *zclose_file) (voidpf opaque, voidpf stream);
45 int ( *zerror_file) (voidpf opaque, voidpf stream); 46 int ( *zerror_file) (voidpf opaque, voidpf stream);
46 voidpf opaque; 47 voidpf opaque;
47} EXTRACTOR_unzip_filefunc_def; 48} EXTRACTOR_unzip_filefunc_def;
48 49
50
49/* tm_unz contain date/time info */ 51/* tm_unz contain date/time info */
50typedef struct EXTRACTOR_unzip_tm_unz_s 52typedef struct EXTRACTOR_unzip_tm_unz_s
51{ 53{
@@ -57,6 +59,7 @@ typedef struct EXTRACTOR_unzip_tm_unz_s
57 uInt tm_year; /* years - [1980..2044] */ 59 uInt tm_year; /* years - [1980..2044] */
58} EXTRACTOR_unzip_tm_unz; 60} EXTRACTOR_unzip_tm_unz;
59 61
62
60/* unz_file_info contain information about a file in the zipfile */ 63/* unz_file_info contain information about a file in the zipfile */
61typedef struct EXTRACTOR_unzip_file_info_s 64typedef struct EXTRACTOR_unzip_file_info_s
62{ 65{
@@ -79,48 +82,96 @@ typedef struct EXTRACTOR_unzip_file_info_s
79 EXTRACTOR_unzip_tm_unz tmu_date; 82 EXTRACTOR_unzip_tm_unz tmu_date;
80} EXTRACTOR_unzip_file_info; 83} EXTRACTOR_unzip_file_info;
81 84
82int EXTRACTOR_common_unzip_string_file_name_compare(const char* fileName1,
83 const char* fileName2, int iCaseSensitivity);
84 85
85int EXTRACTOR_common_unzip_go_to_first_file(EXTRACTOR_unzip_file file); 86int
87EXTRACTOR_common_unzip_string_file_name_compare (const char* fileName1,
88 const char* fileName2,
89 int iCaseSensitivity);
90
91
92int
93EXTRACTOR_common_unzip_go_to_first_file (EXTRACTOR_unzip_file file);
94
95
96EXTRACTOR_unzip_file
97EXTRACTOR_common_unzip_open2 (const char *path,
98 EXTRACTOR_unzip_filefunc_def* pzlib_filefunc_def);
99
100
101int
102EXTRACTOR_common_unzip_close_current_file (EXTRACTOR_unzip_file file);
103
104
105int
106EXTRACTOR_common_unzip_close (EXTRACTOR_unzip_file file);
107
108
109int
110EXTRACTOR_common_unzip_get_current_file_info (EXTRACTOR_unzip_file file,
111 EXTRACTOR_unzip_file_info *pfile_info,
112 char *szFileName,
113 uLong fileNameBufferSize,
114 void *extraField,
115 uLong extraFieldBufferSize,
116 char *szComment,
117 uLong commentBufferSize);
118
119
120int
121EXTRACTOR_common_unzip_go_to_next_file (EXTRACTOR_unzip_file file);
122
123
124int
125EXTRACTOR_common_unzip_local_file (EXTRACTOR_unzip_file file,
126 const char *szFileName,
127 int iCaseSensitivity);
128
129
130int
131EXTRACTOR_common_unzip_read_current_file (EXTRACTOR_unzip_file file,
132 voidp buf,
133 unsigned len);
86 134
87EXTRACTOR_unzip_file EXTRACTOR_common_unzip_open2(const char *path,
88 EXTRACTOR_unzip_filefunc_def* pzlib_filefunc_def);
89 135
90int EXTRACTOR_common_unzip_close_current_file(EXTRACTOR_unzip_file file); 136int
137EXTRACTOR_common_unzip_open_current_file3 (EXTRACTOR_unzip_file file,
138 int* method,
139 int* level,
140 int raw);
91 141
92int EXTRACTOR_common_unzip_close(EXTRACTOR_unzip_file file);
93 142
94int EXTRACTOR_common_unzip_get_current_file_info(EXTRACTOR_unzip_file file, 143voidpf
95 EXTRACTOR_unzip_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, 144EXTRACTOR_common_unzip_zlib_open_file_func (voidpf opaque,
96 void *extraField, uLong extraFieldBufferSize, char *szComment, 145 const char* filename,
97 uLong commentBufferSize); 146 int mode);
98 147
99int EXTRACTOR_common_unzip_go_to_next_file(EXTRACTOR_unzip_file file);
100 148
101int EXTRACTOR_common_unzip_local_file(EXTRACTOR_unzip_file file, const char *szFileName, 149uLong
102 int iCaseSensitivity); 150EXTRACTOR_common_unzip_zlib_read_file_func (voidpf opaque,
151 voidpf stream,
152 void* buf,
153 uLong size);
103 154
104int EXTRACTOR_common_unzip_read_current_file(EXTRACTOR_unzip_file file, voidp buf,
105 unsigned len);
106 155
107int EXTRACTOR_common_unzip_open_current_file3(EXTRACTOR_unzip_file file, int* method, 156long
108 int* level, int raw); 157EXTRACTOR_common_unzip_zlib_tell_file_func (voidpf opaque,
158 voidpf stream);
109 159
110voidpf EXTRACTOR_common_unzip_zlib_open_file_func(voidpf opaque,
111 const char* filename, int mode);
112 160
113uLong EXTRACTOR_common_unzip_zlib_read_file_func(voidpf opaque, voidpf stream, 161long
114 void* buf, uLong size); 162EXTRACTOR_common_unzip_zlib_seek_file_func (voidpf opaque,
163 voidpf stream,
164 uLong offset,
165 int origin);
115 166
116long EXTRACTOR_common_unzip_zlib_tell_file_func(voidpf opaque, voidpf stream);
117 167
118long EXTRACTOR_common_unzip_zlib_seek_file_func(voidpf opaque, voidpf stream, 168int
119 uLong offset, int origin); 169EXTRACTOR_common_unzip_zlib_close_file_func (voidpf opaque,
170 voidpf stream);
120 171
121int EXTRACTOR_common_unzip_zlib_close_file_func(voidpf opaque, voidpf stream);
122 172
123int EXTRACTOR_common_unzip_zlib_testerror_file_func(voidpf opaque, 173int
124 voidpf stream); 174EXTRACTOR_common_unzip_zlib_testerror_file_func (voidpf opaque,
175 voidpf stream);
125 176
126#endif /* UNZIP_H_ */ 177#endif /* UNZIP_H_ */