コード例 #1
0
ファイル: h5oImp.c プロジェクト: soumagne/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Ocopy
 * Signature: (JLjava/lang/String;JLjava/lang/String;JJ)V
 */
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Ocopy
    (JNIEnv *env, jclass clss, jlong cur_loc_id, jstring cur_name,
        jlong dst_loc_id, jstring dst_name, jlong create_id, jlong access_id)
{
    const char *lCurName = NULL;
    const char *lDstName = NULL;
    herr_t      status = FAIL;

    UNUSED(clss);

    if (NULL == cur_name)
        H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ocopy: src name is NULL");
    if (NULL == dst_name)
        H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ocopy: dst name is NULL");

    PIN_JAVA_STRING(ENVONLY, cur_name, lCurName, NULL, "H5Ocopy: src name not pinned");
    PIN_JAVA_STRING(ENVONLY, dst_name, lDstName, NULL, "H5Ocopy: dest name not pinned");

    if ((status = H5Ocopy((hid_t)cur_loc_id, lCurName, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id)) < 0)
        H5_LIBRARY_ERROR(ENVONLY);

done:
    if (lDstName)
        UNPIN_JAVA_STRING(ENVONLY, dst_name, lDstName);
    if (lCurName)
        UNPIN_JAVA_STRING(ENVONLY, cur_name, lCurName);
} /* end Java_hdf_hdf5lib_H5_H5Ocopy */
コード例 #2
0
ファイル: h5oImp.c プロジェクト: soumagne/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Oset_comment_by_name
 * Signature: (JLjava/lang/String;Ljava/lang/String;J)V
 */
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Oset_1comment_1by_1name
    (JNIEnv *env, jclass clss, jlong loc_id,
        jstring name, jstring comment, jlong access_id)
{
    const char *objName = NULL;
    const char *objComment = NULL;
    jboolean    isCopy;
    herr_t      status = FAIL;

    UNUSED(clss);

    if (NULL == name)
        H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Oset_comment_by_name: object name is NULL");

    PIN_JAVA_STRING(ENVONLY, name, objName, NULL, "H5Oset_comment_by_name: object name not pinned");

    if (NULL != comment)
        PIN_JAVA_STRING(ENVONLY, comment, objComment, &isCopy, "H5Oset_comment_by_name: object comment not pinned");

    if ((status = H5Oset_comment_by_name((hid_t)loc_id, objName, objComment, (hid_t)access_id)) < 0)
        H5_LIBRARY_ERROR(ENVONLY);

done:
    if (objComment)
        UNPIN_JAVA_STRING(ENVONLY, comment, objComment);
    if (objName)
        UNPIN_JAVA_STRING(ENVONLY, name, objName);
} /* end Java_hdf_hdf5lib_H5_H5Oset_1comment_1by_1name */
コード例 #3
0
ファイル: h5aImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Aget_name_by_idx
 * Signature: (JLjava/lang/String;IIJJ)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Aget_1name_1by_1idx
    (JNIEnv *env, jclass clss, jlong loc_id, jstring obj_name, jint idx_type, jint order, jlong n, jlong lapl_id)
{
    size_t   buf_size;
    char    *aValue;
    jlong    status_size;
    jstring  str = NULL;
    const char *aName;

    PIN_JAVA_STRING(obj_name, aName);
    if (aName != NULL) {
        /* get the length of the attribute name */
        status_size = H5Aget_name_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
                (H5_iter_order_t) order, (hsize_t) n, (char*)NULL, (size_t)0, (hid_t)lapl_id);

        if(status_size < 0) {
            UNPIN_JAVA_STRING(obj_name, aName);
            h5libraryError(env);
        } /* end if */
        else {
            buf_size = (size_t)status_size + 1;/* add extra space for the null terminator */

            aValue = (char*)HDmalloc(sizeof(char) * buf_size);
            if (aValue == NULL) {
                UNPIN_JAVA_STRING(obj_name, aName);
                h5outOfMemory(env, "H5Aget_name_by_idx:  malloc failed ");
            } /* end if */
            else {
                status_size = H5Aget_name_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
                        (H5_iter_order_t) order, (hsize_t) n, (char*)aValue, (size_t)buf_size, (hid_t)lapl_id);

                UNPIN_JAVA_STRING(obj_name, aName);

                if (status_size < 0) {
                    HDfree(aValue);
                    h5libraryError(env);
                } /* end if */
                else {
                    str = ENVPTR->NewStringUTF(ENVPAR aValue);
                    HDfree(aValue);
                    if (str == NULL) {
                        /* exception -- fatal JNI error */
                        h5JNIFatalError(env, "H5Aget_name_by_idx:  return string not created");
                    } /* end if */
                } /* end else */
            } /* end else */
        } /* end else */
    }
    return str;
} /* end Java_hdf_hdf5lib_H5_H5Aget_1name_1by_1idx */
コード例 #4
0
ファイル: h5aImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Aget_info_by_idx
 * Signature: (JLjava/lang/String;IIJJ)Lhdf/hdf5lib/structs/H5A_info_t;
 */
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Aget_1info_1by_1idx
    (JNIEnv *env, jclass clss, jlong loc_id, jstring obj_name, jint idx_type, jint order, jlong n, jlong lapl_id)
{
    herr_t      status;
    H5A_info_t  ainfo;
    jvalue      args[4];
    jobject     ret_obj = NULL;
    const char *aName;

    PIN_JAVA_STRING(obj_name, aName);
    if (aName != NULL) {
        status = H5Aget_info_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type,
                (H5_iter_order_t)order, (hsize_t)n, &ainfo, (hid_t)lapl_id);

        UNPIN_JAVA_STRING(obj_name, aName);

        if (status < 0) {
        h5libraryError(env);
        } /* end if */
        else {
            args[0].z = ainfo.corder_valid;
            args[1].j = ainfo.corder;
            args[2].i = ainfo.cset;
            args[3].j = (jlong)ainfo.data_size;
            CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5A_info_t", "(ZJIJ)V", args);
        } /* end else */
    }
    return ret_obj;
} /* end Java_hdf_hdf5lib_H5_H5Aget_1info_1by_1idx */
コード例 #5
0
ファイル: h5oImp.c プロジェクト: soumagne/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Oexists_by_name
 * Signature: (JLjava/lang/String;J)Z
 */
JNIEXPORT jboolean JNICALL
Java_hdf_hdf5lib_H5_H5Oexists_1by_1name
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_id)
{
    const char *objName = NULL;
    htri_t      bval = JNI_FALSE;

    UNUSED(clss);

    if (NULL == name)
        H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Oexists_by_name: object name is NULL");

    PIN_JAVA_STRING(ENVONLY, name, objName, NULL, "H5Oexists_by_name: object name not pinned");

    if ((bval = H5Oexists_by_name((hid_t)loc_id, objName, (hid_t)access_id)) < 0)
        H5_LIBRARY_ERROR(ENVONLY);

    bval = (bval > 0) ? JNI_TRUE : JNI_FALSE;

done:
    if (objName)
        UNPIN_JAVA_STRING(ENVONLY, name, objName);

    return (jboolean)bval;
} /* end Java_hdf_hdf5lib_H5_H5Oexists_1by_1name */
コード例 #6
0
ファイル: h5lImp.c プロジェクト: Starlink/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Lget_info_by_idx
 * Signature: (JLjava/lang/String;IIJJ)Lhdf/hdf5lib/structs/H5L_info_t;
 */
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Lget_1info_1by_1idx
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name,
        jint index_field, jint order, jlong link_n, jlong access_id)
{
    jobject     ret_obj = NULL;
    jvalue      args[5];
    herr_t      status;
    H5L_info_t  infobuf;
    const char *lName;

    PIN_JAVA_STRING(name, lName);
    if (lName != NULL) {
        status = H5Lget_info_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, &infobuf, (hid_t)access_id);

        UNPIN_JAVA_STRING(name, lName);

        if (status < 0) {
            h5libraryError(env);
        } /* end if */
        else {
            args[0].i = infobuf.type;
            args[1].z = infobuf.corder_valid;
            args[2].j = infobuf.corder;
            args[3].i = infobuf.cset;
            if(infobuf.type==0)
                args[4].j = (jlong)infobuf.u.address;
            else
                args[4].j = (jlong)infobuf.u.val_size;
            CALL_CONSTRUCTOR("hdf/hdf5lib/structs/H5L_info_t", "(IZJIJ)V", args);
        } /* end els */
    }
    return ret_obj;
} /* end Java_hdf_hdf5lib_H5_H5Lget_1info_1by_1idx */
コード例 #7
0
ファイル: h5oImp.c プロジェクト: soumagne/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Ovisit_by_name
 * Signature: (JLjava/lang/String;IILjava/lang/Object;Ljava/lang/Object;IJ)I
 */
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name
    (JNIEnv *env, jclass clss, jlong grp_id, jstring name, jint idx_type, jint order,
        jobject callback_op, jobject op_data, jint fields, jlong access_id)
{
    cb_wrapper  wrapper = { callback_op, op_data };
    const char *objName = NULL;
    herr_t      status = FAIL;

    UNUSED(clss);

    ENVPTR->GetJavaVM(ENVONLY, &jvm);
    CHECK_JNI_EXCEPTION(ENVONLY, JNI_FALSE);

    if (NULL == op_data)
        H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ovisit_by_name: op_data is NULL");
    if (NULL == callback_op)
        H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ovisit_by_name: callback_op is NULL");
    if (NULL == name)
        H5_NULL_ARGUMENT_ERROR(ENVONLY, "H5Ovisit_by_name: object name is NULL");

    PIN_JAVA_STRING(ENVONLY, name, objName, NULL, "H5Ovisit_by_name: object name not pinned");

    if ((status = H5Ovisit_by_name2((hid_t)grp_id, objName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void *)&wrapper, (unsigned)fields, (hid_t)access_id)) < 0)
        H5_LIBRARY_ERROR(ENVONLY);

done:
    if (objName)
        UNPIN_JAVA_STRING(ENVONLY, name, objName);

    return status;
} /* end Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name */
コード例 #8
0
ファイル: h5oImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Ovisit_by_name
 * Signature: (JLjava/lang/String;IILjava/lang/Object;Ljava/lang/Object;J)I
 */
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name
    (JNIEnv *env, jclass clss, jlong grp_id, jstring name, jint idx_type, jint order,
        jobject callback_op, jobject op_data, jlong access_id)
{
    herr_t        status = -1;
    const char   *lName;

    ENVPTR->GetJavaVM(ENVPAR &jvm);
    visit_callback = callback_op;

    if (op_data == NULL) {
        h5nullArgument(env, "H5Ovisit_by_name:  op_data is NULL");
        return -1;
    } /* end if */
    else if (callback_op == NULL) {
        h5nullArgument(env, "H5Ovisit_by_name:  callback_op is NULL");
        return -1;
    } /* end if */
    else {
        PIN_JAVA_STRING(name, lName);
        if (lName != NULL) {
            status = H5Ovisit_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (H5O_iterate_t)H5O_iterate_cb, (void*)op_data, (hid_t)access_id);

            UNPIN_JAVA_STRING(name, lName);

            if (status < 0)
                h5libraryError(env);
        }
    }

    return status;
} /* end Java_hdf_hdf5lib_H5_H5Ovisit_1by_1name */
コード例 #9
0
ファイル: h5eImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Ecreate_msg
 * Signature: (JILjava/lang/String;)J
 */
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5_H5Ecreate_1msg
    (JNIEnv *env, jclass cls, jlong err_id, jint msg_type, jstring err_msg)
{
    hid_t       ret_val = -1;
    const char *the_err_msg;
    H5E_type_t  error_msg_type = (H5E_type_t)msg_type;

    if (err_id < 0) {
        h5badArgument(env, "H5Ecreate_msg: invalid argument");
    } /* end if */
    else {
        PIN_JAVA_STRING(err_msg, the_err_msg);
        if (the_err_msg != NULL) {
            ret_val = H5Ecreate_msg((hid_t)err_id, error_msg_type, the_err_msg);

            UNPIN_JAVA_STRING(err_msg, the_err_msg);

            if (ret_val < 0)
                h5libraryError(env);
        }
    } /* end else */

    return (jlong)ret_val;
} /* end Java_hdf_hdf5lib_H5_H5Ecreate_1msg */
コード例 #10
0
ファイル: h5oImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Oset_comment_by_name
 * Signature: (JLjava/lang/String;Ljava/lang/String;J)V
 */
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Oset_1comment_1by_1name
    (JNIEnv *env, jclass clss, jlong loc_id,
        jstring name, jstring comment, jlong access_id)
{
    herr_t      status = -1;
    const char *oName;
    const char *oComment;

    PIN_JAVA_STRING(name, oName);
    if (oName != NULL) {
        if (comment == NULL) {
            status = H5Oset_comment_by_name((hid_t)loc_id, oName, NULL, (hid_t)access_id);
        } /* end if */
        else {
            jboolean    isCopy;
            oComment = ENVPTR->GetStringUTFChars(ENVPAR comment, &isCopy);
            if (oComment != NULL) {
                status = H5Oset_comment_by_name((hid_t)loc_id, oName, oComment, (hid_t)access_id);
                ENVPTR->ReleaseStringUTFChars(ENVPAR comment, oComment);
            } /* end if */
        } /* end else */

        UNPIN_JAVA_STRING(name, oName);

        if (status < 0)
            h5libraryError(env);
    }
} /* end Java_hdf_hdf5lib_H5_H5Oset_1comment_1by_1name */
コード例 #11
0
ファイル: h5gImp.c プロジェクト: zstang/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Gget_info_by_idx
 * Signature: (JLjava/lang/String;IIJJ)Lhdf/hdf5lib/structs/H5G_info_t;
 */
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx
    (JNIEnv *env, jclass cls, jlong loc_id, jstring name, jint index_type,
          jint order, jlong n, jlong lapl_id)
{
    herr_t          ret_val = -1;
    const char     *gName;
    H5G_info_t      group_info;
    H5_index_t      cindex_type = (H5_index_t)index_type;
    H5_iter_order_t corder = (H5_iter_order_t)order;

    PIN_JAVA_STRING(name, gName, NULL);

    ret_val = H5Gget_info_by_idx((hid_t)loc_id, gName, cindex_type,
            corder, (hsize_t)n, &group_info, (hid_t)lapl_id);

    UNPIN_JAVA_STRING(name, gName);

    if (ret_val < 0) {
        h5libraryError(env);
        return NULL;
    } /* end if */

    return create_H5G_info_t(env, group_info);
} /* end Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1idx */
コード例 #12
0
ファイル: h5lImp.c プロジェクト: Starlink/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Literate_by_name
 * Signature: (JLjava/lang/String;IIJLjava/lang/Object;Ljava/lang/Object;J)I
 */
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Literate_1by_1name
    (JNIEnv *env, jclass clss, jlong grp_id, jstring name, jint idx_type, jint order,
        jlong idx, jobject callback_op, jobject op_data, jlong access_id)
{
    hsize_t       start_idx = (hsize_t)idx;
    herr_t        status = -1;
    const char   *lName;

    ENVPTR->GetJavaVM(ENVPAR &jvm);
    cb_wrapper wrapper = {callback_op, op_data};

    if ((op_data == NULL) || (callback_op == NULL)) {
        h5nullArgument(env,  "H5Literate_by_name:  op_data or callback_op is NULL");
    } /* end if */
    else {
        PIN_JAVA_STRING(name, lName);
        if (lName != NULL) {
            status = H5Literate_by_name((hid_t)grp_id, lName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t*)&start_idx, (H5L_iterate_t)H5L_iterate_cb, (void*)&wrapper, (hid_t)access_id);

            UNPIN_JAVA_STRING(name, lName);

            if (status < 0)
                h5libraryError(env);
        }
    } /* end else */

    return status;
} /* end Java_hdf_hdf5lib_H5_H5Literate_1by_1name */
コード例 #13
0
ファイル: h5gImp.c プロジェクト: fengbingchun/Caffe_Test
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    _H5Gopen2
 * Signature: (JLjava/lang/String;J)J
 */
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Gopen2(JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_plist_id)
{
    hid_t group_id = -1;
    const char *gName;

    PIN_JAVA_STRING(name, gName, -1);

    group_id = H5Gopen2((hid_t)loc_id, gName, (hid_t)access_plist_id );

    UNPIN_JAVA_STRING(name, gName);

    if (group_id < 0)
        h5libraryError(env);

    return (jlong)group_id;
} /* end Java_hdf_hdf5lib_H5__1H5Gopen2 */
コード例 #14
0
ファイル: h5aImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Adelete_by_idx
 * Signature: (JLjava/lang/String;IIJJ)V
 */
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Adelete_1by_1idx
    (JNIEnv *env, jclass clss, jlong loc_id, jstring obj_name, jint idx_type, jint order, jlong n, jlong lapl_id)
{
    herr_t      status = -1;
    const char *aName;

    PIN_JAVA_STRING(obj_name, aName);
    if (aName != NULL) {
        status = H5Adelete_by_idx((hid_t)loc_id, aName, (H5_index_t)idx_type, (H5_iter_order_t)order, (hsize_t)n, (hid_t)lapl_id);

        UNPIN_JAVA_STRING(obj_name, aName);

        if (status < 0)
            h5libraryError(env);
    }
} /* end Java_hdf_hdf5lib_H5_H5Adelete_1by_1idx */
コード例 #15
0
ファイル: h5plImp.c プロジェクト: Starlink/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5PLprepend
 * Signature: (Ljava/lang/String;)V
 */
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5PLprepend
  (JNIEnv *env, jclass clss, jobjectArray plugin_path)
{
    const char *aName;
    herr_t retVal = -1;

    PIN_JAVA_STRING(plugin_path, aName);
    if (aName != NULL) {
        retVal = H5PLprepend(aName);

        UNPIN_JAVA_STRING(plugin_path, aName);

        if (retVal < 0)
            h5libraryError(env);
    }
} /* end Java_hdf_hdf5lib_H5_H5PLprepend */
コード例 #16
0
ファイル: h5lImp.c プロジェクト: Starlink/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Ldelete
 * Signature: (JLjava/lang/String;J)V
 */
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Ldelete
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_id)
{
    herr_t      status = -1;
    const char *lName;

    PIN_JAVA_STRING(name, lName);
    if (lName != NULL) {
        status = H5Ldelete((hid_t)loc_id, lName, (hid_t)access_id);

        UNPIN_JAVA_STRING(name, lName);

        if (status < 0)
            h5libraryError(env);
    }
} /* end Java_hdf_hdf5lib_H5_H5Ldelete */
コード例 #17
0
ファイル: h5lImp.c プロジェクト: Starlink/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Lget_name_by_idx
 * Signature: (JLjava/lang/String;IIJJ)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Lget_1name_1by_1idx
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name,
        jint index_field, jint order, jlong link_n, jlong access_id)
{
    jlong       status_size;
    jstring     str = NULL;
    size_t      buf_size;
    const char *lName;
    char       *lValue;

    PIN_JAVA_STRING(name, lName);
    if (lName != NULL) {
        /* get the length of the link name */
        status_size = H5Lget_name_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (char*)NULL, (size_t)0, H5P_DEFAULT);
        if(status_size < 0) {
            h5libraryError(env);
        } /* end if */
        else {
            buf_size = (size_t)status_size + 1;/* add extra space for the null terminator */

            lValue = (char*)HDmalloc(sizeof(char) * buf_size);
            if (lValue == NULL) {
                h5outOfMemory(env, "H5Lget_name_by_idx:  malloc failed ");
            } /* end if */
            else {
                status_size = H5Lget_name_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (char*)lValue, (size_t)buf_size, (hid_t)access_id);

                if (status_size < 0) {
                    HDfree(lValue);
                    h5libraryError(env);
                } /* end if */
                else {
                    str = ENVPTR->NewStringUTF(ENVPAR lValue);
                    HDfree(lValue);
                    if (str == NULL)
                        h5JNIFatalError(env, "H5Lget_name_by_idx:  return string not created");
                } /* end else */
            } /* end else */
        } /* end else */
        UNPIN_JAVA_STRING(name, lName);
    }

    return str;
} /* end Java_hdf_hdf5lib_H5_H5Lget_1name_1by_1idx */
コード例 #18
0
ファイル: h5oImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Olink
 * Signature: (JJLjava/lang/String;JJ)V
 */
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Olink
    (JNIEnv *env, jclass clss, jlong cur_loc_id, jlong dst_loc_id,
        jstring dst_name, jlong create_id, jlong access_id)
{
    herr_t      status = -1;
    const char *lDstName;

    PIN_JAVA_STRING(dst_name, lDstName);
    if (lDstName != NULL) {
        status = H5Olink((hid_t)cur_loc_id, (hid_t)dst_loc_id, lDstName, (hid_t)create_id, (hid_t)access_id);

        UNPIN_JAVA_STRING(dst_name, lDstName);

        if (status < 0)
            h5libraryError(env);
    }
} /* end Java_hdf_hdf5lib_H5_H5Olink */
コード例 #19
0
ファイル: h5oImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Oget_comment_by_name
 * Signature: (JLjava/lang/String;J)Ljava/lang/String;
 */
JNIEXPORT jstring JNICALL
Java_hdf_hdf5lib_H5_H5Oget_1comment_1by_1name
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_id)
{
    char       *oComment;
    const char *oName;
    ssize_t     buf_size;
    ssize_t     status;
    jstring     str = NULL;

    PIN_JAVA_STRING(name, oName);
    if (oName != NULL) {
        /* get the length of the comment */
        buf_size = H5Oget_comment_by_name((hid_t)loc_id, oName, NULL, 0, (hid_t)access_id);
        if (buf_size < 0) {
            h5badArgument( env, "H5Oget_comment_by_name:  buf_size < 0");
        } /* end if */
        else if (buf_size > 0) {
            buf_size++; /* add extra space for the null terminator */
            oComment = (char *)HDmalloc(sizeof(char) * (size_t)buf_size);
            if (oComment == NULL) {
                h5outOfMemory( env, "H5Oget_comment_by_name:  malloc failed");
            } /* end if */
            else {
                status = H5Oget_comment_by_name((hid_t)loc_id, oName, oComment, (size_t)buf_size, (hid_t)access_id);

                if (status < 0) {
                    h5libraryError(env);
                } /* end if */
                else {
                    /*  may throw OutOfMemoryError */
                    str = ENVPTR->NewStringUTF(ENVPAR oComment);
                    if (str == NULL) {
                        h5JNIFatalError( env, "H5Oget_comment_by_name:  return string not allocated");
                    } /* end if */
                } /* end else */
                HDfree(oComment);
            }
        } /* end if */
        UNPIN_JAVA_STRING(name, oName);
    }

    return (jstring)str;
} /* end Java_hdf_hdf5lib_H5_H5Oget_1comment_1by_1name */
コード例 #20
0
ファイル: h5aImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Adelete
 * Signature: (JLjava/lang/String;)I
 */
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Adelete
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name)
{
    herr_t      status = -1;
    const char *aName;

    PIN_JAVA_STRING(name, aName);
    if (aName != NULL) {
        status = H5Adelete((hid_t)loc_id, aName);

        UNPIN_JAVA_STRING(name, aName);

        if (status < 0)
            h5libraryError(env);
    }

    return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Adelete */
コード例 #21
0
ファイル: h5lImp.c プロジェクト: Starlink/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Ldelete_by_idx
 * Signature: (JLjava/lang/String;IIJJ)V
 */
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Ldelete_1by_1idx
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name,
        jint index_field, jint order, jlong link_n, jlong access_id)
{
    hsize_t     n = (hsize_t)link_n;
    herr_t      status;
    const char *lName;

    PIN_JAVA_STRING(name, lName);
    if (lName != NULL) {
        status = H5Ldelete_by_idx((hid_t)loc_id, lName, (H5_index_t)index_field, (H5_iter_order_t)order, n, (hid_t)access_id);

        UNPIN_JAVA_STRING(name, lName);

        if (status < 0)
            h5libraryError(env);
    }
} /* end Java_hdf_hdf5lib_H5_H5Ldelete_1by_1idx */
コード例 #22
0
ファイル: h5aImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Aopen_name
 * Signature: (JLjava/lang/String;)J
 */
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Aopen_1name
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name)
{
    hid_t       attr_id = -1;
    const char *aName;

    PIN_JAVA_STRING(name, aName);
    if (aName != NULL) {
        attr_id = H5Aopen_name((hid_t)loc_id, aName);

        UNPIN_JAVA_STRING(name,aName);

        if (attr_id < 0)
            h5libraryError(env);
        }

    return (jlong)attr_id;
} /* end Java_hdf_hdf5lib_H5__1H5Aopen_1name */
コード例 #23
0
ファイル: h5oImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    _H5Oopen
 * Signature: (JLjava/lang/String;J)J
 */
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Oopen
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong access_plist_id)
{
    hid_t       status = -1;
    const char *oName;

    PIN_JAVA_STRING(name, oName);
    if (oName != NULL) {
        status = H5Oopen((hid_t)loc_id, oName, (hid_t)access_plist_id );

        UNPIN_JAVA_STRING(name, oName);

        if (status < 0)
            h5libraryError(env);
    }

    return (jlong)status;
} /* end Java_hdf_hdf5lib_H5__1H5Oopen */
コード例 #24
0
ファイル: h5oImp.c プロジェクト: soumagne/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Oset_comment
 * Signature: (JLjava/lang/String;)V
 */
JNIEXPORT void JNICALL
Java_hdf_hdf5lib_H5_H5Oset_1comment
    (JNIEnv *env, jclass clss, jlong loc_id, jstring comment)
{
    const char *oComment = NULL;
    herr_t      status = FAIL;

    UNUSED(clss);

    if (NULL != comment)
        PIN_JAVA_STRING(ENVONLY, comment, oComment, NULL, "H5Oset_comment: object comment not pinned");

    if ((status = H5Oset_comment((hid_t)loc_id, oComment)) < 0)
        H5_LIBRARY_ERROR(ENVONLY);

done:
    if (oComment)
        UNPIN_JAVA_STRING(ENVONLY, comment, oComment);
} /* end Java_hdf_hdf5lib_H5_H5Oset_1comment */
コード例 #25
0
ファイル: h5rImp.c プロジェクト: ElaraFX/hdf5
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Rcreate
 * Signature: ([BJLjava/lang/String;IJ)I
 */
JNIEXPORT jint JNICALL
Java_hdf_hdf5lib_H5_H5Rcreate(JNIEnv *env, jclass clss, jbyteArray ref, jlong loc_id, jstring name, jint ref_type, jlong space_id)
{
    const char *rName;
    herr_t      status = -1;
    jbyte      *refP;
    jboolean    isCopy2;

    PIN_JAVA_STRING(name, rName, -1);

    if (ref == NULL) {
        UNPIN_JAVA_STRING(name, rName);
        h5nullArgument( env, "H5Rcreate:  ref is NULL");
    } /* end if */
    else {
        if ((ref_type == H5R_OBJECT) && ENVPTR->GetArrayLength(ENVPAR ref) != H5R_OBJ_REF_BUF_SIZE) {
            UNPIN_JAVA_STRING(name, rName);
            h5badArgument( env, "H5Rcreate:  ref input array != H5R_OBJ_REF_BUF_SIZE");
        } /* end if */
        else if ((ref_type == H5R_DATASET_REGION) && ENVPTR->GetArrayLength(ENVPAR ref) != H5R_DSET_REG_REF_BUF_SIZE) {
            UNPIN_JAVA_STRING(name, rName);
            h5badArgument( env, "H5Rcreate:  region ref input array != H5R_DSET_REG_REF_BUF_SIZE");
        } /* end else if */
        else if ((ref_type != H5R_OBJECT) && (ref_type != H5R_DATASET_REGION)) {
            UNPIN_JAVA_STRING(name, rName);
            h5badArgument( env, "H5Rcreate:  ref_type unknown type ");
        } /* end else if */
        else {
            refP = (jbyte*)ENVPTR->GetByteArrayElements(ENVPAR ref, &isCopy2);
            if (refP == NULL) {
                UNPIN_JAVA_STRING(name, rName);
                h5JNIFatalError(env,  "H5Rcreate:  ref not pinned");
            } /* end if */
            else {
                status = H5Rcreate(refP, (hid_t)loc_id, rName, (H5R_type_t)ref_type, (hid_t)space_id);

                UNPIN_JAVA_STRING(name, rName);
                if (status < 0) {
                    ENVPTR->ReleaseByteArrayElements(ENVPAR ref, refP, JNI_ABORT);
                    h5libraryError(env);
                } /* end if */
                else {
                    ENVPTR->ReleaseByteArrayElements(ENVPAR ref, refP, 0);
                } /* end else */
            } /* end else */
        } /* end else */
    } /* end else */

    return (jint)status;
} /* end Java_hdf_hdf5lib_H5_H5Rcreate */
コード例 #26
0
JNIEXPORT jint JNICALL
Java_hdf_hdflib_HDFLibrary_Vfindattr
(JNIEnv *env, jclass clss, jlong id, jstring name)
{
    int32 retVal = -1;
    const char  *cname;

    PIN_JAVA_STRING(name, cname);

    if (cname != NULL) {
        retVal = Vfindattr((int32)id, cname);

        UNPIN_JAVA_STRING(name, cname);

        if (retVal == FAIL)
            CALL_ERROR_CHECK();
    }

    return retVal;
}
コード例 #27
0
ファイル: h5aImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    _H5Aopen
 * Signature: (JLjava/lang/String;J)J
 */
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Aopen
    (JNIEnv *env, jclass clss, jlong obj_id, jstring name, jlong access_plist)

{
    hid_t       retVal = -1;
    const char *aName;

    PIN_JAVA_STRING(name, aName);
    if (aName != NULL) {
        retVal = H5Aopen((hid_t)obj_id, aName, (hid_t)access_plist);

        UNPIN_JAVA_STRING(name, aName);

        if (retVal < 0)
            h5libraryError(env);
    }

    return (jlong)retVal;
} /* end Java_hdf_hdf5lib_H5__1H5Aopen */
コード例 #28
0
ファイル: h5aImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Acreate
 * Signature: (JLjava/lang/String;JJJ)J
 */
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Acreate
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name, jlong type_id,
          jlong space_id, jlong create_plist)
{
    hid_t       attr_id = -1;
    const char *aName;

    PIN_JAVA_STRING(name, aName);
    if (aName != NULL) {
        attr_id = H5Acreate2((hid_t)loc_id, aName, (hid_t)type_id, (hid_t)space_id, (hid_t)create_plist, (hid_t)H5P_DEFAULT);

        UNPIN_JAVA_STRING(name, aName);

        if (attr_id < 0)
            h5libraryError(env);
    }

    return (jlong)attr_id;
} /* end Java_hdf_hdf5lib_H5__1H5Acreate */
コード例 #29
0
ファイル: h5oImp.c プロジェクト: ngcurrier/ProteusCFD
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    _H5Oopen_by_idx
 * Signature: (JLjava/lang/String;IIJJ)J;
 */
JNIEXPORT jlong JNICALL
Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx
    (JNIEnv *env, jclass clss, jlong loc_id, jstring name,
        jint index_field, jint order, jlong link_n, jlong lapl_id)
{
    hid_t       retVal = -1;
    const char *oName;

    PIN_JAVA_STRING(name, oName);
    if (oName != NULL) {
        retVal = H5Oopen_by_idx((hid_t)loc_id, oName, (H5_index_t)index_field, (H5_iter_order_t)order, (hsize_t)link_n, (hid_t)lapl_id );

        UNPIN_JAVA_STRING(name, oName);

        if (retVal < 0)
            h5libraryError(env);
    }

    return (jlong)retVal;
} /* end Java_hdf_hdf5lib_H5__1H5Oopen_1by_1idx */
コード例 #30
0
ファイル: h5gImp.c プロジェクト: fengbingchun/Caffe_Test
/*
 * Class:     hdf_hdf5lib_H5
 * Method:    H5Gget_info_by_name
 * Signature: (JLjava/lang/String;J)Lhdf/hdf5lib/structs/H5G_info_t;
 */
JNIEXPORT jobject JNICALL
Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1name(JNIEnv *env, jclass cls, jlong loc_id, jstring name, jlong lapl_id)
{
    herr_t      ret_val = -1;
    const char *gName;
    H5G_info_t  group_info;

    PIN_JAVA_STRING(name, gName, NULL);

    ret_val = H5Gget_info_by_name((hid_t)loc_id, gName, &group_info, (hid_t)lapl_id);

    UNPIN_JAVA_STRING(name, gName);

    if (ret_val < 0) {
        h5libraryError(env);
        return NULL;
    } /* end if */

    return create_H5G_info_t(env, group_info);
} /* end Java_hdf_hdf5lib_H5_H5Gget_1info_1by_1name */