Last change
on this file since 4861 was
3177,
checked in by mmc, 12 years ago
|
Updated all of the copyright notices to reference the transfer to
the new HUBzero Foundation, LLC.
|
File size:
1.1 KB
|
Rev | Line | |
---|
[1727] | 1 | /* |
---|
| 2 | * ====================================================================== |
---|
| 3 | * AUTHOR: Ben Rafferty, Purdue University |
---|
[3177] | 4 | * Copyright (c) 2004-2012 HUBzero Foundation, LLC |
---|
[1727] | 5 | * |
---|
| 6 | * See the file "license.terms" for information on usage and |
---|
| 7 | * redistribution of this file, and for a DISCLAIMER OF ALL WARRANTIES. |
---|
| 8 | * ====================================================================== |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | /* |
---|
| 12 | * This file defines the native functions which are called by the java Utils |
---|
| 13 | * class methods, and in turn call the corresponding rappture RpUtils methods. |
---|
| 14 | */ |
---|
| 15 | |
---|
[1722] | 16 | #include "jRpUtils.h" |
---|
| 17 | #include "rappture.h" |
---|
| 18 | |
---|
[1727] | 19 | // progress |
---|
[1722] | 20 | JNIEXPORT void JNICALL Java_rappture_Utils_jRpUtilsProgress |
---|
| 21 | (JNIEnv *env, jclass cls, jint percent, jstring javaText){ |
---|
[1753] | 22 | const char* nativeText = env->GetStringUTFChars(javaText, 0); |
---|
| 23 | int err = Rappture::Utils::progress(percent, nativeText); |
---|
| 24 | jclass ex; |
---|
| 25 | if (err){ |
---|
| 26 | ex = env->FindClass("java/lang/RuntimeException"); |
---|
| 27 | if (ex){ |
---|
| 28 | env->ThrowNew(ex, "rappture.Utils.progress failed."); |
---|
| 29 | } |
---|
| 30 | env->DeleteLocalRef(ex); |
---|
| 31 | } |
---|
[1722] | 32 | env->ReleaseStringUTFChars(javaText, nativeText); |
---|
| 33 | return; |
---|
| 34 | } |
---|
| 35 | |
---|
Note: See
TracBrowser
for help on using the repository browser.