コード例 #1
0
/****if* H5Of/h5ovisit_by_name_c
 * NAME
 *  h5ovisit_by_name_c
 * PURPOSE
 *  Calls H5Ovisit_by_name
 * INPUTS
 *    object_id - Identifier specifying subject group
 *   index_type - Type of index which determines the order
 *        order - Order within index
 *          idx - Iteration position at which to start
 *           op - Callback function passing data regarding the link to the calling application
 *      op_data - User-defined pointer to data required by the application for its processing of the link
 *
 * OUTPUTS
 *          idx - Position at which an interrupted iteration may be restarted
 *
 * RETURNS
 *  >0 on success, 0< on failure
 * AUTHOR
 *  M. Scot Breitenfeld
 *  May 16, 2012
 * SOURCE
*/
int_f
h5ovisit_by_name_c(hid_t_f *loc_id,  _fcd object_name, size_t_f *namelen, int_f *index_type, int_f *order,
		    H5O_iterate_t op, void *op_data, hid_t_f *lapl_id )
/******/
{
  int_f ret_value = -1;       /* Return value */
  herr_t func_ret_value;      /* H5Linterate return value */
  char *c_object_name = NULL; /* Buffer to hold C string */

  /*
   * Convert FORTRAN name to C name
   */
  if( (c_object_name = HD5f2cstring(object_name, (size_t)*namelen)) == NULL)
    HGOTO_DONE(FAIL);

  /*
   * Call H5Ovisit
   */
  func_ret_value = H5Ovisit_by_name( (hid_t)*loc_id, c_object_name, (H5_index_t)*index_type, (H5_iter_order_t)*order,
				     op, op_data, (hid_t)*lapl_id);
  ret_value = (int_f)func_ret_value;

 done:
  if(c_object_name)
    HDfree(c_object_name);
  return ret_value;

}
コード例 #2
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 */