/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
#ifndef _JAVA_H_
#define _JAVA_H_
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <limits.h>
#include <jni.h>
#include <jvm.h>
/*
* Get system specific defines.
*/
#include "emessages.h"
#include "java_md.h"
#include "jli_util.h"
#include "manifest_info.h"
#include "version_comp.h"
#include "wildcard.h"
#include "splashscreen.h"
/*
* The following environment variable is used to influence the behavior
* of the jre exec'd through the SelectVersion routine. The command line
* options which specify the version are not passed to the exec'd version,
* because that jre may be an older version which wouldn't recognize them.
* This environment variable is known to this (and later) version and serves
* to suppress the version selection code. This is not only for efficiency,
* but also for correctness, since any command line options have been
* removed which would cause any value found in the manifest to be used.
* This would be incorrect because the command line options are defined
* to take precedence.
*
* The value associated with this environment variable is the MainClass
* name from within the executable jar file (if any). This is strictly a
* performance enhancement to avoid re-reading the jar file manifest.
*
*/
/*
* Pointers to the needed JNI invocation API, initialized by LoadJavaVM.
*/
typedef struct {
int
const char* fullversion, /* full version defined */
const char* dotversion, /* dot version defined */
const char* pname, /* program name */
const char* lname, /* launcher name */
);
/*
* Prototypes for launcher functions in the system specific java_md.c.
*/
void
/*
* Different platforms will implement this, here
* pargc is a pointer to the original argc,
* pargv is a pointer to the original argv,
* jrepath is an accessible path to the jre as determined by the call
* so_jrepath is the length of the buffer jrepath
* jvmpath is an accessible path to the jvm as determined by the call
* so_jvmpath is the length of the buffer jvmpath
*/
/* Reports an error message to stderr or a window as appropriate. */
void JLI_ReportErrorMessage(const char * message, ...);
/* Reports a system error message to stderr or a window */
void JLI_ReportErrorMessageSys(const char * message, ...);
/* Reports an error message only to stderr. */
void JLI_ReportMessage(const char * message, ...);
/*
* Reports an exception which terminates the vm to stderr or a window
* as appropriate.
*/
void PrintMachineDependentOptions();
const char *jlong_format_specifier();
/*
* Block current thread and continue execution in new thread
*/
/* sun.java.launcher.* platform properties. */
void SetJavaLauncherPlatformProps(void);
void SetJavaLauncherProp(void);
/*
*/
enum ergo_policy {
DEFAULT_POLICY = 0,
};
const char* GetProgramName();
const char* GetDotVersion();
const char* GetFullVersion();
/*
* Initialize platform specific settings
*/
/*
*/
void ShowSplashScreen();
void RegisterThread();
/*
* this method performs additional platform specific processing and
* should return JNI_TRUE to indicate the argument has been consumed,
* otherwise returns JNI_FALSE to allow the calling logic to further
* process the option.
*/
/*
* This allows for finding classes from the VM's bootstrap class loader directly,
* FindClass uses the application class loader internally, this will cause
* unnecessary searching of the classpath for the required classes.
*
*/
const char *name));
LM_UNKNOWN = 0,
};
static const char *launchModeNames[]
= { "Unknown", "Main class", "JAR file" };
typedef struct {
int argc;
char **argv;
int mode;
char *what;
} JavaMainArgs;
#define NULL_CHECK0(e) if ((e) == 0) { \
return 0; \
}
#define NULL_CHECK(e) if ((e) == 0) { \
return; \
}
#endif /* _JAVA_H_ */