jdk/src/java.base/share/native/libzip/zip_util.h
changeset 27084 d7fbf9a294af
parent 25859 3317bb8137f4
child 27565 729f9700483a
equal deleted inserted replaced
27083:cbf7fcda2e3f 27084:d7fbf9a294af
   152  * - If extra != 0 then the first two bytes are the length of the extra
   152  * - If extra != 0 then the first two bytes are the length of the extra
   153  *   data in intel byte order.
   153  *   data in intel byte order.
   154  * - If pos <= 0 then it is the position of entry LOC header.
   154  * - If pos <= 0 then it is the position of entry LOC header.
   155  *   If pos > 0 then it is the position of entry data.
   155  *   If pos > 0 then it is the position of entry data.
   156  *   pos should not be accessed directly, but only by ZIP_GetEntryDataOffset.
   156  *   pos should not be accessed directly, but only by ZIP_GetEntryDataOffset.
       
   157  * - entry name may include embedded null character, use nlen for length
   157  */
   158  */
   158 
   159 
   159 typedef struct jzentry {  /* Zip file entry */
   160 typedef struct jzentry {  /* Zip file entry */
   160     char *name;           /* entry name */
   161     char *name;           /* entry name */
   161     jlong time;           /* modification time */
   162     jlong time;           /* modification time */
   164     jint crc;             /* crc of uncompressed data */
   165     jint crc;             /* crc of uncompressed data */
   165     char *comment;        /* optional zip file comment */
   166     char *comment;        /* optional zip file comment */
   166     jbyte *extra;         /* optional extra data */
   167     jbyte *extra;         /* optional extra data */
   167     jlong pos;            /* position of LOC header or entry data */
   168     jlong pos;            /* position of LOC header or entry data */
   168     jint flag;            /* general purpose flag */
   169     jint flag;            /* general purpose flag */
       
   170     jint nlen;            /* length of the entry name */
   169 } jzentry;
   171 } jzentry;
   170 
   172 
   171 /*
   173 /*
   172  * In-memory hash table cell.
   174  * In-memory hash table cell.
   173  * In a typical system we have a *lot* of these, as we have one for
   175  * In a typical system we have a *lot* of these, as we have one for
   267 void ZIP_Lock(jzfile *zip);
   269 void ZIP_Lock(jzfile *zip);
   268 void ZIP_Unlock(jzfile *zip);
   270 void ZIP_Unlock(jzfile *zip);
   269 jint ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len);
   271 jint ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len);
   270 void ZIP_FreeEntry(jzfile *zip, jzentry *ze);
   272 void ZIP_FreeEntry(jzfile *zip, jzentry *ze);
   271 jlong ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry);
   273 jlong ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry);
   272 
   274 jzentry * ZIP_GetEntry2(jzfile *zip, char *name, jint ulen, jboolean addSlash);
   273 #endif /* !_ZIP_H_ */
   275 #endif /* !_ZIP_H_ */