source: trunk/lang/java/jRpUtils.cc @ 5673

Last change on this file since 5673 was 5673, checked in by ldelgass, 9 years ago

Fix line endings, set eol-style to native on all C/C++ sources.

  • Property svn:eol-style set to native
File size: 1.1 KB
RevLine 
[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]20JNIEXPORT 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.