jdk/src/share/classes/com/sun/media/sound/Platform.java
author darcy
Mon, 05 May 2014 23:19:00 -0700
changeset 24548 9c007a986347
parent 18215 b2afd66ce6db
child 26030 576ffa819e23
permissions -rw-r--r--
8042256: Fix raw and unchecked lint warnings in com.sun.media.sound Reviewed-by: prr
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
     2
 * Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 1846
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package com.sun.media.sound;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    28
import java.security.AccessController;
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    29
import java.security.PrivilegedAction;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.util.StringTokenizer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * Audio configuration class for exposing attributes specific to the platform or system.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * @author Kara Kytle
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * @author Florian Bomers
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 */
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
    40
final class Platform {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
    // STATIC FINAL CHARACTERISTICS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
    // native library we need to load
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
    private static final String libNameMain     = "jsound";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    private static final String libNameALSA     = "jsoundalsa";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    private static final String libNameDSound   = "jsoundds";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    // extra libs handling: bit flags for each different library
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    public static final int LIB_MAIN     = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    public static final int LIB_ALSA     = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
    public static final int LIB_DSOUND   = 4;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    // bit field of the constants above. Willbe set in loadLibraries
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    private static int loadedLibs = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    // features: the main native library jsound reports which feature is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    // contained in which lib
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
    public static final int FEATURE_MIDIIO       = 1;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
    public static final int FEATURE_PORTS        = 2;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
    public static final int FEATURE_DIRECT_AUDIO = 3;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    // SYSTEM CHARACTERISTICS
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    // vary according to hardware architecture
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    // signed8 (use signed 8-bit values) is true for everything we support except for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    // the solaris sbpro card.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    // we'll leave it here as a variable; in the future we may need this in java.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
    // wait, is that true?  i'm not sure.  i think solaris takes unsigned data?
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    // $$kk: 03.11.99: i think solaris takes unsigned 8-bit or signed 16-bit data....
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
    private static boolean signed8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    // intel is little-endian.  sparc is big-endian.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
    private static boolean bigEndian;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    // this is the value of the "java.home" system property.  i am looking it up here
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    // for use when trying to load the soundbank, just so
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
    // that all the privileged code is localized in this file....
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    private static String javahome;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
    // this is the value of the "java.class.path" system property
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    private static String classpath;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    static {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
        if(Printer.trace)Printer.trace(">> Platform.java: static");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
        loadLibraries();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
        readProperties();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
     * Private constructor.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
    private Platform() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
    // METHODS FOR INTERNAL IMPLEMENTATION USE
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
     * Dummy method for forcing initialization.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    static void initialize() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        if(Printer.trace)Printer.trace("Platform: initialize()");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
     * Determine whether the system is big-endian.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
    static boolean isBigEndian() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        return bigEndian;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
     * Determine whether the system takes signed 8-bit data.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
    static boolean isSigned8() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        return signed8;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * Obtain javahome.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * $$kk: 04.16.99: this is *bad*!!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
    static String getJavahome() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        return javahome;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * Obtain classpath.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     * $$jb: 04.21.99: this is *bad* too!!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
    static String getClasspath() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        return classpath;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    // PRIVATE METHODS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * Load the native library or libraries.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
    private static void loadLibraries() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
        if(Printer.trace)Printer.trace(">>Platform.loadLibraries");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
        try {
1846
4a53d636e2f4 6702956: OpenJDK: replace encumbered code (software synthesizer)
amenkov
parents: 2
diff changeset
   161
            // load the main library
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   162
            AccessController.doPrivileged(new PrivilegedAction<Void>() {
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   163
                @Override
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   164
                public Void run() {
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   165
                    System.loadLibrary(libNameMain);
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   166
                    return null;
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   167
                }
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   168
            });
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
            // just for the heck of it...
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            loadedLibs |= LIB_MAIN;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        } catch (SecurityException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
            if(Printer.err)Printer.err("Security exception loading main native library.  JavaSound requires access to these resources.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
            throw(e);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
        // now try to load extra libs. They are defined at compile time in the Makefile
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        // with the define EXTRA_SOUND_JNI_LIBS
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
        String extraLibs = nGetExtraLibraries();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        // the string is the libraries, separated by white space
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        StringTokenizer st = new StringTokenizer(extraLibs);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        while (st.hasMoreTokens()) {
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   182
            final String lib = st.nextToken();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            try {
18215
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   184
                AccessController.doPrivileged(new PrivilegedAction<Void>() {
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   185
                    @Override
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   186
                    public Void run() {
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   187
                        System.loadLibrary(lib);
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   188
                        return null;
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   189
                    }
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   190
                });
b2afd66ce6db 8006328: Improve robustness of sound classes
serb
parents: 5506
diff changeset
   191
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                if (lib.equals(libNameALSA)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                    loadedLibs |= LIB_ALSA;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
                    if (Printer.debug) Printer.debug("Loaded ALSA lib successfully.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
                } else if (lib.equals(libNameDSound)) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
                    loadedLibs |= LIB_DSOUND;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
                    if (Printer.debug) Printer.debug("Loaded DirectSound lib successfully.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
                } else {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
                    if (Printer.err) Printer.err("Loaded unknown lib '"+lib+"' successfully.");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
            } catch (Throwable t) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
                if (Printer.err) Printer.err("Couldn't load library "+lib+": "+t.toString());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    static boolean isMidiIOEnabled() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
        return isFeatureLibLoaded(FEATURE_MIDIIO);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    static boolean isPortsEnabled() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        return isFeatureLibLoaded(FEATURE_PORTS);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    static boolean isDirectAudioEnabled() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
        return isFeatureLibLoaded(FEATURE_DIRECT_AUDIO);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
    private static boolean isFeatureLibLoaded(int feature) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        if (Printer.debug) Printer.debug("Platform: Checking for feature "+feature+"...");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        int requiredLib = nGetLibraryForFeature(feature);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
        boolean isLoaded = (requiredLib != 0) && ((loadedLibs & requiredLib) == requiredLib);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
        if (Printer.debug) Printer.debug("          ...needs library "+requiredLib+". Result is loaded="+isLoaded);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        return isLoaded;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    // the following native methods are implemented in Platform.c
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    private native static boolean nIsBigEndian();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
    private native static boolean nIsSigned8();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
    private native static String nGetExtraLibraries();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    private native static int nGetLibraryForFeature(int feature);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * Read the required system properties.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
    private static void readProperties() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        // $$fb 2002-03-06: implement check for endianness in native. Facilitates porting !
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        bigEndian = nIsBigEndian();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        signed8 = nIsSigned8(); // Solaris on Sparc: signed, all others unsigned
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        javahome = JSSecurityManager.getProperty("java.home");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        classpath = JSSecurityManager.getProperty("java.class.path");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
}