Commit 20212c5f authored by brinn's avatar brinn
Browse files

Migrate JHDF5 to HDF5 1.10.

A big 'thank you' goes to Gerd Heber from the HDF Group for doing a lot of the porting work to 1.10.
parent eb715b2c
/****************************************************************************
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF Java Products. The full HDF Java copyright *
* notice, including terms governing use, modification, and redistribution, *
* is contained in the file, COPYING. COPYING can be found at the root of *
* the source code distribution tree. You can also access it online at *
* http://www.hdfgroup.org/products/licenses.html. If you do not have *
* access to the file, you may request a copy from help@hdfgroup.org. *
****************************************************************************/
#ifdef __cplusplus
extern "C" {
#endif
/*
* This code is the C-interface called by Java programs to access the
* general library functions of the HDF5 library.
*
* Each routine wraps a single HDF entry point, generally with the
* analogous arguments and return codes.
*
* For details of the HDF libraries, see the HDF Documentation at:
* http://hdf.ncsa.uiuc.edu/HDF5/doc/
*
*/
#include "hdf5.h"
#include <jni.h>
#include "h5jni.h"
/*
#include <signal.h>
*/
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5open
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5open
(JNIEnv *env, jclass clss)
{
herr_t retVal = -1;
retVal = H5open();
if (retVal < 0) {
h5libraryError(env);
}
return (jint)retVal;
}
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5close
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5close
(JNIEnv *env, jclass clss)
{
herr_t retVal = -1;
retVal = H5close();
if (retVal < 0) {
h5libraryError(env);
}
return (jint)retVal;
}
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5dont_atexit
* Signature: ()I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5dont_1atexit
(JNIEnv *env, jclass clss)
{
int retVal = H5dont_atexit();
if (retVal < 0) {
h5libraryError(env);
}
return retVal;
}
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5get_libversion
* Signature: ([I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5get_1libversion
(JNIEnv *env, jclass clss, jintArray libversion)
{
unsigned *theArray = NULL;
jboolean isCopy;
int status;
if (libversion == NULL) {
h5nullArgument( env, "H5get_version: libversion is NULL");
return -1;
}
theArray = (unsigned *)ENVPTR->GetIntArrayElements(ENVPAR libversion,&isCopy);
if (theArray == NULL) {
h5JNIFatalError( env, "H5get_libversion: input not pinned");
return -1;
}
status = H5get_libversion(&(theArray[0]), &(theArray[1]), &(theArray[2]));
if (status < 0) {
ENVPTR->ReleaseIntArrayElements(ENVPAR libversion,(jint *)theArray,JNI_ABORT);
h5libraryError(env);
}
else {
ENVPTR->ReleaseIntArrayElements(ENVPAR libversion,(jint *)theArray,0);
}
return (jint)status;
}
#ifdef notdef
/*
struct sigaction {
int sa_flags;
void (*sa_handler)();
sigset_t sa_mask;
void (*sa_sigaction)(int, siginfo_t *, void *);
};
int sigaction(int sig, struct sigaction *act, struct sigaction *oact);
*/
void catch_abrt()
{
/* Raise Java exception */
printf("raise exception....\n");
}
#endif
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5check_version
* Signature: (III)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5check_1version
(JNIEnv *env, jclass clss, jint majnum, jint minnum, jint relnum)
{
int status;
/*
* In principle, we want to catch the 'abort' signal, and
* do something other than crash.
* Look up how to do this portably.
*/
/*
int res;
struct sigaction ctchit;
struct sigaction old;
ctchit.sa_handler = catch_abrt;
*/
/*
res = sigaction(SIGABRT, &ctchit, &old);
if (res != 0) {
printf("sigaction failed\n");
return(-1);
}
*/
/* catch the signal? */
status = H5check_version((unsigned)majnum, (unsigned)minnum, (unsigned)relnum);
/*
res = sigaction(SIGABRT, &old, 0);
if (res != 0) {
printf("sigaction failed\n");
return(-1);
}
*/
return status;
}
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5garbage_collect
* Signature: ()I
*
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5garbage_1collect
(JNIEnv *env, jclass clss)
{
herr_t retVal = -1;
retVal = H5garbage_collect();
if (retVal < 0) {
h5libraryError(env);
}
return (jint)retVal;
}
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5set_free_list_limits
* Signature: (IIIIII)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5set_1free_1list_1limits
(JNIEnv *env, jclass clss, jint reg_global_lim, jint reg_list_lim,
jint arr_global_lim, jint arr_list_lim, jint blk_global_lim, jint blk_list_lim )
{
int retVal = H5set_free_list_limits((int)reg_global_lim, (int)reg_list_lim,
(int)arr_global_lim, (int)arr_list_lim, (int)blk_global_lim, (int)blk_list_lim);
if (retVal < 0) {
h5libraryError(env);
}
return retVal;
}
#ifdef __cplusplus
}
#endif
This diff is collapsed.
This diff is collapsed.
/* DO NOT EDIT THIS FILE - it is machine generated */
#include <jni.h>
/* Header for class ncsa_hdf_hdf5lib_H5_H5D */
#ifndef _Included_ncsa_hdf_hdf5lib_H5_H5D
#define _Included_ncsa_hdf_hdf5lib_H5_H5D
#ifdef __cplusplus
extern "C" {
#endif
extern JavaVM *jvm;
extern jobject visit_callback;
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dcreate
* Signature: (ILjava/lang/String;III)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dcreate
(JNIEnv*, jclass, jint, jstring, jint, jint, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dchdir_ext
* Signature: (Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dchdir_1ext
(JNIEnv*, jclass, jstring);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dgetdir_1ext
* Signature: ([Ljava/lang/String;I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dgetdir_1ext
(JNIEnv*, jclass, jobjectArray, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dopen
* Signature: (ILjava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dopen
(JNIEnv*, jclass, jint, jstring);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dget_space
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dget_1space
(JNIEnv*, jclass, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dget_type
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dget_1type
(JNIEnv*, jclass, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dget_create_plist
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dget_1create_1plist
(JNIEnv*, jclass, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dread
* Signature: (IIIII[BZ)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dread
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jbyteArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dwrite
* Signature: (IIIII[BZ)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dwrite
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jbyteArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dextend
* Signature: (I[B)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dextend
(JNIEnv*, jclass, jint, jbyteArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dclose
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dclose
(JNIEnv*, jclass, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dget_storage_size
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dget_1storage_1size
(JNIEnv*, jclass, jint);
/*
* Copies the content of one dataset to another dataset
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dcopy
* Signature: (II)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dcopy
(JNIEnv*, jclass, jint, jint);
/*
* Copies the content of one dataset to another dataset
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dvlen_get_buf_size
* Signature: (III[I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dvlen_1get_1buf_1size
(JNIEnv*, jclass, jint, jint, jint, jintArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dvlen_reclaim
* Signature: (III[B)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dvlen_1reclaim
(JNIEnv*, jclass, jint, jint, jint, jbyteArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dget_space_status
* Signature: (I[I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dget_1space_1status
(JNIEnv*, jclass, jint, jintArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dread_short
* Signature: (IIIII[S[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dread_1short
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jshortArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dread_int
* Signature: (IIIII[I[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dread_1int
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jintArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dread_long
* Signature: (IIIII[J[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dread_1long
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jlongArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dread_float
* Signature: (IIIII[F[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dread_1float
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jfloatArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dread_double
* Signature: (IIIII[D[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dread_1double
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jdoubleArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dread_string
* Signature: (IIIII[Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dread_1string
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jobjectArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dwrite_short
* Signature: (IIIII[S[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dwrite_1short
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jshortArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dwrite_int
* Signature: (IIIII[I[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dwrite_1int
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jintArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dwrite_long
* Signature: (IIIII[J[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dwrite_1long
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jlongArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dwrite_float
* Signature: (IIIII[F[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dwrite_1float
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jfloatArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dwrite_double
* Signature: (IIIII[D[Z)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dwrite_1double
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jdoubleArray, jboolean);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5DwriteString
* Signature: (IIIII[Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5DwriteString
(JNIEnv *, jclass, jint, jint, jint, jint, jint, jobjectArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5DreadVL
* Signature: (IIIII[Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5DreadVL
(JNIEnv*, jclass, jint, jint, jint, jint, jint, jobjectArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dread_reg_ref
* Signature: (IIIII[Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dread_1reg_1ref (JNIEnv*, jclass,
jint, jint, jint, jint, jint, jobjectArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dread_reg_ref_data
* Signature: (IIIII[Ljava/lang/String;)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dread_1reg_1ref_1data (JNIEnv*, jclass,
jint, jint, jint, jint, jint, jobjectArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dcreate2
* Signature: (ILjava/lang/String;IIIII)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dcreate2
(JNIEnv *, jclass, jint, jstring, jint, jint, jint, jint, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dopen2
* Signature: (ILjava/lang/String;I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dopen2
(JNIEnv *, jclass, jint, jstring, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: _H5Dcreate_anon
* Signature: (IIIII)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5__1H5Dcreate_1anon
(JNIEnv *, jclass, jint, jint, jint, jint, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dget_space_status
* Signature: (I)I;
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dget_1space_1status
(JNIEnv *, jclass, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dget_access_plist
* Signature: (I)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dget_1access_1plist
(JNIEnv *, jclass, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dget_offset
* Signature: (I)J
*/
JNIEXPORT jlong JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dget_1offset
(JNIEnv *, jclass, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dvlen_get_buf_size_long
* Signature: (III)J
*/
JNIEXPORT jlong JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dvlen_1get_1buf_1size_1long
(JNIEnv *, jclass, jint, jint, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dfill
* Signature: ([BI[BII)V
*/
JNIEXPORT void JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dfill
(JNIEnv *, jclass, jbyteArray, jint, jbyteArray, jint, jint);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Dset_extent
* Signature: (I[J)V
*/
JNIEXPORT void JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Dset_1extent
(JNIEnv *, jclass, jint, jlongArray);
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Diterate
* Signature: ([BIILjava/lang/Object;Ljava/lang/Object;)I
*/
JNIEXPORT jint JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Diterate
(JNIEnv *, jclass, jbyteArray, jint, jint, jobject, jobject);
#ifdef __cplusplus
}
#endif
#endif
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* Copyright by The HDF Group. *
* Copyright by the Board of Trustees of the University of Illinois. *
* All rights reserved. *
* *
* This file is part of HDF Java Products. The full HDF Java copyright *
* notice, including terms governing use, modification, and redistribution, *
* is contained in the file, COPYING. COPYING can be found at the root of *
* the source code distribution tree. You can also access it online at *
* http://www.hdfgroup.org/products/licenses.html. If you do not have *
* access to the file, you may request a copy from help@hdfgroup.org. *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
#ifdef __cplusplus
extern "C" {
#endif
/*
* This code is the C-interface called by Java programs to access the
* general library functions of the HDF5 library.
*
* Each routine wraps a single HDF entry point, generally with the
* analogous arguments and return codes.
*
* For details of the HDF libraries, see the HDF Documentation at:
* http://www.hdfgroup.org/HDF5/doc/
*
*/
#include <jni.h>
#include <stdlib.h>
#include "hdf5.h"
#include "h5jni.h"
#include "h5eImp.h"
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Eauto_is_v2
* Signature: (I)Z
*/
JNIEXPORT jboolean JNICALL Java_ncsa_hdf_hdf5lib_H5_H5Eauto_1is_1v2
(JNIEnv *env, jclass cls, jint stk_id)
{
herr_t ret_val = -1;
unsigned int is_stack = 0;
if (stk_id < 0) {
h5badArgument(env, "H5Eauto_is_v2: invalid argument");
return 0;
}
ret_val = H5Eauto_is_v2(stk_id, &is_stack);
if (ret_val < 0) {
h5libraryError(env);
return 0;
}
return is_stack;
}
/*
* Class: ncsa_hdf_hdf5lib_H5
* Method: H5Eregister_class
* Signature: (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)I