summaryrefslogtreecommitdiffstats
path: root/java/src/jni/h5pStrCPLImp.c
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2019-02-11 17:07:01 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2019-02-11 17:07:01 (GMT)
commita3a90e79afda2351f16181ec3592b96caceffbe1 (patch)
tree01ff3ca929838ede9e5eba30dfcc3881f2e9523f /java/src/jni/h5pStrCPLImp.c
parent4300ca623482508d19caf427fdadce86f811e347 (diff)
parentcc6a61215e508d047ed6aa2daf67475cfe34ee4d (diff)
downloadhdf5-a3a90e79afda2351f16181ec3592b96caceffbe1.zip
hdf5-a3a90e79afda2351f16181ec3592b96caceffbe1.tar.gz
hdf5-a3a90e79afda2351f16181ec3592b96caceffbe1.tar.bz2
Merge pull request #1532 in HDFFV/hdf5 from ~JHENDERSON/hdf5_merge:develop to develop
* commit 'cc6a61215e508d047ed6aa2daf67475cfe34ee4d': Re-write of Java JNI error handling
Diffstat (limited to 'java/src/jni/h5pStrCPLImp.c')
-rw-r--r--java/src/jni/h5pStrCPLImp.c74
1 files changed, 74 insertions, 0 deletions
diff --git a/java/src/jni/h5pStrCPLImp.c b/java/src/jni/h5pStrCPLImp.c
new file mode 100644
index 0000000..e69847d
--- /dev/null
+++ b/java/src/jni/h5pStrCPLImp.c
@@ -0,0 +1,74 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the COPYING file, which can be found at the root of the source code *
+ * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
+ * If you do not have access to either file, you may request a copy from *
+ * help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/*
+ * For details of the HDF libraries, see the HDF Documentation at:
+ * http://hdfgroup.org/HDF5/doc/
+ *
+ */
+
+#ifdef __cplusplus
+extern "C" {
+#endif /* __cplusplus */
+
+#include <stdlib.h>
+#include "hdf5.h"
+#include "h5jni.h"
+#include "h5pStrCPLImp.h"
+
+/*
+ * Pointer to the JNI's Virtual Machine; used for callback functions.
+ */
+/* extern JavaVM *jvm; */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pset_char_encoding
+ * Signature: (JI)V
+ */
+JNIEXPORT void JNICALL
+Java_hdf_hdf5lib_H5_H5Pset_1char_1encoding
+ (JNIEnv *env, jclass clss, jlong acpl, jint encoding)
+{
+ UNUSED(clss);
+
+ if (H5Pset_char_encoding((hid_t)acpl, (H5T_cset_t)encoding) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return;
+} /* end Java_hdf_hdf5lib_H5_H5Pset_1char_1encoding */
+
+/*
+ * Class: hdf_hdf5lib_H5
+ * Method: H5Pget_char_encoding
+ * Signature: (J)I
+ */
+JNIEXPORT jint JNICALL
+Java_hdf_hdf5lib_H5_H5Pget_1char_1encoding
+ (JNIEnv *env, jclass clss, jlong acpl)
+{
+ H5T_cset_t encoding = H5T_CSET_ERROR;
+
+ UNUSED(clss);
+
+ if (H5Pget_char_encoding((hid_t)acpl, &encoding) < 0)
+ H5_LIBRARY_ERROR(ENVONLY);
+
+done:
+ return encoding;
+} /* end Java_hdf_hdf5lib_H5_H5Pget_1char_1encoding */
+
+#ifdef __cplusplus
+} /* end extern "C" */
+#endif /* __cplusplus */