2003-02-17 23:54:15 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-02-17 23:54:15 +08:00
|
|
|
* 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 *
|
2017-04-18 03:32:16 +08:00
|
|
|
* 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. *
|
2003-02-17 23:54:15 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2006-11-27 22:51:22 +08:00
|
|
|
/****************/
|
|
|
|
/* Module Setup */
|
|
|
|
/****************/
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
#include "H5Amodule.h" /* This source code file is part of the H5A module */
|
|
|
|
#define H5O_FRIEND /* Suppress error about including H5Opkg */
|
2003-07-09 22:34:35 +08:00
|
|
|
|
2006-11-27 22:51:22 +08:00
|
|
|
/***********/
|
|
|
|
/* Headers */
|
|
|
|
/***********/
|
2020-09-30 22:27:10 +08:00
|
|
|
#include "H5private.h" /* Generic Functions */
|
|
|
|
#include "H5Apkg.h" /* Attributes */
|
|
|
|
#include "H5CXprivate.h" /* API Contexts */
|
|
|
|
#include "H5Eprivate.h" /* Error handling */
|
|
|
|
#include "H5FLprivate.h" /* Free Lists */
|
|
|
|
#include "H5Iprivate.h" /* IDs */
|
|
|
|
#include "H5MMprivate.h" /* Memory management */
|
|
|
|
#include "H5Opkg.h" /* Object headers */
|
|
|
|
#include "H5Sprivate.h" /* Dataspace functions */
|
|
|
|
#include "H5VLprivate.h" /* Virtual Object Layer */
|
2015-09-14 11:58:59 +08:00
|
|
|
|
2006-11-27 22:51:22 +08:00
|
|
|
/****************/
|
|
|
|
/* Local Macros */
|
|
|
|
/****************/
|
|
|
|
|
|
|
|
/******************/
|
|
|
|
/* Local Typedefs */
|
|
|
|
/******************/
|
|
|
|
|
|
|
|
/* Object header iterator callbacks */
|
|
|
|
/* Data structure for callback for locating the index by name */
|
|
|
|
typedef struct H5A_iter_cb1 {
|
|
|
|
const char *name;
|
2020-09-30 22:27:10 +08:00
|
|
|
int idx;
|
2006-11-27 22:51:22 +08:00
|
|
|
} H5A_iter_cb1;
|
|
|
|
|
|
|
|
/********************/
|
|
|
|
/* Package Typedefs */
|
|
|
|
/********************/
|
|
|
|
|
|
|
|
/********************/
|
|
|
|
/* Local Prototypes */
|
|
|
|
/********************/
|
|
|
|
|
|
|
|
/*********************/
|
|
|
|
/* Package Variables */
|
|
|
|
/*********************/
|
|
|
|
|
2015-09-14 11:58:59 +08:00
|
|
|
/* Package initialization variable */
|
|
|
|
hbool_t H5_PKG_INIT_VAR = FALSE;
|
|
|
|
|
2006-11-27 22:51:22 +08:00
|
|
|
/*****************************/
|
|
|
|
/* Library Private Variables */
|
|
|
|
/*****************************/
|
|
|
|
|
|
|
|
/*******************/
|
|
|
|
/* Local Variables */
|
|
|
|
/*******************/
|
2003-05-09 04:09:07 +08:00
|
|
|
|
2008-07-23 04:36:31 +08:00
|
|
|
/* Declare the free lists of H5A_t */
|
2004-11-18 00:53:38 +08:00
|
|
|
H5FL_DEFINE(H5A_t);
|
|
|
|
|
2008-07-23 04:36:31 +08:00
|
|
|
/* Declare the free lists for H5A_shared_t's */
|
|
|
|
H5FL_DEFINE(H5A_shared_t);
|
|
|
|
|
2004-11-23 03:53:17 +08:00
|
|
|
/* Declare a free list to manage blocks of type conversion data */
|
|
|
|
H5FL_BLK_DEFINE(attr_buf);
|
|
|
|
|
2012-07-17 03:54:26 +08:00
|
|
|
/* Attribute ID class */
|
|
|
|
static const H5I_class_t H5I_ATTR_CLS[1] = {{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5I_ATTR, /* ID class value */
|
|
|
|
0, /* Class flags */
|
|
|
|
0, /* # of reserved IDs for class */
|
|
|
|
(H5I_free_t)H5A__close_cb /* Callback routine for closing objects of this class */
|
2012-07-17 03:54:26 +08:00
|
|
|
}};
|
|
|
|
|
2015-09-14 11:58:59 +08:00
|
|
|
/* Flag indicating "top" of interface has been initialized */
|
|
|
|
static hbool_t H5A_top_package_initialize_s = FALSE;
|
2012-07-17 03:54:26 +08:00
|
|
|
|
2019-12-13 05:17:25 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: H5A_init
|
|
|
|
*
|
|
|
|
* Purpose: Initialize the interface from some other layer.
|
|
|
|
*
|
|
|
|
* Return: Success: non-negative
|
|
|
|
*
|
|
|
|
* Failure: negative
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
herr_t
|
|
|
|
H5A_init(void)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2019-12-13 05:17:25 +08:00
|
|
|
|
|
|
|
FUNC_ENTER_NOAPI(FAIL)
|
|
|
|
/* FUNC_ENTER() does all the work */
|
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
|
|
|
} /* end H5A_init() */
|
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
2015-09-14 11:58:59 +08:00
|
|
|
H5A__init_package -- Initialize interface-specific information
|
1998-04-24 06:24:38 +08:00
|
|
|
USAGE
|
2015-09-14 11:58:59 +08:00
|
|
|
herr_t H5A__init_package()
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
RETURNS
|
1998-10-27 05:18:54 +08:00
|
|
|
Non-negative on success/Negative on failure
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
Initializes any interface-specific data or routines.
|
|
|
|
|
|
|
|
--------------------------------------------------------------------------*/
|
2015-09-14 11:58:59 +08:00
|
|
|
herr_t
|
|
|
|
H5A__init_package(void)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2002-08-09 00:52:55 +08:00
|
|
|
|
2015-09-14 11:58:59 +08:00
|
|
|
FUNC_ENTER_PACKAGE
|
1998-04-24 06:24:38 +08:00
|
|
|
|
|
|
|
/*
|
2006-01-03 03:20:19 +08:00
|
|
|
* Create attribute ID type.
|
1998-04-24 06:24:38 +08:00
|
|
|
*/
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_register_type(H5I_ATTR_CLS) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to initialize interface")
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2015-09-14 11:58:59 +08:00
|
|
|
/* Mark "top" of interface as initialized, too */
|
|
|
|
H5A_top_package_initialize_s = TRUE;
|
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_NOAPI(ret_value)
|
2015-09-14 11:58:59 +08:00
|
|
|
} /* end H5A__init_package() */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
2015-09-14 11:58:59 +08:00
|
|
|
H5A_top_term_package
|
1998-04-24 06:24:38 +08:00
|
|
|
PURPOSE
|
|
|
|
Terminate various H5A objects
|
|
|
|
USAGE
|
2015-09-14 11:58:59 +08:00
|
|
|
void H5A_top_term_package()
|
1998-04-24 06:24:38 +08:00
|
|
|
RETURNS
|
|
|
|
DESCRIPTION
|
2015-09-14 11:58:59 +08:00
|
|
|
Release IDs for the atom group, deferring full interface shutdown
|
|
|
|
until later (in H5A_term_package).
|
1998-04-24 06:24:38 +08:00
|
|
|
GLOBAL VARIABLES
|
|
|
|
COMMENTS, BUGS, ASSUMPTIONS
|
|
|
|
Can't report errors...
|
|
|
|
EXAMPLES
|
|
|
|
REVISION LOG
|
|
|
|
--------------------------------------------------------------------------*/
|
2001-08-15 06:09:56 +08:00
|
|
|
int
|
2015-09-14 11:58:59 +08:00
|
|
|
H5A_top_term_package(void)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
int n = 0;
|
2002-05-29 02:17:12 +08:00
|
|
|
|
2012-07-17 03:54:26 +08:00
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5A_top_package_initialize_s) {
|
|
|
|
if (H5I_nmembers(H5I_ATTR) > 0) {
|
|
|
|
(void)H5I_clear_type(H5I_ATTR, FALSE, FALSE);
|
2014-07-31 04:55:14 +08:00
|
|
|
n++; /*H5I*/
|
2020-09-30 22:27:10 +08:00
|
|
|
} /* end if */
|
2014-04-09 13:08:21 +08:00
|
|
|
|
2015-09-14 11:58:59 +08:00
|
|
|
/* Mark closed */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (0 == n)
|
2015-09-14 11:58:59 +08:00
|
|
|
H5A_top_package_initialize_s = FALSE;
|
|
|
|
} /* end if */
|
|
|
|
|
|
|
|
FUNC_LEAVE_NOAPI(n)
|
|
|
|
} /* H5A_top_term_package() */
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5A_term_package
|
|
|
|
PURPOSE
|
|
|
|
Terminate various H5A objects
|
|
|
|
USAGE
|
|
|
|
void H5A_term_package()
|
|
|
|
RETURNS
|
|
|
|
DESCRIPTION
|
|
|
|
Release any other resources allocated.
|
|
|
|
GLOBAL VARIABLES
|
|
|
|
COMMENTS, BUGS, ASSUMPTIONS
|
|
|
|
Can't report errors...
|
|
|
|
|
|
|
|
Finishes shutting down the interface, after H5A_top_term_package()
|
|
|
|
is called
|
|
|
|
EXAMPLES
|
|
|
|
REVISION LOG
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
int
|
|
|
|
H5A_term_package(void)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
int n = 0;
|
2015-09-14 11:58:59 +08:00
|
|
|
|
|
|
|
FUNC_ENTER_NOAPI_NOINIT_NOERR
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5_PKG_INIT_VAR) {
|
2015-09-14 11:58:59 +08:00
|
|
|
/* Sanity checks */
|
|
|
|
HDassert(0 == H5I_nmembers(H5I_ATTR));
|
|
|
|
HDassert(FALSE == H5A_top_package_initialize_s);
|
|
|
|
|
|
|
|
/* Destroy the attribute object id group */
|
|
|
|
n += (H5I_dec_type_ref(H5I_ATTR) > 0);
|
2014-07-31 04:55:14 +08:00
|
|
|
|
2015-09-14 11:58:59 +08:00
|
|
|
/* Mark closed */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (0 == n)
|
2015-09-14 11:58:59 +08:00
|
|
|
H5_PKG_INIT_VAR = FALSE;
|
2014-07-31 04:55:14 +08:00
|
|
|
} /* end if */
|
|
|
|
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_NOAPI(n)
|
2015-09-14 11:58:59 +08:00
|
|
|
} /* H5A_term_package() */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
2018-09-25 03:23:41 +08:00
|
|
|
* Function: H5Acreate2
|
|
|
|
*
|
|
|
|
* Purpose: Creates an attribute on an object
|
|
|
|
*
|
|
|
|
* Usage:
|
|
|
|
* hid_t H5Acreate2(loc_id, attr_name, type_id, space_id, acpl_id,
|
|
|
|
* aapl_id)
|
|
|
|
*
|
|
|
|
* Description: This function creates an attribute which is attached to the
|
|
|
|
* object specified with 'loc_id'. The name specified with
|
|
|
|
* 'attr_name' for each attribute for an object must be unique
|
|
|
|
* for that object. The 'type_id' and 'space_id' are created
|
|
|
|
* with the H5T and H5S interfaces respectively. The 'aapl_id'
|
|
|
|
* property list is currently unused, but will be used in the
|
|
|
|
* future for optional attribute access properties. The
|
|
|
|
* attribute ID returned from this function must be released
|
|
|
|
* with H5Aclose or resource leaks will develop.
|
|
|
|
*
|
|
|
|
* Parameters:
|
|
|
|
* hid_t loc_id; IN: Object (dataset or group) to be attached to
|
|
|
|
* const char *attr_name; IN: Name of attribute to locate and open
|
|
|
|
* hid_t type_id; IN: ID of datatype for attribute
|
|
|
|
* hid_t space_id; IN: ID of dataspace for attribute
|
|
|
|
* hid_t acpl_id; IN: ID of creation property list (currently not used)
|
|
|
|
* hid_t aapl_id; IN: Attribute access property list
|
|
|
|
*
|
|
|
|
* Return: Success: An ID for the created attribute
|
|
|
|
*
|
|
|
|
* Failure: H5I_INVALID_HID
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
|
|
|
hid_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Acreate2(hid_t loc_id, const char *attr_name, hid_t type_id, hid_t space_id, hid_t acpl_id, hid_t aapl_id)
|
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
void * attr = NULL; /* Attribute created */
|
|
|
|
H5VL_object_t * vol_obj = NULL; /* Object of loc_id */
|
|
|
|
H5VL_loc_params_t loc_params;
|
|
|
|
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
FUNC_ENTER_API(H5I_INVALID_HID)
|
2007-11-06 06:13:43 +08:00
|
|
|
H5TRACE6("i", "i*siiii", loc_id, attr_name, type_id, space_id, acpl_id, aapl_id);
|
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "attr_name parameter cannot be NULL")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!*attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "attr_name parameter cannot be an empty string")
|
2018-10-10 23:10:15 +08:00
|
|
|
|
|
|
|
/* Get correct property list */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5P_DEFAULT == acpl_id)
|
2018-10-10 23:10:15 +08:00
|
|
|
acpl_id = H5P_ATTRIBUTE_CREATE_DEFAULT;
|
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* Get the location object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
|
|
|
|
|
|
|
|
/* Set location parameters */
|
|
|
|
loc_params.type = H5VL_OBJECT_BY_SELF;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Create the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (attr = H5VL_attr_create(vol_obj, &loc_params, attr_name, type_id, space_id, acpl_id, aapl_id,
|
|
|
|
H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to create attribute")
|
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
|
|
|
|
2014-07-23 03:54:51 +08:00
|
|
|
/* Register the new attribute and get an ID for it */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
|
2020-08-18 00:12:59 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID")
|
2014-07-23 03:54:51 +08:00
|
|
|
|
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
|
|
|
done:
|
2014-07-23 03:54:51 +08:00
|
|
|
/* Cleanup on failure */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_INVALID_HID == ret_value)
|
|
|
|
if (attr && H5VL_attr_close(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close attribute")
|
2014-07-23 03:54:51 +08:00
|
|
|
|
[svn-r14218] Description:
Changed H5Acreate2 -> H5Acreate_by_name, to be more consistent with
other new API routines.
Re-added simpler form of H5Acreate2, which creates attributes directly
on an object.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 02:13:48 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Acreate2() */
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Acreate_by_name
|
|
|
|
PURPOSE
|
|
|
|
Creates an attribute on an object
|
|
|
|
USAGE
|
|
|
|
hid_t H5Acreate_by_name(loc_id, obj_name, attr_name, type_id, space_id, acpl_id,
|
2007-02-21 21:20:46 +08:00
|
|
|
aapl_id, lapl_id)
|
1998-04-24 06:24:38 +08:00
|
|
|
hid_t loc_id; IN: Object (dataset or group) to be attached to
|
2007-02-21 21:20:46 +08:00
|
|
|
const char *obj_name; IN: Name of object relative to location
|
|
|
|
const char *attr_name; IN: Name of attribute to locate and open
|
|
|
|
hid_t type_id; IN: ID of datatype for attribute
|
|
|
|
hid_t space_id; IN: ID of dataspace for attribute
|
|
|
|
hid_t acpl_id; IN: ID of creation property list (currently not used)
|
|
|
|
hid_t aapl_id; IN: Attribute access property list
|
|
|
|
hid_t lapl_id; IN: Link access property list
|
1998-04-24 06:24:38 +08:00
|
|
|
RETURNS
|
2018-09-25 03:23:41 +08:00
|
|
|
Non-negative on success/H5I_INVALID_HID on failure
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
This function creates an attribute which is attached to the object
|
2007-02-21 21:20:46 +08:00
|
|
|
specified with 'loc_id/obj_name'. The name specified with 'attr_name' for
|
|
|
|
each attribute for an object must be unique for that object. The 'type_id'
|
1998-04-24 06:24:38 +08:00
|
|
|
and 'space_id' are created with the H5T and H5S interfaces respectively.
|
2007-02-21 21:20:46 +08:00
|
|
|
The 'aapl_id' property list is currently unused, but will be used in the
|
|
|
|
future for optional attribute access properties. The attribute ID returned
|
|
|
|
from this function must be released with H5Aclose or resource leaks will
|
|
|
|
develop.
|
2005-11-15 10:55:39 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
hid_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Acreate_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t type_id, hid_t space_id,
|
|
|
|
hid_t acpl_id, hid_t aapl_id, hid_t lapl_id)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
void * attr = NULL; /* attr object from VOL connector */
|
|
|
|
H5VL_object_t * vol_obj = NULL; /* object of loc_id */
|
|
|
|
H5VL_loc_params_t loc_params;
|
|
|
|
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
FUNC_ENTER_API(H5I_INVALID_HID)
|
2020-09-30 22:27:10 +08:00
|
|
|
H5TRACE8("i", "i*s*siiiii", loc_id, obj_name, attr_name, type_id, space_id, acpl_id, aapl_id, lapl_id);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no object name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!attr_name || !*attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no attribute name")
|
2018-10-10 23:10:15 +08:00
|
|
|
|
|
|
|
/* Get correct property list */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5P_DEFAULT == acpl_id)
|
2018-10-10 23:10:15 +08:00
|
|
|
acpl_id = H5P_ATTRIBUTE_CREATE_DEFAULT;
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, TRUE) < 0)
|
2020-01-03 13:51:25 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set attribute access property list info")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0)
|
2020-01-03 13:51:25 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set link access property list info")
|
2007-02-21 21:20:46 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* Set up location struct */
|
|
|
|
loc_params.type = H5VL_OBJECT_BY_NAME;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
|
|
|
loc_params.loc_data.loc_by_name.name = obj_name;
|
|
|
|
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
|
|
|
|
|
|
|
|
/* Get the location object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Create the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (attr = H5VL_attr_create(vol_obj, &loc_params, attr_name, type_id, space_id, acpl_id, aapl_id,
|
|
|
|
H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, H5I_INVALID_HID, "unable to create attribute")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
|
|
|
/* Register the new attribute and get an ID for it */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
|
2020-08-18 00:12:59 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID")
|
2018-03-16 05:54:30 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
done:
|
2018-03-16 05:54:30 +08:00
|
|
|
/* Cleanup on failure */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_INVALID_HID == ret_value)
|
|
|
|
if (attr && H5VL_attr_close(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close attribute")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2014-07-23 03:54:51 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Acreate_by_name() */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
2007-02-21 21:20:46 +08:00
|
|
|
H5Aopen
|
1998-04-24 06:24:38 +08:00
|
|
|
PURPOSE
|
|
|
|
Opens an attribute for an object by looking up the attribute name
|
|
|
|
USAGE
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 00:07:20 +08:00
|
|
|
hid_t H5Aopen(loc_id, attr_name, aapl_id)
|
|
|
|
hid_t loc_id; IN: Object that attribute is attached to
|
|
|
|
const char *attr_name; IN: Name of attribute to locate and open
|
|
|
|
hid_t aapl_id; IN: Attribute access property list
|
|
|
|
RETURNS
|
2018-09-25 03:23:41 +08:00
|
|
|
ID of attribute on success, H5I_INVALID_HID on failure
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 00:07:20 +08:00
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
This function opens an existing attribute for access. The attribute
|
|
|
|
name specified is used to look up the corresponding attribute for the
|
|
|
|
object. The attribute ID returned from this function must be released with
|
|
|
|
H5Aclose or resource leaks will develop.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
hid_t
|
2016-01-16 07:08:10 +08:00
|
|
|
H5Aopen(hid_t loc_id, const char *attr_name, hid_t aapl_id)
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 00:07:20 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
void * attr = NULL; /* attr object from VOL connector */
|
|
|
|
H5VL_object_t * vol_obj = NULL; /* object of loc_id */
|
2020-04-21 07:12:00 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t ret_value = H5I_INVALID_HID;
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 00:07:20 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
FUNC_ENTER_API(H5I_INVALID_HID)
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 00:07:20 +08:00
|
|
|
H5TRACE3("i", "i*si", loc_id, attr_name, aapl_id);
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be NULL")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!*attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "name parameter cannot be an empty string")
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 00:07:20 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set access property list info")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* Set location struct fields */
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_SELF;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
2018-10-10 23:10:15 +08:00
|
|
|
|
|
|
|
/* Get the location object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Open the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (attr = H5VL_attr_open(vol_obj, &loc_params, attr_name, aapl_id, H5P_DATASET_XFER_DEFAULT,
|
|
|
|
H5_REQUEST_NULL)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute: '%s'", attr_name)
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 00:07:20 +08:00
|
|
|
|
|
|
|
/* Register the attribute and get an ID for it */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
|
2020-08-18 00:12:59 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to register attribute for ID")
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 00:07:20 +08:00
|
|
|
|
|
|
|
done:
|
|
|
|
/* Cleanup on failure */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_INVALID_HID == ret_value)
|
|
|
|
if (attr && H5VL_attr_close(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close attribute")
|
[svn-r14217] Description:
Change H5Aopen -> H5Aopen_by_name, in order to be more consistent with
other new API routines.
Re-add H5Aopen as a simpler routine, to open attributes on a particular
object. (Much like the old H5Aopen_name routine).
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 00:07:20 +08:00
|
|
|
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Aopen() */
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Aopen_by_name
|
|
|
|
PURPOSE
|
|
|
|
Opens an attribute for an object by looking up the attribute name
|
|
|
|
USAGE
|
|
|
|
hid_t H5Aopen_by_name(loc_id, obj_name, attr_name, aapl_id, lapl_id)
|
2007-02-21 21:20:46 +08:00
|
|
|
hid_t loc_id; IN: Object that attribute is attached to
|
|
|
|
const char *obj_name; IN: Name of object relative to location
|
|
|
|
const char *attr_name; IN: Name of attribute to locate and open
|
|
|
|
hid_t aapl_id; IN: Attribute access property list
|
|
|
|
hid_t lapl_id; IN: Link access property list
|
1998-04-24 06:24:38 +08:00
|
|
|
RETURNS
|
2018-09-25 03:23:41 +08:00
|
|
|
ID of attribute on success, H5I_INVALID_HID on failure
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
This function opens an existing attribute for access. The attribute
|
|
|
|
name specified is used to look up the corresponding attribute for the
|
|
|
|
object. The attribute ID returned from this function must be released with
|
|
|
|
H5Aclose or resource leaks will develop.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
hid_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Aopen_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t aapl_id, hid_t lapl_id)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
void * attr = NULL; /* attr object from VOL connector */
|
|
|
|
H5VL_object_t * vol_obj = NULL; /* object of loc_id */
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t ret_value = H5I_INVALID_HID;
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
FUNC_ENTER_API(H5I_INVALID_HID)
|
2007-03-09 00:57:36 +08:00
|
|
|
H5TRACE5("i", "i*s*sii", loc_id, obj_name, attr_name, aapl_id, lapl_id);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no object name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!attr_name || !*attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no attribute name")
|
2018-03-16 05:54:30 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0)
|
2020-01-03 13:51:25 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set attribute access property list info")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
|
2020-01-03 13:51:25 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set link access property list info")
|
2018-10-10 23:10:15 +08:00
|
|
|
|
|
|
|
/* Fill in location struct fields */
|
|
|
|
loc_params.type = H5VL_OBJECT_BY_NAME;
|
|
|
|
loc_params.loc_data.loc_by_name.name = obj_name;
|
|
|
|
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
|
|
|
|
|
|
|
/* Get the location object */
|
2018-10-17 17:06:28 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Open the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (attr = H5VL_attr_open(vol_obj, &loc_params, attr_name, aapl_id, H5P_DATASET_XFER_DEFAULT,
|
|
|
|
H5_REQUEST_NULL)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "can't open attribute")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2006-12-12 03:02:38 +08:00
|
|
|
/* Register the attribute and get an ID for it */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
|
2018-10-26 07:32:13 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
done:
|
2006-12-12 08:57:10 +08:00
|
|
|
/* Cleanup on failure */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_INVALID_HID == ret_value)
|
|
|
|
if (attr && H5VL_attr_close(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close attribute")
|
2006-12-12 08:57:10 +08:00
|
|
|
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
2018-09-25 03:23:41 +08:00
|
|
|
} /* end H5Aopen_by_name() */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
2007-02-21 10:24:25 +08:00
|
|
|
H5Aopen_by_idx
|
1998-04-24 06:24:38 +08:00
|
|
|
PURPOSE
|
2007-02-21 10:24:25 +08:00
|
|
|
Opens the n'th attribute for an object, according to the order within
|
|
|
|
an index
|
1998-04-24 06:24:38 +08:00
|
|
|
USAGE
|
2007-02-21 10:24:25 +08:00
|
|
|
hid_t H5Aopen_by_idx(loc_id, obj_ame, idx_type, order, n, aapl_id, lapl_id)
|
|
|
|
hid_t loc_id; IN: Object that attribute is attached to
|
|
|
|
const char *obj_name; IN: Name of object relative to location
|
|
|
|
H5_index_t idx_type; IN: Type of index to use
|
|
|
|
H5_iter_order_t order; IN: Order to iterate over index
|
|
|
|
hsize_t n; IN: Index (0-based) attribute to open
|
|
|
|
hid_t aapl_id; IN: Attribute access property list
|
|
|
|
hid_t lapl_id; IN: Link access property list
|
1998-04-24 06:24:38 +08:00
|
|
|
RETURNS
|
2018-09-25 03:23:41 +08:00
|
|
|
ID of attribute on success, H5I_INVALID_HID on failure
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
This function opens an existing attribute for access. The attribute
|
|
|
|
index specified is used to look up the corresponding attribute for the
|
|
|
|
object. The attribute ID returned from this function must be released with
|
|
|
|
H5Aclose or resource leaks will develop.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
hid_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Aopen_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
|
|
|
|
hid_t aapl_id, hid_t lapl_id)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
void * attr = NULL; /* Attribute opened */
|
|
|
|
H5VL_object_t * vol_obj = NULL; /* object of loc_id */
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
FUNC_ENTER_API(H5I_INVALID_HID)
|
2020-09-30 22:27:10 +08:00
|
|
|
H5TRACE7("i", "i*sIiIohii", loc_id, obj_name, idx_type, order, n, aapl_id, lapl_id);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "no object name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid index type specified")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, H5I_INVALID_HID, "invalid iteration order specified")
|
2018-03-16 05:54:30 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&aapl_id, H5P_CLS_AACC, loc_id, FALSE) < 0)
|
2020-01-03 13:51:25 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set attribute access property list info")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
|
2020-01-03 13:51:25 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, H5I_INVALID_HID, "can't set link access property list info")
|
2018-10-10 23:10:15 +08:00
|
|
|
|
|
|
|
/* Fill in location struct parameters */
|
|
|
|
loc_params.type = H5VL_OBJECT_BY_IDX;
|
|
|
|
loc_params.loc_data.loc_by_idx.name = obj_name;
|
|
|
|
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
|
|
|
|
loc_params.loc_data.loc_by_idx.order = order;
|
|
|
|
loc_params.loc_data.loc_by_idx.n = n;
|
|
|
|
loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
|
|
|
|
|
|
|
/* Get the location object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid location identifier")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Open the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (attr = H5VL_attr_open(vol_obj, &loc_params, NULL, aapl_id, H5P_DATASET_XFER_DEFAULT,
|
|
|
|
H5_REQUEST_NULL)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, H5I_INVALID_HID, "unable to open attribute")
|
2006-12-19 09:59:28 +08:00
|
|
|
|
|
|
|
/* Register the attribute and get an ID for it */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = H5VL_register(H5I_ATTR, attr, vol_obj->connector, TRUE)) < 0)
|
2018-10-26 07:32:13 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize attribute handle")
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
done:
|
2006-12-19 09:59:28 +08:00
|
|
|
/* Cleanup on failure */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_INVALID_HID == ret_value)
|
|
|
|
if (attr && H5VL_attr_close(vol_obj, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HDONE_ERROR(H5E_ATTR, H5E_CLOSEERROR, H5I_INVALID_HID, "can't close attribute")
|
2006-12-19 09:59:28 +08:00
|
|
|
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
2007-02-21 10:24:25 +08:00
|
|
|
} /* H5Aopen_by_idx() */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Awrite
|
|
|
|
PURPOSE
|
|
|
|
Write out data to an attribute
|
|
|
|
USAGE
|
2006-12-12 08:57:10 +08:00
|
|
|
herr_t H5Awrite (attr_id, dtype_id, buf)
|
1998-04-24 06:24:38 +08:00
|
|
|
hid_t attr_id; IN: Attribute to write
|
2006-12-12 08:57:10 +08:00
|
|
|
hid_t dtype_id; IN: Memory datatype of buffer
|
2001-04-20 05:48:04 +08:00
|
|
|
const void *buf; IN: Buffer of data to write
|
1998-04-24 06:24:38 +08:00
|
|
|
RETURNS
|
1998-10-27 05:18:54 +08:00
|
|
|
Non-negative on success/Negative on failure
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
This function writes a complete attribute to disk.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
herr_t
|
2006-12-12 08:57:10 +08:00
|
|
|
H5Awrite(hid_t attr_id, hid_t dtype_id, const void *buf)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t *vol_obj; /* Attribute object for ID */
|
|
|
|
herr_t ret_value; /* Return value */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2007-03-09 00:57:36 +08:00
|
|
|
H5TRACE3("e", "ii*x", attr_id, dtype_id, buf);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
2003-07-09 05:05:27 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_DATATYPE != H5I_get_type(dtype_id))
|
2004-12-29 22:26:20 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == buf)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "buf parameter can't be NULL")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_loc(attr_id) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read")
|
2016-01-22 06:31:15 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Write the attribute data */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = H5VL_attr_write(vol_obj, dtype_id, buf, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)) < 0)
|
2003-07-09 05:05:27 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_WRITEERROR, FAIL, "unable to write attribute")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
1998-04-24 06:24:38 +08:00
|
|
|
} /* H5Awrite() */
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Aread
|
|
|
|
PURPOSE
|
|
|
|
Read in data from an attribute
|
|
|
|
USAGE
|
2006-12-12 08:57:10 +08:00
|
|
|
herr_t H5Aread (attr_id, dtype_id, buf)
|
1998-04-24 06:24:38 +08:00
|
|
|
hid_t attr_id; IN: Attribute to read
|
2006-12-12 08:57:10 +08:00
|
|
|
hid_t dtype_id; IN: Memory datatype of buffer
|
1998-04-24 06:24:38 +08:00
|
|
|
void *buf; IN: Buffer for data to read
|
|
|
|
RETURNS
|
1998-10-27 05:18:54 +08:00
|
|
|
Non-negative on success/Negative on failure
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
This function reads a complete attribute from disk.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
herr_t
|
2006-12-12 08:57:10 +08:00
|
|
|
H5Aread(hid_t attr_id, hid_t dtype_id, void *buf)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t *vol_obj; /* Attribute object for ID */
|
|
|
|
herr_t ret_value; /* Return value */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2007-03-09 00:57:36 +08:00
|
|
|
H5TRACE3("e", "ii*x", attr_id, dtype_id, buf);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
2003-07-09 05:05:27 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_DATATYPE != H5I_get_type(dtype_id))
|
2004-12-29 22:26:20 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == buf)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "buf parameter can't be NULL")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Read the attribute data */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = H5VL_attr_read(vol_obj, dtype_id, buf, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL)) < 0)
|
2003-07-09 05:05:27 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_READERROR, FAIL, "unable to read attribute")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
1998-04-24 06:24:38 +08:00
|
|
|
} /* H5Aread() */
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Aget_space
|
|
|
|
PURPOSE
|
|
|
|
Gets a copy of the dataspace for an attribute
|
|
|
|
USAGE
|
|
|
|
hid_t H5Aget_space (attr_id)
|
|
|
|
hid_t attr_id; IN: Attribute to get dataspace of
|
|
|
|
RETURNS
|
2018-09-25 03:23:41 +08:00
|
|
|
A dataspace ID on success, H5I_INVALID_HID on failure
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
This function retrieves a copy of the dataspace for an attribute.
|
|
|
|
The dataspace ID returned from this function must be released with H5Sclose
|
|
|
|
or resource leaks will develop.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
hid_t
|
1998-08-28 00:48:50 +08:00
|
|
|
H5Aget_space(hid_t attr_id)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t *vol_obj = NULL; /* Attribute object for ID */
|
|
|
|
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
FUNC_ENTER_API(H5I_INVALID_HID)
|
2006-12-19 03:16:17 +08:00
|
|
|
H5TRACE1("i", "i", attr_id);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an attribute")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Get the dataspace */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_SPACE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) <
|
|
|
|
0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5I_INVALID_HID, "unable to get dataspace of attribute")
|
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
1998-04-24 06:24:38 +08:00
|
|
|
} /* H5Aget_space() */
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Aget_type
|
|
|
|
PURPOSE
|
|
|
|
Gets a copy of the datatype for an attribute
|
|
|
|
USAGE
|
|
|
|
hid_t H5Aget_type (attr_id)
|
|
|
|
hid_t attr_id; IN: Attribute to get datatype of
|
|
|
|
RETURNS
|
2018-09-25 03:23:41 +08:00
|
|
|
A datatype ID on success, H5I_INVALID_HID on failure
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
This function retrieves a copy of the datatype for an attribute.
|
|
|
|
The datatype ID returned from this function must be released with H5Tclose
|
|
|
|
or resource leaks will develop.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
hid_t
|
1998-08-28 00:48:50 +08:00
|
|
|
H5Aget_type(hid_t attr_id)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t *vol_obj = NULL; /* Attribute object for ID */
|
|
|
|
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
FUNC_ENTER_API(H5I_INVALID_HID)
|
2006-12-19 03:16:17 +08:00
|
|
|
H5TRACE1("i", "i", attr_id);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an attribute")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Get the datatype */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_TYPE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5I_INVALID_HID, "unable to get datatype of attribute")
|
2015-10-03 04:17:00 +08:00
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
1998-04-24 06:24:38 +08:00
|
|
|
} /* H5Aget_type() */
|
|
|
|
|
2006-01-03 03:20:19 +08:00
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Aget_create_plist
|
|
|
|
PURPOSE
|
|
|
|
Gets a copy of the creation property list for an attribute
|
|
|
|
USAGE
|
|
|
|
hssize_t H5Aget_create_plist (attr_id, buf_size, buf)
|
|
|
|
hid_t attr_id; IN: Attribute to get name of
|
|
|
|
RETURNS
|
|
|
|
This function returns the ID of a copy of the attribute's creation
|
2018-09-25 03:23:41 +08:00
|
|
|
property list, or H5I_INVALID_HID on failure.
|
2006-01-03 03:20:19 +08:00
|
|
|
|
|
|
|
ERRORS
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
This function returns a copy of the creation property list for
|
|
|
|
an attribute. The resulting ID must be closed with H5Pclose() or
|
|
|
|
resource leaks will occur.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
hid_t
|
|
|
|
H5Aget_create_plist(hid_t attr_id)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t *vol_obj = NULL; /* Attribute object for ID */
|
|
|
|
hid_t ret_value = H5I_INVALID_HID; /* Return value */
|
2006-01-03 03:20:19 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
FUNC_ENTER_API(H5I_INVALID_HID)
|
2006-12-19 03:16:17 +08:00
|
|
|
H5TRACE1("i", "i", attr_id);
|
2006-01-03 03:20:19 +08:00
|
|
|
|
2014-04-24 00:30:25 +08:00
|
|
|
HDassert(H5P_LST_ATTRIBUTE_CREATE_ID_g != -1);
|
2006-01-03 03:20:19 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "not an attribute")
|
2006-06-27 22:45:06 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Get the acpl */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_ACPL, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &ret_value) < 0)
|
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, H5I_INVALID_HID,
|
|
|
|
"unable to get creation property list for attribute")
|
2006-01-03 03:20:19 +08:00
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
2006-10-02 18:24:03 +08:00
|
|
|
} /* end H5Aget_create_plist() */
|
2006-04-10 11:03:30 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Aget_name
|
|
|
|
PURPOSE
|
|
|
|
Gets a copy of the name for an attribute
|
|
|
|
USAGE
|
1998-10-27 01:25:35 +08:00
|
|
|
hssize_t H5Aget_name (attr_id, buf_size, buf)
|
1998-04-24 06:24:38 +08:00
|
|
|
hid_t attr_id; IN: Attribute to get name of
|
|
|
|
size_t buf_size; IN: The size of the buffer to store the string in.
|
[svn-r537] Changes since 19980722
----------------------
./src/H5A.c
./src/H5Apublic.h
./test/tattr.c
Switched the order of the second and third argument of
H5Aget_name() to make it consistent with other functions that
take buffers and buffer sizes.
./src/H5G.c
./src/H5Gpublic.h
./src/H5Gprivate.h
The H5Gget_comment() function returns the size of the comment
including the null terminator. If the object has no comment
then zero is returned. If an error occurs then a negative
value is returned.
./MANIFEST
./tools/Makefile.in
./tools/h5tools.h [NEW]
./tools/h5dump.c [NEW]
Created a library for printing values of datasets in a way
that looks nice. It's not done yet, but I needed it for
debugging the contents of files from Jim Reus.
./tools/h5ls.c
Added the `-d' and `--dump' options which cause the contents
of a dataset to be printed. Added `-w N' and `--width=N'
options to control how wide the raw data output should be. If
you want single-column output then say `-w1'.
Printing dataset values can now handle datasets of any integer
or floating point atomic type. As a special case, integers
which are one byte wide are treated a character strings for
now.
Sample output:
$ h5ls --dump --width=60 banana.hdf
ARCHIVE 0:0:0:744 Dataset {52/Inf}
Data:
(0) "U struct complex { double R; double I; };\012V"
(43) " double;\012"
U 0:0:0:2500 Dataset {256/512}
Data: printing of compound data types is not implemented yet
V 0:0:0:3928 Dataset {256/512}
Data:
(0) 0, 0.015625, 0.03125, 0.046875, 0.0625,
(5) 0.078125, 0.09375, 0.109375, 0.125, 0.140625,
(10) 0.15625, 0.171875, 0.1875, 0.203125, 0.21875,
(15) 0.234375, 0.25, 0.265625, 0.28125, 0.296875,
...
1998-07-24 05:19:17 +08:00
|
|
|
char *buf; IN: Buffer to store name in
|
1998-04-24 06:24:38 +08:00
|
|
|
RETURNS
|
|
|
|
This function returns the length of the attribute's name (which may be
|
|
|
|
longer than 'buf_size') on success or negative for failure.
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
This function retrieves the name of an attribute for an attribute ID.
|
|
|
|
Up to 'buf_size' characters are stored in 'buf' followed by a '\0' string
|
|
|
|
terminator. If the name of the attribute is longer than 'buf_size'-1,
|
|
|
|
the string terminator is stored in the last position of the buffer to
|
|
|
|
properly terminate the string.
|
|
|
|
--------------------------------------------------------------------------*/
|
1999-03-13 02:35:04 +08:00
|
|
|
ssize_t
|
1998-08-28 00:48:50 +08:00
|
|
|
H5Aget_name(hid_t attr_id, size_t buf_size, char *buf)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj = NULL; /* Attribute object for ID */
|
|
|
|
H5VL_loc_params_t loc_params;
|
|
|
|
ssize_t ret_value = -1;
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
FUNC_ENTER_API((-1))
|
2007-03-09 00:57:36 +08:00
|
|
|
H5TRACE3("Zs", "iz*s", attr_id, buf_size, buf);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
|
|
|
/* check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, (-1), "not an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!buf && buf_size)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, (-1), "buf cannot be NULL if buf_size is non-zero")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* Set location struct parameters */
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_SELF;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.obj_type = H5I_get_type(attr_id);
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Get the attribute name */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
|
|
|
|
buf_size, buf, &ret_value) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, (-1), "unable to get attribute name")
|
2008-07-23 04:36:31 +08:00
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Aget_name() */
|
|
|
|
|
2007-02-13 22:50:48 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: H5Aget_name_by_idx
|
|
|
|
*
|
|
|
|
* Purpose: Retrieve name of an attribute, according to the
|
|
|
|
* order within an index.
|
|
|
|
*
|
|
|
|
* Same pattern of behavior as H5Iget_name.
|
|
|
|
*
|
|
|
|
* Return: Success: Non-negative length of name, with information
|
|
|
|
* in NAME buffer
|
|
|
|
* Failure: Negative
|
|
|
|
*
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
* February 8, 2007
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
ssize_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Aget_name_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
|
|
|
|
char *name /*out*/, size_t size, hid_t lapl_id)
|
2007-02-13 22:50:48 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj;
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
ssize_t ret_value; /* Return value */
|
2007-02-13 22:50:48 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2020-09-30 22:27:10 +08:00
|
|
|
H5TRACE8("Zs", "i*sIiIohxzi", loc_id, obj_name, idx_type, order, n, name, size, lapl_id);
|
2007-02-13 22:50:48 +08:00
|
|
|
|
|
|
|
/* Check args */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!name && size)
|
2019-01-09 05:52:30 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name cannot be NULL if size is non-zero")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
|
2007-02-13 22:50:48 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* Get the object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
|
2007-02-13 22:50:48 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_IDX;
|
|
|
|
loc_params.loc_data.loc_by_idx.name = obj_name;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.loc_data.loc_by_idx.order = order;
|
|
|
|
loc_params.loc_data.loc_by_idx.n = n;
|
|
|
|
loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
2007-02-13 22:50:48 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* Get the name */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_NAME, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
|
|
|
|
size, name, &ret_value) < 0)
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get name")
|
2007-02-13 22:50:48 +08:00
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* end H5Aget_name_by_idx() */
|
|
|
|
|
2002-10-30 00:37:49 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: H5Aget_storage_size
|
|
|
|
*
|
|
|
|
* Purpose: Returns the amount of storage size that is required for this
|
2005-08-14 04:53:35 +08:00
|
|
|
* attribute.
|
2002-10-30 00:37:49 +08:00
|
|
|
*
|
|
|
|
* Return: Success: The amount of storage size allocated for the
|
2005-08-14 04:53:35 +08:00
|
|
|
* attribute. The return value may be zero
|
2002-10-30 00:37:49 +08:00
|
|
|
* if no data has been stored.
|
|
|
|
*
|
|
|
|
* Failure: Zero
|
|
|
|
*
|
|
|
|
* Programmer: Raymond Lu
|
|
|
|
* October 23, 2002
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
hsize_t
|
|
|
|
H5Aget_storage_size(hid_t attr_id)
|
|
|
|
{
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_object_t *vol_obj;
|
2020-09-30 22:27:10 +08:00
|
|
|
hsize_t ret_value; /* Return value */
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(0)
|
2006-12-19 03:16:17 +08:00
|
|
|
H5TRACE1("h", "i", attr_id);
|
2002-10-30 00:37:49 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
2003-07-09 05:05:27 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, 0, "not an attribute")
|
2002-10-30 00:37:49 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Get the storage size */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_STORAGE_SIZE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
|
|
|
|
&ret_value) < 0)
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, 0, "unable to get acpl")
|
2002-10-30 00:37:49 +08:00
|
|
|
|
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
2006-12-12 08:57:10 +08:00
|
|
|
} /* end H5Aget_storage_size() */
|
2002-10-30 00:37:49 +08:00
|
|
|
|
2007-02-07 04:03:06 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: H5Aget_info
|
|
|
|
*
|
|
|
|
* Purpose: Retrieve information about an attribute.
|
|
|
|
*
|
|
|
|
* Return: Success: Non-negative
|
|
|
|
* Failure: Negative
|
|
|
|
*
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
* February 6, 2007
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
herr_t
|
2007-02-21 21:20:46 +08:00
|
|
|
H5Aget_info(hid_t attr_id, H5A_info_t *ainfo)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj;
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2007-02-21 21:20:46 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2007-03-09 00:57:36 +08:00
|
|
|
H5TRACE2("e", "i*x", attr_id, ainfo);
|
2007-02-21 21:20:46 +08:00
|
|
|
|
2020-08-18 00:12:59 +08:00
|
|
|
/* Check args */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = (H5VL_object_t *)H5I_object_verify(attr_id, H5I_ATTR)))
|
2007-02-21 21:20:46 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!ainfo)
|
2018-12-13 07:05:56 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "attribute_info parameter cannot be NULL")
|
2007-02-21 21:20:46 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_SELF;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.obj_type = H5I_get_type(attr_id);
|
|
|
|
|
2007-02-21 21:20:46 +08:00
|
|
|
/* Get the attribute information */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
|
|
|
|
ainfo) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
|
2007-02-21 21:20:46 +08:00
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* end H5Aget_info() */
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: H5Aget_info_by_name
|
|
|
|
*
|
|
|
|
* Purpose: Retrieve information about an attribute by name.
|
|
|
|
*
|
|
|
|
* Return: Success: Non-negative
|
|
|
|
* Failure: Negative
|
|
|
|
*
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
* February 6, 2007
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
herr_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Aget_info_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, H5A_info_t *ainfo,
|
|
|
|
hid_t lapl_id)
|
2007-02-07 04:03:06 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj;
|
|
|
|
H5VL_loc_params_t loc_params;
|
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2007-02-07 04:03:06 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2007-03-09 00:57:36 +08:00
|
|
|
H5TRACE5("e", "i*s*s*xi", loc_id, obj_name, attr_name, ainfo, lapl_id);
|
2007-02-07 04:03:06 +08:00
|
|
|
|
|
|
|
/* Check args */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!attr_name || !*attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == ainfo)
|
2007-02-07 04:03:06 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
|
2007-02-07 04:03:06 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_NAME;
|
|
|
|
loc_params.loc_data.loc_by_name.name = obj_name;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
2018-10-10 23:10:15 +08:00
|
|
|
|
|
|
|
/* Get the object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
|
2007-02-07 04:03:06 +08:00
|
|
|
|
|
|
|
/* Get the attribute information */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
|
|
|
|
ainfo, attr_name) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
|
2007-02-07 04:03:06 +08:00
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
2007-02-21 21:20:46 +08:00
|
|
|
} /* end H5Aget_info_by_name() */
|
2007-02-07 04:03:06 +08:00
|
|
|
|
2007-02-09 02:50:21 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: H5Aget_info_by_idx
|
|
|
|
*
|
|
|
|
* Purpose: Retrieve information about an attribute, according to the
|
|
|
|
* order within an index.
|
|
|
|
*
|
|
|
|
* Return: Success: Non-negative with information in AINFO
|
|
|
|
* Failure: Negative
|
|
|
|
*
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
* February 8, 2007
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
herr_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Aget_info_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
|
|
|
|
H5A_info_t *ainfo, hid_t lapl_id)
|
2007-02-09 02:50:21 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj;
|
|
|
|
H5VL_loc_params_t loc_params;
|
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2007-02-09 02:50:21 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2020-09-30 22:27:10 +08:00
|
|
|
H5TRACE7("e", "i*sIiIoh*xi", loc_id, obj_name, idx_type, order, n, ainfo, lapl_id);
|
2007-02-09 02:50:21 +08:00
|
|
|
|
|
|
|
/* Check args */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == ainfo)
|
2007-02-09 02:50:21 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid info pointer")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
|
2007-02-09 02:50:21 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_IDX;
|
|
|
|
loc_params.loc_data.loc_by_idx.name = obj_name;
|
|
|
|
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
|
|
|
|
loc_params.loc_data.loc_by_idx.order = order;
|
|
|
|
loc_params.loc_data.loc_by_idx.n = n;
|
|
|
|
loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
|
|
|
|
|
|
|
/* Get the object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
|
2007-02-09 02:50:21 +08:00
|
|
|
|
|
|
|
/* Get the attribute information */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_get(vol_obj, H5VL_ATTR_GET_INFO, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL, &loc_params,
|
|
|
|
ainfo) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to get attribute info")
|
2007-02-09 02:50:21 +08:00
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* end H5Aget_info_by_idx() */
|
|
|
|
|
2002-10-30 00:37:49 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
2018-09-25 03:23:41 +08:00
|
|
|
* Function: H5Arename
|
[svn-r14219] Description:
Change H5Arename2 -> H5Arename_by_name and un-deprecate H5Arename1 back
to H5Arename.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:03:28 +08:00
|
|
|
*
|
|
|
|
* Purpose: Rename an attribute
|
|
|
|
*
|
2020-08-18 00:12:59 +08:00
|
|
|
* Return: Success: Non-negative
|
|
|
|
* Failure: Negative
|
[svn-r14219] Description:
Change H5Arename2 -> H5Arename_by_name and un-deprecate H5Arename1 back
to H5Arename.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:03:28 +08:00
|
|
|
*
|
|
|
|
* Programmer: Raymond Lu
|
|
|
|
* October 23, 2002
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
herr_t
|
|
|
|
H5Arename(hid_t loc_id, const char *old_name, const char *new_name)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
[svn-r14219] Description:
Change H5Arename2 -> H5Arename_by_name and un-deprecate H5Arename1 back
to H5Arename.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:03:28 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
[svn-r14219] Description:
Change H5Arename2 -> H5Arename_by_name and un-deprecate H5Arename1 back
to H5Arename.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:03:28 +08:00
|
|
|
H5TRACE3("e", "i*s*s", loc_id, old_name, new_name);
|
|
|
|
|
2020-08-18 00:12:59 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!old_name)
|
2018-12-18 04:25:55 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be NULL")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!*old_name)
|
2018-12-18 04:25:55 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "old attribute name cannot be an empty string")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!new_name)
|
2018-12-18 04:25:55 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be NULL")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!*new_name)
|
2018-12-18 04:25:55 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "new attribute name cannot be an empty string")
|
[svn-r14219] Description:
Change H5Arename2 -> H5Arename_by_name and un-deprecate H5Arename1 back
to H5Arename.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:03:28 +08:00
|
|
|
|
|
|
|
/* Avoid thrashing things if the names are the same */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp(old_name, new_name)) {
|
|
|
|
H5VL_object_t * vol_obj;
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_SELF;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
|
2014-07-23 03:54:51 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_loc(loc_id) < 0)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read")
|
2018-03-16 05:54:30 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Rename the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_RENAME, H5P_DATASET_XFER_DEFAULT,
|
|
|
|
H5_REQUEST_NULL, old_name, new_name) < 0)
|
[svn-r14219] Description:
Change H5Arename2 -> H5Arename_by_name and un-deprecate H5Arename1 back
to H5Arename.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:03:28 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute")
|
2018-10-29 09:51:16 +08:00
|
|
|
} /* end if */
|
[svn-r14219] Description:
Change H5Arename2 -> H5Arename_by_name and un-deprecate H5Arename1 back
to H5Arename.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:03:28 +08:00
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Arename() */
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
2018-09-25 03:23:41 +08:00
|
|
|
* Function: H5Arename_by_name
|
2002-10-30 00:37:49 +08:00
|
|
|
*
|
2005-08-14 04:53:35 +08:00
|
|
|
* Purpose: Rename an attribute
|
2002-10-30 00:37:49 +08:00
|
|
|
*
|
2020-08-18 00:12:59 +08:00
|
|
|
* Return: Success: Non-negative
|
|
|
|
* Failure: Negative
|
2002-10-30 00:37:49 +08:00
|
|
|
*
|
2007-02-21 10:24:25 +08:00
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
* February 20, 2007
|
2002-10-30 00:37:49 +08:00
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
herr_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Arename_by_name(hid_t loc_id, const char *obj_name, const char *old_attr_name, const char *new_attr_name,
|
|
|
|
hid_t lapl_id)
|
2002-10-30 00:37:49 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2020-09-30 22:27:10 +08:00
|
|
|
H5TRACE5("e", "i*s*s*si", loc_id, obj_name, old_attr_name, new_attr_name, lapl_id);
|
2002-10-30 00:37:49 +08:00
|
|
|
|
|
|
|
/* check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!old_attr_name || !*old_attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no old attribute name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!new_attr_name || !*new_attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no new attribute name")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2007-01-31 09:48:28 +08:00
|
|
|
/* Avoid thrashing things if the names are the same */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (HDstrcmp(old_attr_name, new_attr_name)) {
|
|
|
|
H5VL_object_t * vol_obj;
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2016-02-07 23:37:33 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
|
2014-07-23 03:54:51 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_NAME;
|
|
|
|
loc_params.loc_data.loc_by_name.name = obj_name;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
2018-10-10 23:10:15 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Get the location object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
|
2014-07-23 03:54:51 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Rename the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_RENAME, H5P_DATASET_XFER_DEFAULT,
|
|
|
|
H5_REQUEST_NULL, old_attr_name, new_attr_name) < 0)
|
2007-01-31 09:48:28 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute")
|
2018-10-29 09:51:16 +08:00
|
|
|
} /* end if */
|
2002-10-30 00:37:49 +08:00
|
|
|
|
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
[svn-r14219] Description:
Change H5Arename2 -> H5Arename_by_name and un-deprecate H5Arename1 back
to H5Arename.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:03:28 +08:00
|
|
|
} /* H5Arename_by_name() */
|
2002-10-30 00:37:49 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
2007-02-21 03:58:09 +08:00
|
|
|
H5Aiterate2
|
1998-04-24 06:24:38 +08:00
|
|
|
PURPOSE
|
|
|
|
Calls a user's function for each attribute on an object
|
[svn-r14220] Description:
Change H5Aiterate2 -> H5Aiterate_by_name to be more consistent with
other new API routine names
Re-add H5Aiterate2, to operate on a particular object
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:52:05 +08:00
|
|
|
USAGE
|
|
|
|
herr_t H5Aiterate2(loc_id, idx_type, order, idx, op, op_data)
|
|
|
|
hid_t loc_id; IN: Base location for object
|
|
|
|
H5_index_t idx_type; IN: Type of index to use
|
|
|
|
H5_iter_order_t order; IN: Order to iterate over index
|
|
|
|
hsize_t *idx; IN/OUT: Starting (IN) & Ending (OUT) attribute
|
|
|
|
in index & order
|
|
|
|
H5A_operator2_t op; IN: User's function to pass each attribute to
|
|
|
|
void *op_data; IN/OUT: User's data to pass through to iterator
|
|
|
|
operator function
|
|
|
|
RETURNS
|
|
|
|
Returns a negative value if an error occurs, the return value of the
|
|
|
|
last operator if it was non-zero (which can be a negative value), or zero
|
|
|
|
if all attributes were processed.
|
|
|
|
|
|
|
|
DESCRIPTION
|
|
|
|
This function interates over the attributes of dataset or group
|
|
|
|
specified with 'loc_id' & 'obj_name'. For each attribute of the object,
|
|
|
|
the 'op_data' and some additional information (specified below) are passed
|
|
|
|
to the 'op' function. The iteration begins with the '*idx'
|
|
|
|
object in the group and the next attribute to be processed by the operator
|
|
|
|
is returned in '*idx'.
|
|
|
|
The operation receives the ID for the group or dataset being iterated
|
|
|
|
over ('loc_id'), the name of the current attribute about the object
|
|
|
|
('attr_name'), the attribute's "info" struct ('ainfo') and the pointer to
|
|
|
|
the operator data passed in to H5Aiterate2 ('op_data'). The return values
|
|
|
|
from an operator are:
|
|
|
|
A. Zero causes the iterator to continue, returning zero when all
|
|
|
|
attributes have been processed.
|
|
|
|
B. Positive causes the iterator to immediately return that positive
|
|
|
|
value, indicating short-circuit success. The iterator can be
|
|
|
|
restarted at the next attribute.
|
|
|
|
C. Negative causes the iterator to immediately return that value,
|
|
|
|
indicating failure. The iterator can be restarted at the next
|
|
|
|
attribute.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
herr_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Aiterate2(hid_t loc_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5A_operator2_t op,
|
|
|
|
void *op_data)
|
[svn-r14220] Description:
Change H5Aiterate2 -> H5Aiterate_by_name to be more consistent with
other new API routine names
Re-add H5Aiterate2, to operate on a particular object
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:52:05 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj = NULL; /* object of loc_id */
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value; /* Return value */
|
[svn-r14220] Description:
Change H5Aiterate2 -> H5Aiterate_by_name to be more consistent with
other new API routine names
Re-add H5Aiterate2, to operate on a particular object
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:52:05 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2007-11-06 06:13:43 +08:00
|
|
|
H5TRACE6("e", "iIiIo*hx*x", loc_id, idx_type, order, idx, op, op_data);
|
[svn-r14220] Description:
Change H5Aiterate2 -> H5Aiterate_by_name to be more consistent with
other new API routine names
Re-add H5Aiterate2, to operate on a particular object
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:52:05 +08:00
|
|
|
|
|
|
|
/* check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
|
[svn-r14220] Description:
Change H5Aiterate2 -> H5Aiterate_by_name to be more consistent with
other new API routine names
Re-add H5Aiterate2, to operate on a particular object
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:52:05 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_SELF;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
|
|
|
|
|
|
|
/* get the loc object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Iterate over attributes */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_ITER, H5P_DATASET_XFER_DEFAULT,
|
|
|
|
H5_REQUEST_NULL, (int)idx_type, (int)order, idx, op, op_data)) < 0)
|
2018-10-10 23:10:15 +08:00
|
|
|
HERROR(H5E_ATTR, H5E_BADITER, "error iterating over attributes");
|
[svn-r14220] Description:
Change H5Aiterate2 -> H5Aiterate_by_name to be more consistent with
other new API routine names
Re-add H5Aiterate2, to operate on a particular object
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:52:05 +08:00
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Aiterate2() */
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Aiterate_by_name
|
|
|
|
PURPOSE
|
|
|
|
Calls a user's function for each attribute on an object
|
1998-04-24 06:24:38 +08:00
|
|
|
USAGE
|
2007-02-21 03:58:09 +08:00
|
|
|
herr_t H5Aiterate2(loc_id, obj_name, idx_type, order, idx, op, op_data, lapl_id)
|
|
|
|
hid_t loc_id; IN: Base location for object
|
|
|
|
const char *obj_name; IN: Name of object relative to location
|
|
|
|
H5_index_t idx_type; IN: Type of index to use
|
|
|
|
H5_iter_order_t order; IN: Order to iterate over index
|
|
|
|
hsize_t *idx; IN/OUT: Starting (IN) & Ending (OUT) attribute
|
|
|
|
in index & order
|
|
|
|
H5A_operator2_t op; IN: User's function to pass each attribute to
|
|
|
|
void *op_data; IN/OUT: User's data to pass through to iterator
|
|
|
|
operator function
|
|
|
|
hid_t lapl_id; IN: Link access property list
|
1998-04-24 06:24:38 +08:00
|
|
|
RETURNS
|
2007-02-21 03:58:09 +08:00
|
|
|
Returns a negative value if an error occurs, the return value of the
|
|
|
|
last operator if it was non-zero (which can be a negative value), or zero
|
|
|
|
if all attributes were processed.
|
2005-08-14 04:53:35 +08:00
|
|
|
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
|
|
|
This function interates over the attributes of dataset or group
|
2007-02-21 03:58:09 +08:00
|
|
|
specified with 'loc_id' & 'obj_name'. For each attribute of the object,
|
|
|
|
the 'op_data' and some additional information (specified below) are passed
|
|
|
|
to the 'op' function. The iteration begins with the '*idx'
|
1998-04-24 06:24:38 +08:00
|
|
|
object in the group and the next attribute to be processed by the operator
|
2007-02-21 03:58:09 +08:00
|
|
|
is returned in '*idx'.
|
1998-04-24 06:24:38 +08:00
|
|
|
The operation receives the ID for the group or dataset being iterated
|
|
|
|
over ('loc_id'), the name of the current attribute about the object
|
2007-02-21 03:58:09 +08:00
|
|
|
('attr_name'), the attribute's "info" struct ('ainfo') and the pointer to
|
[svn-r14220] Description:
Change H5Aiterate2 -> H5Aiterate_by_name to be more consistent with
other new API routine names
Re-add H5Aiterate2, to operate on a particular object
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:52:05 +08:00
|
|
|
the operator data passed in to H5Aiterate_by_name ('op_data'). The return values
|
2007-02-21 03:58:09 +08:00
|
|
|
from an operator are:
|
2005-08-14 04:53:35 +08:00
|
|
|
A. Zero causes the iterator to continue, returning zero when all
|
1998-04-24 06:24:38 +08:00
|
|
|
attributes have been processed.
|
|
|
|
B. Positive causes the iterator to immediately return that positive
|
|
|
|
value, indicating short-circuit success. The iterator can be
|
|
|
|
restarted at the next attribute.
|
|
|
|
C. Negative causes the iterator to immediately return that value,
|
|
|
|
indicating failure. The iterator can be restarted at the next
|
|
|
|
attribute.
|
|
|
|
--------------------------------------------------------------------------*/
|
2000-04-13 05:09:38 +08:00
|
|
|
herr_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Aiterate_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order,
|
|
|
|
hsize_t *idx, H5A_operator2_t op, void *op_data, hid_t lapl_id)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj = NULL; /* Object location */
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2020-09-30 22:27:10 +08:00
|
|
|
H5TRACE8("e", "i*sIiIo*hx*xi", loc_id, obj_name, idx_type, order, idx, op, op_data, lapl_id);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2020-08-18 00:12:59 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
|
2007-02-21 03:58:09 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_NAME;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
|
|
|
loc_params.loc_data.loc_by_name.name = obj_name;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
|
|
|
|
|
|
|
|
/* get the loc object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid location identifier")
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Iterate over attributes */
|
2020-09-30 22:27:10 +08:00
|
|
|
if ((ret_value = H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_ITER, H5P_DATASET_XFER_DEFAULT,
|
|
|
|
H5_REQUEST_NULL, (int)idx_type, (int)order, idx, op, op_data)) < 0)
|
2018-10-10 23:10:15 +08:00
|
|
|
HERROR(H5E_ATTR, H5E_BADITER, "attribute iteration failed");
|
2002-08-09 00:52:55 +08:00
|
|
|
|
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
[svn-r14220] Description:
Change H5Aiterate2 -> H5Aiterate_by_name to be more consistent with
other new API routine names
Re-add H5Aiterate2, to operate on a particular object
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 03:52:05 +08:00
|
|
|
} /* H5Aiterate_by_name() */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
[svn-r14222] Description:
Change H5Adelete2 -> H5Adelete_by_name and un-deprecate H5Adelete1 back
to H5Adelete, for better consistency with new other API routiens.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 04:37:39 +08:00
|
|
|
H5Adelete
|
1998-04-24 06:24:38 +08:00
|
|
|
PURPOSE
|
|
|
|
Deletes an attribute from a location
|
|
|
|
USAGE
|
[svn-r14222] Description:
Change H5Adelete2 -> H5Adelete_by_name and un-deprecate H5Adelete1 back
to H5Adelete, for better consistency with new other API routiens.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 04:37:39 +08:00
|
|
|
herr_t H5Adelete(loc_id, name)
|
|
|
|
hid_t loc_id; IN: Object (dataset or group) to have attribute deleted from
|
|
|
|
const char *name; IN: Name of attribute to delete
|
|
|
|
RETURNS
|
|
|
|
Non-negative on success/Negative on failure
|
|
|
|
DESCRIPTION
|
|
|
|
This function removes the named attribute from a dataset or group.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
herr_t
|
|
|
|
H5Adelete(hid_t loc_id, const char *name)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj = NULL;
|
|
|
|
H5VL_loc_params_t loc_params;
|
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
[svn-r14222] Description:
Change H5Adelete2 -> H5Adelete_by_name and un-deprecate H5Adelete1 back
to H5Adelete, for better consistency with new other API routiens.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 04:37:39 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
[svn-r14222] Description:
Change H5Adelete2 -> H5Adelete_by_name and un-deprecate H5Adelete1 back
to H5Adelete, for better consistency with new other API routiens.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 04:37:39 +08:00
|
|
|
H5TRACE2("e", "i*s", loc_id, name);
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be NULL")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!*name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "name parameter cannot be an empty string")
|
[svn-r14222] Description:
Change H5Adelete2 -> H5Adelete_by_name and un-deprecate H5Adelete1 back
to H5Adelete, for better consistency with new other API routiens.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 04:37:39 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_loc(loc_id) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set collective metadata read")
|
2018-03-16 05:54:30 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* Fill in location struct fields */
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_SELF;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
2018-10-10 23:10:15 +08:00
|
|
|
|
|
|
|
/* Get the object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Delete the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_DELETE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
|
|
|
|
name) < 0)
|
[svn-r14222] Description:
Change H5Adelete2 -> H5Adelete_by_name and un-deprecate H5Adelete1 back
to H5Adelete, for better consistency with new other API routiens.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 04:37:39 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
|
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Adelete() */
|
|
|
|
|
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Adelete_by_name
|
|
|
|
PURPOSE
|
|
|
|
Deletes an attribute from a location
|
|
|
|
USAGE
|
|
|
|
herr_t H5Adelete_by_name(loc_id, obj_name, attr_name, lapl_id)
|
2007-02-21 00:00:24 +08:00
|
|
|
hid_t loc_id; IN: Base location for object
|
|
|
|
const char *obj_name; IN: Name of object relative to location
|
|
|
|
const char *attr_name; IN: Name of attribute to delete
|
|
|
|
hid_t lapl_id; IN: Link access property list
|
1998-04-24 06:24:38 +08:00
|
|
|
RETURNS
|
1998-10-27 05:18:54 +08:00
|
|
|
Non-negative on success/Negative on failure
|
1998-04-24 06:24:38 +08:00
|
|
|
DESCRIPTION
|
2007-02-21 00:00:24 +08:00
|
|
|
This function removes the named attribute from an object.
|
1998-04-24 06:24:38 +08:00
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
herr_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Adelete_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj;
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2007-03-09 00:57:36 +08:00
|
|
|
H5TRACE4("e", "i*s*si", loc_id, obj_name, attr_name, lapl_id);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!attr_name || !*attr_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* Fill in location struct fields */
|
|
|
|
loc_params.type = H5VL_OBJECT_BY_NAME;
|
|
|
|
loc_params.loc_data.loc_by_name.name = obj_name;
|
|
|
|
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
|
|
|
|
|
|
|
/* Get the object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Delete the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_DELETE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
|
|
|
|
attr_name) < 0)
|
2006-12-12 08:42:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
|
2005-08-14 04:53:35 +08:00
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
[svn-r14222] Description:
Change H5Adelete2 -> H5Adelete_by_name and un-deprecate H5Adelete1 back
to H5Adelete, for better consistency with new other API routiens.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
2007-10-31 04:37:39 +08:00
|
|
|
} /* H5Adelete_by_name() */
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2007-02-20 10:28:41 +08:00
|
|
|
/*--------------------------------------------------------------------------
|
|
|
|
NAME
|
|
|
|
H5Adelete_by_idx
|
|
|
|
PURPOSE
|
|
|
|
Deletes an attribute from a location, according to the order within an index
|
|
|
|
USAGE
|
|
|
|
herr_t H5Adelete_by_idx(loc_id, obj_name, idx_type, order, n, lapl_id)
|
|
|
|
hid_t loc_id; IN: Base location for object
|
|
|
|
const char *obj_name; IN: Name of object relative to location
|
|
|
|
H5_index_t idx_type; IN: Type of index to use
|
|
|
|
H5_iter_order_t order; IN: Order to iterate over index
|
|
|
|
hsize_t n; IN: Offset within index
|
|
|
|
hid_t lapl_id; IN: Link access property list
|
|
|
|
RETURNS
|
|
|
|
Non-negative on success/Negative on failure
|
|
|
|
DESCRIPTION
|
|
|
|
This function removes an attribute from an object, using the IDX_TYPE
|
|
|
|
index to delete the N'th attribute in ORDER direction in the index. The
|
|
|
|
object is specified relative to the LOC_ID with the OBJ_NAME path. To
|
|
|
|
remove an attribute on the object specified by LOC_ID, pass in "." for
|
|
|
|
OBJ_NAME. The link access property list, LAPL_ID, controls aspects of
|
|
|
|
the group hierarchy traversal when using the OBJ_NAME to locate the final
|
|
|
|
object to operate on.
|
|
|
|
--------------------------------------------------------------------------*/
|
|
|
|
herr_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Adelete_by_idx(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
|
|
|
|
hid_t lapl_id)
|
2007-02-20 10:28:41 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj;
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2007-02-20 10:28:41 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2007-03-09 00:57:36 +08:00
|
|
|
H5TRACE6("e", "i*sIiIohi", loc_id, obj_name, idx_type, order, n, lapl_id);
|
2007-02-20 10:28:41 +08:00
|
|
|
|
|
|
|
/* check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (idx_type <= H5_INDEX_UNKNOWN || idx_type >= H5_INDEX_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid index type specified")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (order <= H5_ITER_UNKNOWN || order >= H5_ITER_N)
|
2018-09-25 03:23:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "invalid iteration order specified")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, TRUE) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
|
2007-02-20 10:28:41 +08:00
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_IDX;
|
|
|
|
loc_params.loc_data.loc_by_idx.name = obj_name;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.loc_data.loc_by_idx.idx_type = idx_type;
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.loc_data.loc_by_idx.order = order;
|
|
|
|
loc_params.loc_data.loc_by_idx.n = n;
|
|
|
|
loc_params.loc_data.loc_by_idx.lapl_id = lapl_id;
|
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
2018-10-10 23:10:15 +08:00
|
|
|
|
|
|
|
/* get the object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
|
|
|
|
|
2020-08-18 00:12:59 +08:00
|
|
|
/* Delete the attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_DELETE, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
|
|
|
|
NULL) < 0)
|
2007-02-20 10:28:41 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTDELETE, FAIL, "unable to delete attribute")
|
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Adelete_by_idx() */
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: H5Aclose
|
|
|
|
*
|
|
|
|
* Purpose: Closes access to an attribute and releases resources used by
|
|
|
|
* it. It is illegal to subsequently use that same dataset
|
|
|
|
* ID in calls to other attribute functions.
|
|
|
|
*
|
|
|
|
* Return: SUCCEED/FAIL
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
1998-04-24 06:24:38 +08:00
|
|
|
herr_t
|
1998-08-28 00:48:50 +08:00
|
|
|
H5Aclose(hid_t attr_id)
|
1998-04-24 06:24:38 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
herr_t ret_value = SUCCEED; /* Return value */
|
2002-08-09 00:52:55 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
2006-12-19 03:16:17 +08:00
|
|
|
H5TRACE1("e", "i", attr_id);
|
1998-04-24 06:24:38 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == H5I_object_verify(attr_id, H5I_ATTR))
|
2003-07-09 05:05:27 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not an attribute")
|
1998-04-24 06:24:38 +08:00
|
|
|
|
1998-04-28 21:59:08 +08:00
|
|
|
/* Decrement references to that atom (and close it) */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_dec_app_ref(attr_id) < 0)
|
2003-07-09 05:05:27 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTDEC, FAIL, "can't close attribute")
|
2002-08-01 03:17:12 +08:00
|
|
|
|
2002-08-09 00:52:55 +08:00
|
|
|
done:
|
2003-07-09 05:05:27 +08:00
|
|
|
FUNC_LEAVE_API(ret_value)
|
1998-04-24 06:24:38 +08:00
|
|
|
} /* H5Aclose() */
|
|
|
|
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: H5Aexists
|
|
|
|
*
|
|
|
|
* Purpose: Checks if an attribute with a given name exists on an opened
|
|
|
|
* object.
|
|
|
|
*
|
|
|
|
* Return: Success: TRUE/FALSE
|
|
|
|
* Failure: Negative
|
|
|
|
*
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
* Thursday, November 1, 2007
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
htri_t
|
|
|
|
H5Aexists(hid_t obj_id, const char *attr_name)
|
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj;
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
htri_t ret_value; /* Return value */
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
H5TRACE2("t", "i*s", obj_id, attr_name);
|
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(obj_id))
|
2017-12-01 01:56:43 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!attr_name || !*attr_name)
|
2017-12-01 01:56:43 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name")
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* get the object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(obj_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_SELF;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.obj_type = H5I_get_type(obj_id);
|
|
|
|
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
/* Check if the attribute exists */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_EXISTS, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
|
|
|
|
attr_name, &ret_value) < 0)
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists")
|
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Aexists() */
|
|
|
|
|
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
* Function: H5Aexists_by_name
|
|
|
|
*
|
|
|
|
* Purpose: Checks if an attribute with a given name exists on an object.
|
|
|
|
*
|
|
|
|
* Return: Success: TRUE/FALSE
|
|
|
|
* Failure: Negative
|
|
|
|
*
|
|
|
|
* Programmer: Quincey Koziol
|
|
|
|
* Thursday, November 1, 2007
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
htri_t
|
2020-09-30 22:27:10 +08:00
|
|
|
H5Aexists_by_name(hid_t loc_id, const char *obj_name, const char *attr_name, hid_t lapl_id)
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
{
|
2020-09-30 22:27:10 +08:00
|
|
|
H5VL_object_t * vol_obj;
|
2018-10-10 23:10:15 +08:00
|
|
|
H5VL_loc_params_t loc_params;
|
2020-09-30 22:27:10 +08:00
|
|
|
htri_t ret_value; /* Return value */
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
|
2012-02-09 11:13:27 +08:00
|
|
|
FUNC_ENTER_API(FAIL)
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
H5TRACE4("t", "i*s*si", loc_id, obj_name, attr_name, lapl_id);
|
|
|
|
|
|
|
|
/* check arguments */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5I_ATTR == H5I_get_type(loc_id))
|
2017-12-01 01:56:43 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "location is not valid for an attribute")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!obj_name || !*obj_name)
|
2017-12-01 01:56:43 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no object name")
|
2020-09-30 22:27:10 +08:00
|
|
|
if (!attr_name || !*attr_name)
|
2017-12-01 01:56:43 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no attribute name")
|
2016-01-16 07:08:10 +08:00
|
|
|
|
2018-03-19 11:51:19 +08:00
|
|
|
/* Verify access property list and set up collective metadata if appropriate */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5CX_set_apl(&lapl_id, H5P_CLS_LACC, loc_id, FALSE) < 0)
|
2018-03-19 11:51:19 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTSET, FAIL, "can't set access property list info")
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
|
2018-10-10 23:10:15 +08:00
|
|
|
/* get the object */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (NULL == (vol_obj = H5VL_vol_object(loc_id)))
|
2018-10-10 23:10:15 +08:00
|
|
|
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "invalid object identifier")
|
|
|
|
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.type = H5VL_OBJECT_BY_NAME;
|
|
|
|
loc_params.loc_data.loc_by_name.name = obj_name;
|
2018-10-10 23:10:15 +08:00
|
|
|
loc_params.loc_data.loc_by_name.lapl_id = lapl_id;
|
2020-09-30 22:27:10 +08:00
|
|
|
loc_params.obj_type = H5I_get_type(loc_id);
|
2018-10-10 23:10:15 +08:00
|
|
|
|
2018-09-25 03:23:41 +08:00
|
|
|
/* Check existence of attribute */
|
2020-09-30 22:27:10 +08:00
|
|
|
if (H5VL_attr_specific(vol_obj, &loc_params, H5VL_ATTR_EXISTS, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL,
|
|
|
|
attr_name, &ret_value) < 0)
|
[svn-r14234] Description:
Add H5Aexists and H5Aexists_by_name API routines, to match H5Lexists.
Tested on:
FreeBSD/32 6.2 (duty) in debug mode
FreeBSD/64 6.2 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/default API=1.6.x, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Mac OS X/32 10.4.10 (amazon) in debug mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
2007-11-02 06:19:04 +08:00
|
|
|
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, FAIL, "unable to determine if attribute exists")
|
|
|
|
|
|
|
|
done:
|
|
|
|
FUNC_LEAVE_API(ret_value)
|
|
|
|
} /* H5Aexists_by_name() */
|