src/share/native/java/util/zip/zip_util.h

Print this page

        

@@ -43,13 +43,10 @@
 
 /*
  * Header sizes including signatures
  */
 
-#ifdef USE_MMAP
-#define SIGSIZ  4
-#endif
 #define LOCHDR 30
 #define EXTHDR 16
 #define CENHDR 46
 #define ENDHDR 22
 

@@ -209,13 +206,13 @@
 #ifdef USE_MMAP
     unsigned char *maddr; /* beginning address of the CEN & ENDHDR */
     jlong mlen;           /* length (in bytes) mmaped */
     jlong offset;         /* offset of the mmapped region from the
                              start of the file. */
-#else
-    cencache cencache;    /* CEN header cache */
+    jboolean usemmap;     /* if mmap is used. */
 #endif
+    cencache cencache;    /* CEN header cache */
     ZFILE zfd;            /* open file descriptor */
     void *lock;           /* read lock */
     char *comment;        /* zip file comment */
     jint clen;            /* length of the zip file comment */
     char *msg;            /* zip error message */

@@ -257,10 +254,13 @@
 ZIP_Get_From_Cache(const char *name, char **pmsg, jlong lastModified);
 
 jzfile *
 ZIP_Put_In_Cache(const char *name, ZFILE zfd, char **pmsg, jlong lastModified);
 
+jzfile *
+ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified, jboolean usemmap);
+
 void JNICALL
 ZIP_Close(jzfile *zip);
 
 jzentry * ZIP_GetEntry(jzfile *zip, char *name, jint ulen);
 void ZIP_Lock(jzfile *zip);