< prev index next >

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

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 1995, 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1995, 2018, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -879,11 +879,11 @@
  * Opens a zip file for reading. Returns the jzfile object or NULL
  * if an error occurred. If a zip error occurred then *msg will be
  * set to the error message text if msg != 0. Otherwise, *msg will be
  * set to NULL. Caller doesn't need to free the error message.
  */
-jzfile * JNICALL
+JNIEXPORT jzfile * JNICALL
 ZIP_Open(const char *name, char **pmsg)
 {
     jzfile *file = ZIP_Open_Generic(name, pmsg, O_RDONLY, 0);
     if (file == NULL && pmsg != NULL && *pmsg != NULL) {
         free(*pmsg);

@@ -893,11 +893,11 @@
 }
 
 /*
  * Closes the specified zip file object.
  */
-void JNICALL
+JNIEXPORT void JNICALL
 ZIP_Close(jzfile *zip)
 {
     MLOCK(zfiles_lock);
     if (--zip->refs > 0) {
         /* Still more references so just return */

@@ -1092,11 +1092,11 @@
  * Free the given jzentry.
  * In fact we maintain a one-entry cache of the most recently used
  * jzentry for each zip.  This optimizes a common access pattern.
  */
 
-void JNICALL
+JNIEXPORT void JNICALL
 ZIP_FreeEntry(jzfile *jz, jzentry *ze)
 {
     jzentry *last;
     ZIP_Lock(jz);
     last = jz->cache;

@@ -1113,11 +1113,11 @@
 
 /*
  * Returns the zip entry corresponding to the specified name, or
  * NULL if not found.
  */
-jzentry *
+JNIEXPORT jzentry * JNICALL
 ZIP_GetEntry(jzfile *zip, char *name, jint ulen)
 {
     if (ulen == 0) {
         return ZIP_GetEntry2(zip, name, (jint)strlen(name), JNI_FALSE);
     }

@@ -1236,11 +1236,11 @@
 
 /*
  * Returns the n'th (starting at zero) zip file entry, or NULL if the
  * specified index was out of range.
  */
-jzentry * JNICALL
+JNIEXPORT jzentry * JNICALL
 ZIP_GetNextEntry(jzfile *zip, jint n)
 {
     jzentry *result;
     if (n < 0 || n >= zip->total) {
         return 0;

@@ -1252,20 +1252,20 @@
 }
 
 /*
  * Locks the specified zip file for reading.
  */
-void
+JNIEXPORT void JNICALL
 ZIP_Lock(jzfile *zip)
 {
     MLOCK(zip->lock);
 }
 
 /*
  * Unlocks the specified zip file.
  */
-void
+JNIEXPORT void JNICALL
 ZIP_Unlock(jzfile *zip)
 {
     MUNLOCK(zip->lock);
 }
 

@@ -1308,11 +1308,11 @@
  * then a zip error occurred and zip->msg contains the error text.
  *
  * The current implementation does not support reading an entry that
  * has the size bigger than 2**32 bytes in ONE invocation.
  */
-jint
+JNIEXPORT jint JNICALL
 ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len)
 {
     jlong entry_size;
     jlong start;
 

@@ -1437,11 +1437,11 @@
 
 /*
  * The current implementation does not support reading an entry that
  * has the size bigger than 2**32 bytes in ONE invocation.
  */
-jzentry * JNICALL
+JNIEXPORT jzentry * JNICALL
 ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP)
 {
     jzentry *entry = ZIP_GetEntry(zip, name, 0);
     if (entry) {
         *sizeP = (jint)entry->size;

@@ -1454,11 +1454,11 @@
  * Reads a zip file entry into the specified byte array
  * When the method completes, it releases the jzentry.
  * Note: this is called from the separately delivered VM (hotspot/classic)
  * so we have to be careful to maintain the expected behaviour.
  */
-jboolean JNICALL
+JNIEXPORT jboolean JNICALL
 ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entryname)
 {
     char *msg;
     char tmpbuf[1024];
 

@@ -1513,11 +1513,11 @@
     ZIP_FreeEntry(zip, entry);
 
     return JNI_TRUE;
 }
 
-jboolean JNICALL
+JNIEXPORT jboolean JNICALL
 ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg)
 {
     z_stream strm;
     int i = 0;
     memset(&strm, 0, sizeof(z_stream));
< prev index next >