1 /*
   2  * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 
  26 #ifndef _JAVA_PROPS_H
  27 #define _JAVA_PROPS_H
  28 
  29 #include <jni_util.h>
  30 
  31 /* The preferred native type for storing text on the current OS */
  32 #ifdef WIN32
  33 #include <tchar.h>
  34 typedef WCHAR nchar;
  35 #else
  36 typedef char nchar;
  37 #endif
  38 
  39 typedef struct {
  40     char *os_name;
  41     char *os_version;
  42     char *os_arch;
  43 
  44 #ifdef JDK_ARCH_ABI_PROP_NAME
  45     char *sun_arch_abi;
  46 #endif
  47 
  48     nchar *tmp_dir;
  49     nchar *font_dir;
  50     nchar *user_dir;
  51 
  52     char *file_separator;
  53     char *path_separator;
  54     char *line_separator;
  55 
  56     nchar *user_name;
  57     nchar *user_home;
  58 
  59     char *language;
  60     char *format_language;
  61     char *display_language;
  62     char *script;
  63     char *format_script;
  64     char *display_script;
  65     char *country;
  66     char *format_country;
  67     char *display_country;
  68     char *variant;
  69     char *format_variant;
  70     char *display_variant;
  71     char *encoding;
  72     char *sun_jnu_encoding;
  73     char *sun_stdout_encoding;
  74     char *sun_stderr_encoding;
  75     char *timezone;
  76 
  77     char *printerJob;
  78     char *graphics_env;
  79     char *awt_toolkit;
  80 
  81     char *unicode_encoding;     /* The default endianness of unicode
  82                                     i.e. UnicodeBig or UnicodeLittle   */
  83 
  84     const char *cpu_isalist;    /* list of supported instruction sets */
  85 
  86     char *cpu_endian;           /* endianness of platform */
  87 
  88     char *data_model;           /* 32 or 64 bit data model */
  89 
  90     char *patch_level;          /* patches/service packs installed */
  91 
  92     char *desktop;              /* Desktop name. */
  93 
  94 #ifdef MACOSX
  95     // These are for proxy-related information.
  96     // Note that if these platform-specific extensions get out of hand we should make a new
  97     // structure for them and #include it here.
  98     int httpProxyEnabled;
  99     char *httpHost;
 100     char *httpPort;
 101 
 102     int httpsProxyEnabled;
 103     char *httpsHost;
 104     char *httpsPort;
 105 
 106     int ftpProxyEnabled;
 107     char *ftpHost;
 108     char *ftpPort;
 109 
 110     int socksProxyEnabled;
 111     char *socksHost;
 112     char *socksPort;
 113 
 114     int gopherProxyEnabled;
 115     char *gopherHost;
 116     char *gopherPort;
 117 
 118     char *exceptionList;
 119 
 120     char *awt_headless;  /* java.awt.headless setting, if NULL (default) will not be set */
 121 #endif
 122 
 123 } java_props_t;
 124 
 125 java_props_t *GetJavaProperties(JNIEnv *env);
 126 jstring GetStringPlatform(JNIEnv *env, nchar* str);
 127 
 128 #endif /* _JAVA_PROPS_H */