jdk/src/java.security.jgss/share/native/libj2gss/NativeUtil.c
changeset 33653 c1ee09fe3274
parent 25859 3317bb8137f4
equal deleted inserted replaced
32995:a62c89adce3d 33653:c1ee09fe3274
     1 /*
     1 /*
     2  * Copyright (c) 2005, 2014, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2005, 2015, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    25 
    25 
    26 #include "NativeUtil.h"
    26 #include "NativeUtil.h"
    27 #include "NativeFunc.h"
    27 #include "NativeFunc.h"
    28 #include "jlong.h"
    28 #include "jlong.h"
    29 #include <jni.h>
    29 #include <jni.h>
       
    30 #include "jni_util.h"
    30 
    31 
    31 const int JAVA_DUPLICATE_TOKEN_CODE = 19; /* DUPLICATE_TOKEN */
    32 const int JAVA_DUPLICATE_TOKEN_CODE = 19; /* DUPLICATE_TOKEN */
    32 const int JAVA_OLD_TOKEN_CODE = 20; /* OLD_TOKEN */
    33 const int JAVA_OLD_TOKEN_CODE = 20; /* OLD_TOKEN */
    33 const int JAVA_UNSEQ_TOKEN_CODE = 21; /* UNSEQ_TOKEN */
    34 const int JAVA_UNSEQ_TOKEN_CODE = 21; /* UNSEQ_TOKEN */
    34 const int JAVA_GAP_TOKEN_CODE = 22; /* GAP_TOKEN */
    35 const int JAVA_GAP_TOKEN_CODE = 22; /* GAP_TOKEN */
    92 jfieldID FID_NativeGSSContext_actualMech;
    93 jfieldID FID_NativeGSSContext_actualMech;
    93 
    94 
    94 int JGSS_DEBUG;
    95 int JGSS_DEBUG;
    95 
    96 
    96 JNIEXPORT jint JNICALL
    97 JNIEXPORT jint JNICALL
    97 JNI_OnLoad(JavaVM *jvm, void *reserved) {
    98 DEF_JNI_OnLoad(JavaVM *jvm, void *reserved) {
    98   JNIEnv *env;
    99   JNIEnv *env;
    99   jclass cls;
   100   jclass cls;
   100 
   101 
   101   if ((*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_2)) {
   102   if ((*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_2)) {
   102     return JNI_EVERSION; /* JNI version not supported */
   103     return JNI_EVERSION; /* JNI version not supported */
   361   }
   362   }
   362   return JNI_VERSION_1_2;
   363   return JNI_VERSION_1_2;
   363 }
   364 }
   364 
   365 
   365 JNIEXPORT void JNICALL
   366 JNIEXPORT void JNICALL
   366 JNI_OnUnload(JavaVM *jvm, void *reserved) {
   367 DEF_JNI_OnUnload(JavaVM *jvm, void *reserved) {
   367   JNIEnv *env;
   368   JNIEnv *env;
   368 
   369 
   369   if ((*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_2)) {
   370   if ((*jvm)->GetEnv(jvm, (void **)&env, JNI_VERSION_1_2)) {
   370     return;
   371     return;
   371   }
   372   }