Changeset 1727 for trunk/lang/java


Ignore:
Timestamp:
May 20, 2010 2:13:17 PM (11 years ago)
Author:
braffert
Message:

Last fix for building java bindings. Also added license info and more comments.

Location:
trunk/lang/java
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/lang/java/Library.java

    r1722 r1727  
     1/*
     2 * ======================================================================
     3 *  AUTHOR:  Ben Rafferty, Purdue University
     4 *  Copyright (c) 2010  Purdue Research Foundation
     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 a Java class that implemements the rappture XML library.
     13 * The class methods call the corresponding native code through c++ glue code
     14 * located in jRpLibrary.cc.
     15 */
     16
    117package rappture;
    218
     
    1127  }
    1228
    13   // Pseudo-Destructor---------------------------------------------------------
     29  // Pseudo-Destructor.  Called when the object is garbage collected.----------
    1430  protected void finalize() throws Throwable {
    1531    try {
     
    5874  private native String jRpGetString(long libPtr, String path);
    5975
    60   private native void jRpPut(long libPtr, String path, String value, boolean append);
     76  private native void jRpPut(long libPtr, String path,
     77                             String value, boolean append);
    6178
    6279  private native void jRpResult(long libPtr, int exitStatus); 
    6380
    6481  // Private Attributes--------------------------------------------------------
    65   private long libPtr;  //pointer to c rpLibrary
     82  private long libPtr;  //pointer to c++ RpLibrary
    6683
    6784}
    6885
    69 
    70 
  • trunk/lang/java/Makefile.in

    r1724 r1727  
    3939RM              = rm -f
    4040
    41 INCLUDES = $(JAVA_INCLUDES) -I $(includedir) -I .
    42 LIBS = -L $(LIB_SEARCH_DIRS) -lrappture
     41INCLUDES = $(JAVA_INCLUDES) -I $(srcdir)/../../src/core -I .
     42LIBS = -L ../../src/core -lrappture
    4343
    44 CXX_O_SWITCHES = -fpic -c $(INCLUDES) $(LIBS)
     44CXX_O_SWITCHES = -fpic -c $(INCLUDES)
    4545
    46 CXX_SO_SWITCHES = --shared $(LIBS)
     46CXX_SO_SWITCHES = --shared $(INCLUDES) $(LIBS)
    4747
    4848OBJS    = \
  • trunk/lang/java/Units.java

    r1722 r1727  
     1/*
     2 * ======================================================================
     3 *  AUTHOR:  Ben Rafferty, Purdue University
     4 *  Copyright (c) 2010  Purdue Research Foundation
     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 a java class that implemements the rappture units module.
     13 * The class methods call the corresponding native code through c++ glue code
     14 * located in jRpUnits.cc.
     15 */
     16
     17
    118package rappture;
    219
  • trunk/lang/java/Utils.java

    r1722 r1727  
     1/*
     2 * ======================================================================
     3 *  AUTHOR:  Ben Rafferty, Purdue University
     4 *  Copyright (c) 2010  Purdue Research Foundation
     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 a java class that implemements the rappture utils module.
     13 * The class methods call the corresponding native code through c++ glue code
     14 * located in jRpUtils.cc.
     15 */
     16
    117package rappture;
    218
  • trunk/lang/java/jRpLibrary.cc

    r1722 r1727  
     1/*
     2 * ======================================================================
     3 *  AUTHOR:  Ben Rafferty, Purdue University
     4 *  Copyright (c) 2010  Purdue Research Foundation
     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 Library
     13 * class methods, and in turn call the corresponding rappture RpLibrary methods.
     14 */
     15
    116#include "jRpLibrary.h"
    217#include "rappture.h"
    318
    4 // constructor
     19/*
     20 * Constructor.  Returns the address of the newly created RpLibrary object to
     21 * java as a long int.
     22 */
    523JNIEXPORT jlong JNICALL Java_rappture_Library_jRpLibrary
    624  (JNIEnv *env, jobject obj, jstring javaPath){
     
    1129}
    1230
    13 // Pseudo-destructor
     31/*
     32 * Pseudo-destructor.  This function is called by the java Library class's
     33 * finalizer.
     34 */
    1435JNIEXPORT void JNICALL Java_rappture_Library_jRpDeleteLibrary
    1536  (JNIEnv *env, jobject obj, jlong libPtr){
  • trunk/lang/java/jRpUnits.cc

    r1722 r1727  
     1/*
     2 * ======================================================================
     3 *  AUTHOR:  Ben Rafferty, Purdue University
     4 *  Copyright (c) 2010  Purdue Research Foundation
     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 Units
     13 * class methods, and in turn call the corresponding rappture RpUnits methods.
     14 */
     15
    116#include "jRpUnits.h"
    217#include "rappture.h"
    318
     19// convert
    420JNIEXPORT jstring JNICALL Java_rappture_Units_jRpUnitsConvert
    521  (JNIEnv *env, jclass cls, jstring javaFromVal, jstring javaTo, jboolean units){
  • trunk/lang/java/jRpUtils.cc

    r1722 r1727  
     1/*
     2 * ======================================================================
     3 *  AUTHOR:  Ben Rafferty, Purdue University
     4 *  Copyright (c) 2010  Purdue Research Foundation
     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
    116#include "jRpUtils.h"
    217#include "rappture.h"
    318
     19// progress
    420JNIEXPORT void JNICALL Java_rappture_Utils_jRpUtilsProgress
    521  (JNIEnv *env, jclass cls, jint percent, jstring javaText){
    6   const char* nativeText = env->GetStringUTFChars(javaText, 0);
     22          const char* nativeText = env->GetStringUTFChars(javaText, 0);
    723  Rappture::Utils::progress(percent, nativeText);
    824  env->ReleaseStringUTFChars(javaText, nativeText);
Note: See TracChangeset for help on using the changeset viewer.