Main Page | Namespace List | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

sampleJNImain.c File Reference


Detailed Description

Sample program to call JNI functions from a shared object.

This code will generate external references to JNI 'C' function entry point versions of Java JNI native methods. These, in turn, are designed to be stored into a shared object. They reference JNI 'C' function entry point versions of Java JNI local native methods (because of the fact that they are java.lang.* classes). For anything besides java.lang.*, these references would be to regular JNI 'C' or 'C++' or Fortran or assembly or COBOL (gulp) or whatever kind of library code is appropriate.

The point with this sample main() program is to create a sample program fragment that shows where the JNI shared object fits into the overall scheme of things. The functions they reference demonstrate how to reference JNI local native methods in the core JVM code.

Control

$URL: https://svn.apache.org/path/name/sampleJNImain.c $ $Id: sampleJNImain.c 0 09/28/2005 dlydick $

Copyright 2005 The Apache Software Foundation or its licensors, as applicable.

Licensed under the Apache License, Version 2.0 ("the License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.

See the License for the specific language governing permissions and limitations under the License.

Version:
$LastChangedRevision: 0 $
Date:
$LastChangedDate: 09/28/2005 $
Author:
$LastChangedBy: dlydick $ Original code contributed by Daniel Lydick on 09/28/2005.

Reference

Definition in file sampleJNImain.c.

#include <stdlib.h>
#include <jni.h>
#include "java_lang_Object.h"
#include "java_lang_Class.h"
#include "java_lang_String.h"
#include "java_lang_Thread.h"

Go to the source code of this file.

Functions

int main (int argc, char **argv, char **envp)

Variables

jboolean boolean_value = JNI_FALSE
jclass clsidx_null = 0
JNIEnv env
jlong long_int = 0
jobject objhash_null = 0
jint regular_int = 0


Function Documentation

int main int  argc,
char **  argv,
char **  envp
 

Definition at line 71 of file sampleJNImain.c.

References boolean_value, clsidx_null, env, Java_java_lang_Class_isArray(), Java_java_lang_Class_isPrimitive(), Java_java_lang_Class_registerNatives(), Java_java_lang_Class_unregisterNatives(), Java_java_lang_Object_hashCode(), Java_java_lang_Object_registerNatives(), Java_java_lang_Object_unregisterNatives(), Java_java_lang_Object_wait(), Java_java_lang_Object_wait__J(), Java_java_lang_String_intern(), Java_java_lang_String_registerNatives(), Java_java_lang_String_unregisterNatives(), Java_java_lang_Thread_checkAccess(), Java_java_lang_Thread_countStackFrames(), Java_java_lang_Thread_currentThread(), Java_java_lang_Thread_destroy(), Java_java_lang_Thread_getPriority(), Java_java_lang_Thread_holdsLock(), Java_java_lang_Thread_interrupt(), Java_java_lang_Thread_interrupted(), Java_java_lang_Thread_isAlive(), Java_java_lang_Thread_isDaemon(), Java_java_lang_Thread_isInterrupted(), Java_java_lang_Thread_join(), Java_java_lang_Thread_join__J(), Java_java_lang_Thread_join__JI(), Java_java_lang_Thread_registerNatives(), Java_java_lang_Thread_resume(), Java_java_lang_Thread_setDaemon(), Java_java_lang_Thread_setPriority(), Java_java_lang_Thread_sleep__J(), Java_java_lang_Thread_sleep__JI(), Java_java_lang_Thread_start(), Java_java_lang_Thread_stop(), Java_java_lang_Thread_suspend(), Java_java_lang_Thread_unregisterNatives(), Java_java_lang_Thread_yield(), long_int, objhash_null, and regular_int.


Variable Documentation

JNIEnv env
 

Definition at line 63 of file sampleJNImain.c.

Referenced by main().

jclass clsidx_null = 0
 

Definition at line 65 of file sampleJNImain.c.

Referenced by main().

jobject objhash_null = 0
 

Definition at line 66 of file sampleJNImain.c.

Referenced by main().

jlong long_int = 0
 

Definition at line 67 of file sampleJNImain.c.

Referenced by main().

jint regular_int = 0
 

Definition at line 68 of file sampleJNImain.c.

Referenced by main().

jboolean boolean_value = JNI_FALSE
 

Definition at line 69 of file sampleJNImain.c.

Referenced by main().


Generated on Fri Sep 30 18:49:18 2005 by  doxygen 1.4.4