diff options
Diffstat (limited to 'src/common/unzip.h')
-rw-r--r-- | src/common/unzip.h | 125 |
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 | ||
35 | typedef voidp EXTRACTOR_unzip_file; | 35 | typedef voidp EXTRACTOR_unzip_file; |
36 | 36 | ||
37 | |||
37 | typedef struct EXTRACTOR_unzip_filefunc_def_s | 38 | typedef 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 */ |
50 | typedef struct EXTRACTOR_unzip_tm_unz_s | 52 | typedef 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 */ |
61 | typedef struct EXTRACTOR_unzip_file_info_s | 64 | typedef 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 | ||
82 | int EXTRACTOR_common_unzip_string_file_name_compare(const char* fileName1, | ||
83 | const char* fileName2, int iCaseSensitivity); | ||
84 | 85 | ||
85 | int EXTRACTOR_common_unzip_go_to_first_file(EXTRACTOR_unzip_file file); | 86 | int |
87 | EXTRACTOR_common_unzip_string_file_name_compare (const char* fileName1, | ||
88 | const char* fileName2, | ||
89 | int iCaseSensitivity); | ||
90 | |||
91 | |||
92 | int | ||
93 | EXTRACTOR_common_unzip_go_to_first_file (EXTRACTOR_unzip_file file); | ||
94 | |||
95 | |||
96 | EXTRACTOR_unzip_file | ||
97 | EXTRACTOR_common_unzip_open2 (const char *path, | ||
98 | EXTRACTOR_unzip_filefunc_def* pzlib_filefunc_def); | ||
99 | |||
100 | |||
101 | int | ||
102 | EXTRACTOR_common_unzip_close_current_file (EXTRACTOR_unzip_file file); | ||
103 | |||
104 | |||
105 | int | ||
106 | EXTRACTOR_common_unzip_close (EXTRACTOR_unzip_file file); | ||
107 | |||
108 | |||
109 | int | ||
110 | EXTRACTOR_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 | |||
120 | int | ||
121 | EXTRACTOR_common_unzip_go_to_next_file (EXTRACTOR_unzip_file file); | ||
122 | |||
123 | |||
124 | int | ||
125 | EXTRACTOR_common_unzip_local_file (EXTRACTOR_unzip_file file, | ||
126 | const char *szFileName, | ||
127 | int iCaseSensitivity); | ||
128 | |||
129 | |||
130 | int | ||
131 | EXTRACTOR_common_unzip_read_current_file (EXTRACTOR_unzip_file file, | ||
132 | voidp buf, | ||
133 | unsigned len); | ||
86 | 134 | ||
87 | EXTRACTOR_unzip_file EXTRACTOR_common_unzip_open2(const char *path, | ||
88 | EXTRACTOR_unzip_filefunc_def* pzlib_filefunc_def); | ||
89 | 135 | ||
90 | int EXTRACTOR_common_unzip_close_current_file(EXTRACTOR_unzip_file file); | 136 | int |
137 | EXTRACTOR_common_unzip_open_current_file3 (EXTRACTOR_unzip_file file, | ||
138 | int* method, | ||
139 | int* level, | ||
140 | int raw); | ||
91 | 141 | ||
92 | int EXTRACTOR_common_unzip_close(EXTRACTOR_unzip_file file); | ||
93 | 142 | ||
94 | int EXTRACTOR_common_unzip_get_current_file_info(EXTRACTOR_unzip_file file, | 143 | voidpf |
95 | EXTRACTOR_unzip_file_info *pfile_info, char *szFileName, uLong fileNameBufferSize, | 144 | EXTRACTOR_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 | ||
99 | int EXTRACTOR_common_unzip_go_to_next_file(EXTRACTOR_unzip_file file); | ||
100 | 148 | ||
101 | int EXTRACTOR_common_unzip_local_file(EXTRACTOR_unzip_file file, const char *szFileName, | 149 | uLong |
102 | int iCaseSensitivity); | 150 | EXTRACTOR_common_unzip_zlib_read_file_func (voidpf opaque, |
151 | voidpf stream, | ||
152 | void* buf, | ||
153 | uLong size); | ||
103 | 154 | ||
104 | int EXTRACTOR_common_unzip_read_current_file(EXTRACTOR_unzip_file file, voidp buf, | ||
105 | unsigned len); | ||
106 | 155 | ||
107 | int EXTRACTOR_common_unzip_open_current_file3(EXTRACTOR_unzip_file file, int* method, | 156 | long |
108 | int* level, int raw); | 157 | EXTRACTOR_common_unzip_zlib_tell_file_func (voidpf opaque, |
158 | voidpf stream); | ||
109 | 159 | ||
110 | voidpf EXTRACTOR_common_unzip_zlib_open_file_func(voidpf opaque, | ||
111 | const char* filename, int mode); | ||
112 | 160 | ||
113 | uLong EXTRACTOR_common_unzip_zlib_read_file_func(voidpf opaque, voidpf stream, | 161 | long |
114 | void* buf, uLong size); | 162 | EXTRACTOR_common_unzip_zlib_seek_file_func (voidpf opaque, |
163 | voidpf stream, | ||
164 | uLong offset, | ||
165 | int origin); | ||
115 | 166 | ||
116 | long EXTRACTOR_common_unzip_zlib_tell_file_func(voidpf opaque, voidpf stream); | ||
117 | 167 | ||
118 | long EXTRACTOR_common_unzip_zlib_seek_file_func(voidpf opaque, voidpf stream, | 168 | int |
119 | uLong offset, int origin); | 169 | EXTRACTOR_common_unzip_zlib_close_file_func (voidpf opaque, |
170 | voidpf stream); | ||
120 | 171 | ||
121 | int EXTRACTOR_common_unzip_zlib_close_file_func(voidpf opaque, voidpf stream); | ||
122 | 172 | ||
123 | int EXTRACTOR_common_unzip_zlib_testerror_file_func(voidpf opaque, | 173 | int |
124 | voidpf stream); | 174 | EXTRACTOR_common_unzip_zlib_testerror_file_func (voidpf opaque, |
175 | voidpf stream); | ||
125 | 176 | ||
126 | #endif /* UNZIP_H_ */ | 177 | #endif /* UNZIP_H_ */ |