OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [testsuite/] [libjava.jni/] [register.c] - Blame information for rev 781

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 765 jeremybenn
#include <stdlib.h>
2
#include <assert.h>
3
#include <register.h>
4
 
5
static jint
6
some_random_name (JNIEnv *env, jclass k, jint v)
7
{
8
  return v - 1;
9
}
10
 
11
JNIEXPORT jint JNICALL
12
JNI_OnLoad (JavaVM *vm, void *nothing)
13
{
14
  JNIEnv *env;
15
  JNINativeMethod meth;
16
  jclass k;
17
  jint r;
18
 
19
  r = (*vm)->GetEnv (vm, (void **) &env, JNI_VERSION_1_2);
20
  assert (r == JNI_OK);
21
  k = (*env)->FindClass (env, "register");
22
  assert (k != NULL);
23
 
24
  meth.name = "doit";
25
  meth.signature = "(I)I";
26
  meth.fnPtr = some_random_name;
27
 
28
  r = (*env)->RegisterNatives (env, k, &meth, 1);
29
  assert (r == JNI_OK);
30
 
31
  return JNI_VERSION_1_2;
32
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.