29
30 // Type definitions for zip file and zip file entry
31 typedef void* jzfile;
32 typedef struct {
33 char* name; /* entry name */
34 jlong time; /* modification time */
35 jlong size; /* size of uncompressed data */
36 jlong csize; /* size of compressed data (zero if uncompressed) */
37 jint crc; /* crc of uncompressed data */
38 char* comment; /* optional zip file comment */
39 jbyte* extra; /* optional extra data */
40 jlong pos; /* position of LOC header (if negative) or data */
41 } jzentry;
42
43 class ZipLibrary : AllStatic {
44 public:
45 static void** open(const char* name, char** pmsg);
46 static void close(jzfile* zip);
47 static jzentry* find_entry(jzfile* zip, const char* name, jint* sizeP, jint* nameLen);
48 static jboolean read_entry(jzfile* zip, jzentry* entry, unsigned char* buf, char* namebuf);
49 static jint crc32(jint crc, const jbyte* buf, jint len);
50 static const char* init_params(size_t block_size, size_t* needed_out_size, size_t* needed_tmp_size, int level);
51 static size_t compress(char* in, size_t in_size, char* out, size_t out_size, char* tmp, size_t tmp_size, int level, char* buf, const char** pmsg);
52 static void* handle();
53 };
54
55 #endif // SHARE_UTILITIES_ZIPLIBRARY_HPP
|
29
30 // Type definitions for zip file and zip file entry
31 typedef void* jzfile;
32 typedef struct {
33 char* name; /* entry name */
34 jlong time; /* modification time */
35 jlong size; /* size of uncompressed data */
36 jlong csize; /* size of compressed data (zero if uncompressed) */
37 jint crc; /* crc of uncompressed data */
38 char* comment; /* optional zip file comment */
39 jbyte* extra; /* optional extra data */
40 jlong pos; /* position of LOC header (if negative) or data */
41 } jzentry;
42
43 class ZipLibrary : AllStatic {
44 public:
45 static void** open(const char* name, char** pmsg);
46 static void close(jzfile* zip);
47 static jzentry* find_entry(jzfile* zip, const char* name, jint* sizeP, jint* nameLen);
48 static jboolean read_entry(jzfile* zip, jzentry* entry, unsigned char* buf, char* namebuf);
49 static void free_entry(jzfile* zip, jzentry* entry);
50 static jint crc32(jint crc, const jbyte* buf, jint len);
51 static const char* init_params(size_t block_size, size_t* needed_out_size, size_t* needed_tmp_size, int level);
52 static size_t compress(char* in, size_t in_size, char* out, size_t out_size, char* tmp, size_t tmp_size, int level, char* buf, const char** pmsg);
53 static void* handle();
54 };
55
56 #endif // SHARE_UTILITIES_ZIPLIBRARY_HPP
|