< prev index next >

src/java.base/share/native/libjli/args.c

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * 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
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -36,10 +36,11 @@
   #define JLI_ReportMessage(...) printf(__VA_ARGS__)
   #define JDK_JAVA_OPTIONS "JDK_JAVA_OPTIONS"
   int IsWhiteSpaceOption(const char* name) { return 1; }
 #else
   #include "java.h"
+  #include "jni.h"
 #endif
 
 #include "jli_util.h"
 #include "emessages.h"
 

@@ -76,11 +77,12 @@
 // Initialize to 1, as the first argument is the app name and not preprocessed
 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;
         stopExpansion = JNI_TRUE;
         argsCount = 1;

@@ -92,11 +94,12 @@
 
     // for tools, this value remains 0 all the time.
     firstAppArgIndex = hasJavaArgs ? 0: NOT_FOUND;
 }
 
-int JLI_GetAppArgIndex() {
+JNIEXPORT int JNICALL
+JLI_GetAppArgIndex() {
     // Will be 0 for tools
     return firstAppArgIndex;
 }
 
 static void checkArg(const char *arg) {

@@ -371,11 +374,12 @@
     }
 
     return rv;
 }
 
-JLI_List JLI_PreprocessArg(const char *arg)
+JNIEXPORT JLI_List JNICALL
+JLI_PreprocessArg(const char *arg)
 {
     JLI_List rv;
 
     if (firstAppArgIndex > 0) {
         // In user application arg, no more work.

@@ -426,11 +430,12 @@
            JLI_StrCmp(arg, "--version") == 0 ||
            JLI_StrCmp(arg, "-fullversion") == 0 ||
            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;
     JLI_List argsInFile;
 
< prev index next >