src/java.desktop/share/native/libjsound/Platform.c

Print this page


   1 /*
   2  * Copyright (c) 2002, 2012, 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 
  27 #include "Utilities.h"
  28 // Platform.java includes
  29 #include "com_sun_media_sound_Platform.h"
  30 
  31 
  32 /*
  33  * Class:     com_sun_media_sound_Platform
  34  * Method:    nIsBigEndian
  35  * Signature: ()Z
  36  */
  37 JNIEXPORT jboolean JNICALL Java_com_sun_media_sound_Platform_nIsBigEndian(JNIEnv *env, jclass clss) {
  38     return UTIL_IsBigEndianPlatform();
  39 }
  40 
  41 /*
  42  * Class:     com_sun_media_sound_Platform
  43  * Method:    nIsSigned8
  44  * Signature: ()Z
  45  */
  46 JNIEXPORT jboolean JNICALL Java_com_sun_media_sound_Platform_nIsSigned8(JNIEnv *env, jclass clss) {
  47 #if ((X_ARCH == X_SPARC) || (X_ARCH == X_SPARCV9))
  48     return 1;
  49 #else
  50     return 0;
  51 #endif
  52 }
  53 
  54 /*
  55  * Class:     com_sun_media_sound_Platform
  56  * Method:    nGetExtraLibraries
  57  * Signature: ()Ljava/lang/String;
  58  */
  59 JNIEXPORT jstring JNICALL Java_com_sun_media_sound_Platform_nGetExtraLibraries(JNIEnv *env, jclass clss) {
  60     return (*env)->NewStringUTF(env, EXTRA_SOUND_JNI_LIBS);
  61 }
  62 
  63 /*
  64  * Class:     com_sun_media_sound_Platform
  65  * Method:    nGetLibraryForFeature
  66  * Signature: (I)I
  67  */
  68 JNIEXPORT jint JNICALL Java_com_sun_media_sound_Platform_nGetLibraryForFeature
  69   (JNIEnv *env, jclass clazz, jint feature) {
  70 
  71 // for every OS


   1 /*
   2  * Copyright (c) 2002, 2015, 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 
  27 #include "Utilities.h"
  28 // Platform.java includes
  29 #include "com_sun_media_sound_Platform.h"
  30 
  31 
  32 /*
  33  * Class:     com_sun_media_sound_Platform
  34  * Method:    nIsBigEndian
  35  * Signature: ()Z
  36  */
  37 JNIEXPORT jboolean JNICALL Java_com_sun_media_sound_Platform_nIsBigEndian(JNIEnv *env, jclass clss) {
  38     return UTIL_IsBigEndianPlatform();













  39 }
  40 
  41 /*
  42  * Class:     com_sun_media_sound_Platform
  43  * Method:    nGetExtraLibraries
  44  * Signature: ()Ljava/lang/String;
  45  */
  46 JNIEXPORT jstring JNICALL Java_com_sun_media_sound_Platform_nGetExtraLibraries(JNIEnv *env, jclass clss) {
  47     return (*env)->NewStringUTF(env, EXTRA_SOUND_JNI_LIBS);
  48 }
  49 
  50 /*
  51  * Class:     com_sun_media_sound_Platform
  52  * Method:    nGetLibraryForFeature
  53  * Signature: (I)I
  54  */
  55 JNIEXPORT jint JNICALL Java_com_sun_media_sound_Platform_nGetLibraryForFeature
  56   (JNIEnv *env, jclass clazz, jint feature) {
  57 
  58 // for every OS