8200178: Remove mapfiles for JDK native libraries

Reviewed-by: erikj, alanb, mchung, prr, weijun
This commit is contained in:
Magnus Ihse Bursie 2018-03-28 23:56:08 +02:00
parent 2c292c30b2
commit 89f6ccb93e
157 changed files with 559 additions and 5564 deletions

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1994, 2013, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1994, 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
@ -201,7 +201,7 @@ writeBytes(JNIEnv *env, jobject this, jbyteArray bytes,
}
}
void
JNIEXPORT void JNICALL
throwFileNotFoundException(JNIEnv *env, jstring path)
{
char buf[256];

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -54,7 +54,8 @@ void writeSingle(JNIEnv *env, jobject this, jint byte, jboolean append, jfieldID
void writeBytes(JNIEnv *env, jobject this, jbyteArray bytes, jint off,
jint len, jboolean append, jfieldID fid);
void fileOpen(JNIEnv *env, jobject this, jstring path, jfieldID fid, int flags);
void throwFileNotFoundException(JNIEnv *env, jstring path);
JNIEXPORT void JNICALL
throwFileNotFoundException(JNIEnv *env, jstring path);
/*
* Macros for managing platform strings. The typical usage pattern is:

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -395,8 +395,11 @@ void* getProcessHandle();
void buildJniFunctionName(const char *sym, const char *cname,
char *jniEntryName);
extern size_t getLastErrorString(char *buf, size_t len);
extern int getErrorString(int err, char *buf, size_t len);
JNIEXPORT size_t JNICALL
getLastErrorString(char *buf, size_t len);
JNIEXPORT int JNICALL
getErrorString(int err, char *buf, size_t len);
#ifdef STATIC_BUILD
/* Macros for handling declaration of static/dynamic

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -55,7 +55,8 @@
* }
* ...
*/
extern "C" JImageFile* JIMAGE_Open(const char *name, jint* error) {
extern "C" JNIEXPORT JImageFile* JNICALL
JIMAGE_Open(const char *name, jint* error) {
// TODO - return a meaningful error code
*error = 0;
ImageFileReader* jfile = ImageFileReader::open(name);
@ -71,7 +72,8 @@ extern "C" JImageFile* JIMAGE_Open(const char *name, jint* error) {
* Ex.
* (*JImageClose)(image);
*/
extern "C" void JIMAGE_Close(JImageFile* image) {
extern "C" JNIEXPORT void JNICALL
JIMAGE_Close(JImageFile* image) {
ImageFileReader::close((ImageFileReader*) image);
}
@ -87,7 +89,8 @@ extern "C" void JIMAGE_Close(JImageFile* image) {
* tty->print_cr(package);
* -> java.base
*/
extern "C" const char* JIMAGE_PackageToModule(JImageFile* image, const char* package_name) {
extern "C" JNIEXPORT const char* JNICALL
JIMAGE_PackageToModule(JImageFile* image, const char* package_name) {
return ((ImageFileReader*) image)->get_image_module_data()->package_to_module(package_name);
}
@ -105,7 +108,8 @@ extern "C" const char* JIMAGE_PackageToModule(JImageFile* image, const char* pac
* JImageLocationRef location = (*JImageFindResource)(image,
* "java.base", "9.0", "java/lang/String.class", &size);
*/
extern "C" JImageLocationRef JIMAGE_FindResource(JImageFile* image,
extern "C" JNIEXPORT JImageLocationRef JNICALL
JIMAGE_FindResource(JImageFile* image,
const char* module_name, const char* version, const char* name,
jlong* size) {
// Concatenate to get full path
@ -151,7 +155,8 @@ extern "C" JImageLocationRef JIMAGE_FindResource(JImageFile* image,
* char* buffer = new char[size];
* (*JImageGetResource)(image, location, buffer, size);
*/
extern "C" jlong JIMAGE_GetResource(JImageFile* image, JImageLocationRef location,
extern "C" JNIEXPORT jlong JNICALL
JIMAGE_GetResource(JImageFile* image, JImageLocationRef location,
char* buffer, jlong size) {
((ImageFileReader*) image)->get_resource((u4) location, (u1*) buffer);
return size;
@ -179,7 +184,8 @@ extern "C" jlong JIMAGE_GetResource(JImageFile* image, JImageLocationRef locatio
* }
* (*JImageResourceIterator)(image, ctw_visitor, loader);
*/
extern "C" void JIMAGE_ResourceIterator(JImageFile* image,
extern "C" JNIEXPORT void JNICALL
JIMAGE_ResourceIterator(JImageFile* image,
JImageResourceVisitor_t visitor, void* arg) {
ImageFileReader* imageFile = (ImageFileReader*) image;
u4 nEntries = imageFile->table_length();
@ -220,7 +226,8 @@ extern "C" void JIMAGE_ResourceIterator(JImageFile* image,
* char path[JIMAGE_MAX_PATH];
* (*JImageResourcePath)(image, location, path, JIMAGE_MAX_PATH);
*/
extern "C" bool JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
extern "C" JNIEXPORT bool JNICALL
JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
char* path, size_t max) {
ImageFileReader* imageFile = (ImageFileReader*) image;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 2018, Oracle and/or its affiliates. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@ -72,7 +72,8 @@ typedef jlong JImageLocationRef;
* ...
*/
extern "C" JImageFile* JIMAGE_Open(const char *name, jint* error);
extern "C" JNIEXPORT JImageFile* JNICALL
JIMAGE_Open(const char *name, jint* error);
typedef JImageFile* (*JImageOpen_t)(const char *name, jint* error);
@ -86,7 +87,8 @@ typedef JImageFile* (*JImageOpen_t)(const char *name, jint* error);
* (*JImageClose)(image);
*/
extern "C" void JIMAGE_Close(JImageFile* jimage);
extern "C" JNIEXPORT void JNICALL
JIMAGE_Close(JImageFile* jimage);
typedef void (*JImageClose_t)(JImageFile* jimage);
@ -104,7 +106,8 @@ typedef void (*JImageClose_t)(JImageFile* jimage);
* -> java.base
*/
extern "C" const char * JIMAGE_PackageToModule(JImageFile* jimage, const char* package_name);
extern "C" JNIEXPORT const char * JNICALL
JIMAGE_PackageToModule(JImageFile* jimage, const char* package_name);
typedef const char* (*JImagePackageToModule_t)(JImageFile* jimage, const char* package_name);
@ -123,7 +126,7 @@ typedef const char* (*JImagePackageToModule_t)(JImageFile* jimage, const char* p
* JImageLocationRef location = (*JImageFindResource)(image,
* "java.base", "9.0", "java/lang/String.class", &size);
*/
extern "C" JImageLocationRef JIMAGE_FindResource(JImageFile* jimage,
extern "C" JNIEXPORT JImageLocationRef JIMAGE_FindResource(JImageFile* jimage,
const char* module_name, const char* version, const char* name,
jlong* size);
@ -147,7 +150,8 @@ typedef JImageLocationRef(*JImageFindResource_t)(JImageFile* jimage,
* char* buffer = new char[size];
* (*JImageGetResource)(image, location, buffer, size);
*/
extern "C" jlong JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location,
extern "C" JNIEXPORT jlong JNICALL
JIMAGE_GetResource(JImageFile* jimage, JImageLocationRef location,
char* buffer, jlong size);
typedef jlong(*JImageGetResource_t)(JImageFile* jimage, JImageLocationRef location,
@ -181,7 +185,8 @@ typedef bool (*JImageResourceVisitor_t)(JImageFile* jimage,
const char* module_name, const char* version, const char* package,
const char* name, const char* extension, void* arg);
extern "C" void JIMAGE_ResourceIterator(JImageFile* jimage,
extern "C" JNIEXPORT void JNICALL
JIMAGE_ResourceIterator(JImageFile* jimage,
JImageResourceVisitor_t visitor, void *arg);
typedef void (*JImageResourceIterator_t)(JImageFile* jimage,
@ -197,7 +202,8 @@ typedef void (*JImageResourceIterator_t)(JImageFile* jimage,
* char path[JIMAGE_MAX_PATH];
* (*JImageResourcePath)(image, location, path, JIMAGE_MAX_PATH);
*/
extern "C" bool JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
extern "C" JNIEXPORT bool JNICALL
JIMAGE_ResourcePath(JImageFile* image, JImageLocationRef locationRef,
char* path, size_t max);
typedef bool (*JImage_ResourcePath_t)(JImageFile* jimage, JImageLocationRef location,

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2015, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2015, 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
@ -38,6 +38,7 @@
int IsWhiteSpaceOption(const char* name) { return 1; }
#else
#include "java.h"
#include "jni.h"
#endif
#include "jli_util.h"
@ -78,7 +79,8 @@ static size_t argsCount = 1;
static jboolean stopExpansion = JNI_FALSE;
static jboolean relaunch = JNI_FALSE;
void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile) {
JNIEXPORT void JNICALL
JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile) {
// No expansion for relaunch
if (argsCount != 1) {
relaunch = JNI_TRUE;
@ -94,7 +96,8 @@ void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile) {
firstAppArgIndex = hasJavaArgs ? 0: NOT_FOUND;
}
int JLI_GetAppArgIndex() {
JNIEXPORT int JNICALL
JLI_GetAppArgIndex() {
// Will be 0 for tools
return firstAppArgIndex;
}
@ -373,7 +376,8 @@ static JLI_List expandArgFile(const char *arg) {
return rv;
}
JLI_List JLI_PreprocessArg(const char *arg)
JNIEXPORT JLI_List JNICALL
JLI_PreprocessArg(const char *arg)
{
JLI_List rv;
@ -428,7 +432,8 @@ int isTerminalOpt(char *arg) {
JLI_StrCmp(arg, "--full-version") == 0;
}
jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name) {
JNIEXPORT jboolean JNICALL
JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name) {
char *env = getenv(var_name);
char *p, *arg;
char quote;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2017, 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
@ -52,6 +52,7 @@
#include "java.h"
#include "jni.h"
/*
* A NOTE TO DEVELOPERS: For performance reasons it is important that
@ -212,7 +213,7 @@ static jlong initialHeapSize = 0; /* inital heap size */
/*
* Entry point.
*/
int
JNIEXPORT int JNICALL
JLI_Launch(int argc, char ** argv, /* main argc, argc */
int jargc, const char** jargv, /* java args */
int appclassc, const char** appclassv, /* app classpath */
@ -2337,7 +2338,7 @@ DumpState()
/*
* A utility procedure to always print to stderr
*/
void
JNIEXPORT void JNICALL
JLI_ReportMessage(const char* fmt, ...)
{
va_list vl;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 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
@ -86,7 +86,7 @@ typedef struct {
GetCreatedJavaVMs_t GetCreatedJavaVMs;
} InvocationFunctions;
int
JNIEXPORT int JNICALL
JLI_Launch(int argc, char ** argv, /* main argc, argc */
int jargc, const char** jargv, /* java args */
int appclassc, const char** appclassv, /* app classpath */
@ -133,13 +133,16 @@ void CreateExecutionEnvironment(int *argc, char ***argv,
char *jvmcfg, jint so_jvmcfg);
/* Reports an error message to stderr or a window as appropriate. */
void JLI_ReportErrorMessage(const char * message, ...);
JNIEXPORT void JNICALL
JLI_ReportErrorMessage(const char * message, ...);
/* Reports a system error message to stderr or a window */
void JLI_ReportErrorMessageSys(const char * message, ...);
JNIEXPORT void JNICALL
JLI_ReportErrorMessageSys(const char * message, ...);
/* Reports an error message only to stderr. */
void JLI_ReportMessage(const char * message, ...);
JNIEXPORT void JNICALL
JLI_ReportMessage(const char * message, ...);
/* Reports a message only to stdout. */
void JLI_ShowMessage(const char * message, ...);
@ -148,7 +151,8 @@ void JLI_ShowMessage(const char * message, ...);
* Reports an exception which terminates the vm to stderr or a window
* as appropriate.
*/
void JLI_ReportExceptionDescription(JNIEnv * env);
JNIEXPORT void JNICALL
JLI_ReportExceptionDescription(JNIEnv * env);
void PrintMachineDependentOptions();
/*

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 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
@ -26,13 +26,14 @@
#include <stdio.h>
#include <string.h>
#include <stdarg.h>
#include "jni.h"
#include "jli_util.h"
/*
* Returns a pointer to a block of at least 'size' bytes of memory.
* Prints error message and exits if the memory could not be allocated.
*/
void *
JNIEXPORT void * JNICALL
JLI_MemAlloc(size_t size)
{
void *p = malloc(size);
@ -62,7 +63,7 @@ JLI_MemRealloc(void *ptr, size_t size)
* Wrapper over strdup(3C) which prints an error message and exits if memory
* could not be allocated.
*/
char *
JNIEXPORT char * JNICALL
JLI_StringDup(const char *s1)
{
char *s = strdup(s1);
@ -77,7 +78,7 @@ JLI_StringDup(const char *s1)
* Very equivalent to free(ptr).
* Here to maintain pairing with the above routines.
*/
void
JNIEXPORT void JNICALL
JLI_MemFree(void *ptr)
{
free(ptr);
@ -99,7 +100,7 @@ JLI_TraceLauncher(const char* fmt, ...)
fflush(stdout);
}
void
JNIEXPORT void JNICALL
JLI_SetTraceLauncher()
{
if (getenv(JLDEBUG_ENV_ENTRY) != 0) {
@ -120,7 +121,7 @@ JLI_StrCCmp(const char *s1, const char* s2)
return JLI_StrNCmp(s1, s2, JLI_StrLen(s2));
}
JLI_List
JNIEXPORT JLI_List JNICALL
JLI_List_new(size_t capacity)
{
JLI_List l = (JLI_List) JLI_MemAlloc(sizeof(struct JLI_List_));
@ -155,7 +156,7 @@ JLI_List_ensureCapacity(JLI_List sl, size_t capacity)
}
}
void
JNIEXPORT void JNICALL
JLI_List_add(JLI_List sl, char *str)
{
JLI_List_ensureCapacity(sl, sl->size+1);

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2005, 2017, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2005, 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
@ -40,10 +40,17 @@
#define JLDEBUG_ENV_ENTRY "_JAVA_LAUNCHER_DEBUG"
void *JLI_MemAlloc(size_t size);
JNIEXPORT void * JNICALL
JLI_MemAlloc(size_t size);
void *JLI_MemRealloc(void *ptr, size_t size);
char *JLI_StringDup(const char *s1);
void JLI_MemFree(void *ptr);
JNIEXPORT char * JNICALL
JLI_StringDup(const char *s1);
JNIEXPORT void JNICALL
JLI_MemFree(void *ptr);
int JLI_StrCCmp(const char *s1, const char* s2);
typedef struct {
@ -51,9 +58,14 @@ typedef struct {
jboolean has_wildcard;
} StdArg;
StdArg *JLI_GetStdArgs();
int JLI_GetStdArgc();
int JLI_GetAppArgIndex();
JNIEXPORT StdArg * JNICALL
JLI_GetStdArgs();
JNIEXPORT int JNICALL
JLI_GetStdArgc();
JNIEXPORT int JNICALL
JLI_GetAppArgIndex();
#define JLI_StrLen(p1) strlen((p1))
#define JLI_StrChr(p1, p2) strchr((p1), (p2))
@ -77,7 +89,8 @@ int JLI_GetAppArgIndex();
#define JLI_StrCaseCmp(p1, p2) stricmp((p1), (p2))
#define JLI_StrNCaseCmp(p1, p2, p3) strnicmp((p1), (p2), (p3))
int JLI_Snprintf(char *buffer, size_t size, const char *format, ...);
void JLI_CmdToArgs(char *cmdline);
JNIEXPORT void JNICALL
JLI_CmdToArgs(char *cmdline);
#define JLI_Lseek _lseeki64
#define JLI_PutEnv _putenv
#define JLI_GetPid _getpid
@ -108,7 +121,10 @@ void JLI_CmdToArgs(char *cmdline);
* Make launcher spit debug output.
*/
void JLI_TraceLauncher(const char* fmt, ...);
void JLI_SetTraceLauncher();
JNIEXPORT void JNICALL
JLI_SetTraceLauncher();
jboolean JLI_IsTraceLauncher();
/*
@ -122,19 +138,29 @@ struct JLI_List_
};
typedef struct JLI_List_ *JLI_List;
JLI_List JLI_List_new(size_t capacity);
JNIEXPORT JLI_List JNICALL
JLI_List_new(size_t capacity);
void JLI_List_free(JLI_List l);
void JLI_List_ensureCapacity(JLI_List l, size_t capacity);
/* e must be JLI_MemFree-able */
void JLI_List_add(JLI_List l, char *e);
JNIEXPORT void JNICALL
JLI_List_add(JLI_List l, char *e);
/* a copy is made out of beg */
void JLI_List_addSubstring(JLI_List l, const char *beg, size_t len);
char *JLI_List_combine(JLI_List sl);
char *JLI_List_join(JLI_List l, char sep);
JLI_List JLI_List_split(const char *str, char sep);
void JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile);
JLI_List JLI_PreprocessArg(const char *arg);
jboolean JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name);
JNIEXPORT void JNICALL
JLI_InitArgProcessing(jboolean hasJavaArgs, jboolean disableArgFile);
JNIEXPORT JLI_List JNICALL
JLI_PreprocessArg(const char *arg);
JNIEXPORT jboolean JNICALL
JLI_AddArgsFromEnvVar(JLI_List args, const char *var_name);
#endif /* _JLI_UTIL_H */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -27,6 +27,7 @@
#define _MANIFEST_INFO_H
#include <sys/types.h>
#include "jni.h"
/*
* Zip file header signatures
@ -186,7 +187,9 @@ int JLI_ParseManifest(char *jarfile, manifest_info *info);
void *JLI_JarUnpackFile(const char *jarfile, const char *filename,
int *size);
void JLI_FreeManifest(void);
int JLI_ManifestIterate(const char *jarfile, attribute_closure ac,
JNIEXPORT int JNICALL
JLI_ManifestIterate(const char *jarfile, attribute_closure ac,
void *user_data);
#endif /* _MANIFEST_INFO_H */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 2003, 2015, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2003, 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
@ -29,6 +29,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "jni.h"
#include "jli_util.h"
#include <zlib.h>
@ -676,7 +677,7 @@ JLI_FreeManifest()
* -2 Error accessing the manifest from within the jarfile (most likely
* this means a manifest is not present, or it isn't a valid zip/jar file).
*/
int
JNIEXPORT int JNICALL
JLI_ManifestIterate(const char *jarfile, attribute_closure ac, void *user_data)
{
int fd;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2016, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -202,6 +202,7 @@ NET_EnableFastTcpLoopback(int fd);
unsigned short in_cksum(unsigned short *addr, int len);
jint NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout);
JNIEXPORT jint JNICALL
NET_Wait(JNIEnv *env, jint fd, jint flags, jint timeout);
#endif /* NET_UTILS_H */

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1997, 2012, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1997, 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
@ -54,7 +54,7 @@ Java_java_util_zip_CRC32_updateBytes0(JNIEnv *env, jclass cls, jint crc,
return crc;
}
jint JNICALL
JNIEXPORT jint JNICALL
ZIP_CRC32(jint crc, const jbyte *buf, jint len)
{
return crc32(crc, (Bytef*)buf, len);

View file

@ -1,5 +1,5 @@
/*
* 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
@ -881,7 +881,7 @@ ZIP_Put_In_Cache0(const char *name, ZFILE zfd, char **pmsg, jlong lastModified,
* 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);
@ -895,7 +895,7 @@ ZIP_Open(const char *name, char **pmsg)
/*
* Closes the specified zip file object.
*/
void JNICALL
JNIEXPORT void JNICALL
ZIP_Close(jzfile *zip)
{
MLOCK(zfiles_lock);
@ -1094,7 +1094,7 @@ newEntry(jzfile *zip, jzcell *zc, AccessHint accessHint)
* jzentry for each zip. This optimizes a common access pattern.
*/
void JNICALL
JNIEXPORT void JNICALL
ZIP_FreeEntry(jzfile *jz, jzentry *ze)
{
jzentry *last;
@ -1115,7 +1115,7 @@ ZIP_FreeEntry(jzfile *jz, jzentry *ze)
* 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) {
@ -1238,7 +1238,7 @@ Finally:
* 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;
@ -1254,7 +1254,7 @@ ZIP_GetNextEntry(jzfile *zip, jint n)
/*
* Locks the specified zip file for reading.
*/
void
JNIEXPORT void JNICALL
ZIP_Lock(jzfile *zip)
{
MLOCK(zip->lock);
@ -1263,7 +1263,7 @@ ZIP_Lock(jzfile *zip)
/*
* Unlocks the specified zip file.
*/
void
JNIEXPORT void JNICALL
ZIP_Unlock(jzfile *zip)
{
MUNLOCK(zip->lock);
@ -1310,7 +1310,7 @@ ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry)
* 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;
@ -1439,7 +1439,7 @@ InflateFully(jzfile *zip, jzentry *entry, void *buf, char **msg)
* 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);
@ -1456,7 +1456,7 @@ ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP)
* 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;
@ -1515,7 +1515,7 @@ ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entryname)
return JNI_TRUE;
}
jboolean JNICALL
JNIEXPORT jboolean JNICALL
ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg)
{
z_stream strm;

View file

@ -1,5 +1,5 @@
/*
* Copyright (c) 1995, 2013, 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
@ -30,6 +30,8 @@
#ifndef _ZIP_H_
#define _ZIP_H_
#include "jni.h"
/*
* Header signatures
*/
@ -239,16 +241,16 @@ typedef struct jzfile { /* Zip file */
*/
#define ZIP_ENDCHAIN ((jint)-1)
jzentry * JNICALL
JNIEXPORT jzentry * JNICALL
ZIP_FindEntry(jzfile *zip, char *name, jint *sizeP, jint *nameLenP);
jboolean JNICALL
JNIEXPORT jboolean JNICALL
ZIP_ReadEntry(jzfile *zip, jzentry *entry, unsigned char *buf, char *entrynm);
jzentry * JNICALL
JNIEXPORT jzentry * JNICALL
ZIP_GetNextEntry(jzfile *zip, jint n);
jzfile * JNICALL
JNIEXPORT jzfile * JNICALL
ZIP_Open(const char *name, char **pmsg);
jzfile *
@ -263,19 +265,23 @@ 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
JNIEXPORT void JNICALL
ZIP_Close(jzfile *zip);
jzentry * ZIP_GetEntry(jzfile *zip, char *name, jint ulen);
void ZIP_Lock(jzfile *zip);
void ZIP_Unlock(jzfile *zip);
jint ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len);
void JNICALL
JNIEXPORT jzentry * JNICALL
ZIP_GetEntry(jzfile *zip, char *name, jint ulen);
JNIEXPORT void JNICALL
ZIP_Lock(jzfile *zip);
JNIEXPORT void JNICALL
ZIP_Unlock(jzfile *zip);
JNIEXPORT jint JNICALL
ZIP_Read(jzfile *zip, jzentry *entry, jlong pos, void *buf, jint len);
JNIEXPORT void JNICALL
ZIP_FreeEntry(jzfile *zip, jzentry *ze);
jlong ZIP_GetEntryDataOffset(jzfile *zip, jzentry *entry);
jzentry * ZIP_GetEntry2(jzfile *zip, char *name, jint ulen, jboolean addSlash);
jboolean JNICALL
JNIEXPORT jboolean JNICALL
ZIP_InflateFully(void *inBuf, jlong inLen, void *outBuf, jlong outLen, char **pmsg);
#endif /* !_ZIP_H_ */