< prev index next >

src/java.base/share/native/libzip/zip_util.h

Print this page




 143 #define STORED      0
 144 #define DEFLATED    8
 145 
 146 /*
 147  * Support for reading ZIP/JAR files. Some things worth noting:
 148  *
 149  * - Zip file entries larger than 2**32 bytes are not supported.
 150  * - jzentry time and crc fields are signed even though they really
 151  *   represent unsigned quantities.
 152  * - If csize is zero then the entry is uncompressed.
 153  * - If extra != 0 then the first two bytes are the length of the extra
 154  *   data in intel byte order.
 155  * - If pos <= 0 then it is the position of entry LOC header.
 156  *   If pos > 0 then it is the position of entry data.
 157  *   pos should not be accessed directly, but only by ZIP_GetEntryDataOffset.
 158  * - entry name may include embedded null character, use nlen for length
 159  */
 160 
 161 typedef struct jzentry {  /* Zip file entry */
 162     char *name;           /* entry name */

 163     jlong time;           /* modification time */
 164     jlong size;           /* size of uncompressed data */
 165     jlong csize;          /* size of compressed data (zero if uncompressed) */
 166     jint crc;             /* crc of uncompressed data */
 167     char *comment;        /* optional zip file comment */
 168     jbyte *extra;         /* optional extra data */
 169     jlong pos;            /* position of LOC header or entry data */
 170     jint flag;            /* general purpose flag */
 171     jint nlen;            /* length of the entry name */
 172 } jzentry;
 173 
 174 /*
 175  * In-memory hash table cell.
 176  * In a typical system we have a *lot* of these, as we have one for
 177  * every entry in every active JAR.
 178  * Note that in order to save space we don't keep the name in memory,
 179  * but merely remember a 32 bit hash.
 180  */
 181 typedef struct jzcell {
 182     unsigned int hash;    /* 32 bit hashcode on name */




 143 #define STORED      0
 144 #define DEFLATED    8
 145 
 146 /*
 147  * Support for reading ZIP/JAR files. Some things worth noting:
 148  *
 149  * - Zip file entries larger than 2**32 bytes are not supported.
 150  * - jzentry time and crc fields are signed even though they really
 151  *   represent unsigned quantities.
 152  * - If csize is zero then the entry is uncompressed.
 153  * - If extra != 0 then the first two bytes are the length of the extra
 154  *   data in intel byte order.
 155  * - If pos <= 0 then it is the position of entry LOC header.
 156  *   If pos > 0 then it is the position of entry data.
 157  *   pos should not be accessed directly, but only by ZIP_GetEntryDataOffset.
 158  * - entry name may include embedded null character, use nlen for length
 159  */
 160 
 161 typedef struct jzentry {  /* Zip file entry */
 162     char *name;           /* entry name */
 163     jint  method;         /* compression method */
 164     jlong time;           /* modification time */
 165     jlong size;           /* size of uncompressed data */
 166     jlong csize;          /* size of compressed data (zero if uncompressed) */
 167     jint crc;             /* crc of uncompressed data */
 168     char *comment;        /* optional zip file comment */
 169     jbyte *extra;         /* optional extra data */
 170     jlong pos;            /* position of LOC header or entry data */
 171     jint flag;            /* general purpose flag */
 172     jint nlen;            /* length of the entry name */
 173 } jzentry;
 174 
 175 /*
 176  * In-memory hash table cell.
 177  * In a typical system we have a *lot* of these, as we have one for
 178  * every entry in every active JAR.
 179  * Note that in order to save space we don't keep the name in memory,
 180  * but merely remember a 32 bit hash.
 181  */
 182 typedef struct jzcell {
 183     unsigned int hash;    /* 32 bit hashcode on name */


< prev index next >