summaryrefslogtreecommitdiffstats
path: root/src/H5A.c
diff options
context:
space:
mode:
authorRobb Matzke <matzke@llnl.gov>1998-06-17 20:46:29 (GMT)
committerRobb Matzke <matzke@llnl.gov>1998-06-17 20:46:29 (GMT)
commit22538a0c799bcb82b40346849776e354fbc18fee (patch)
treedcefb55f7e1a6632c89fdd8592588747f16fa9e1 /src/H5A.c
parent53916f4e5935ae7c36d7dd6e04d1c5e51b7e78ea (diff)
downloadhdf5-22538a0c799bcb82b40346849776e354fbc18fee.zip
hdf5-22538a0c799bcb82b40346849776e354fbc18fee.tar.gz
hdf5-22538a0c799bcb82b40346849776e354fbc18fee.tar.bz2
[svn-r429] Changes since 19980616
---------------------- ./html/tracing.html NEW This entire update is to make it possible for the library to print the name, arguments, and return value of every API call without requiring any extra work from developers or app programmers. This file describes how this all works. ./configure.in Added the `--enable-tracing' switch. If you use it then the library will include code to print API function names, argument names and values, and function return values. However, you must then turn on the tracing by setting the HDF5_TRACE environment variable to a file descriptor number. The default is `--disable-tracing' since enabling it causes a slight increase in library size and a slowdown resulting from an extra function call for each API function call (I couldn't even measure the slowdown :-) ./bin/trace NEW A perl script that synchronizes the H5TRACE() macro calls in the *.c files with the function return type and formal argument names and types. If you use GNU make and gcc then this will be done automatically, otherwise just invoke this script with the names of one or more .c files. You could do it by hand to, but encoding argument types is a little tricky at first. ./config/commence.in Added the $(TRACE) macro, which defaults to the no-op. Added -D_POSIX_SOURCE to the compiler command line. ./src/Makefile.in Override the default for $(TRACE). ./config/depend.in Automatically calls $(TRACE) to synchronize the H5TRACE() macros in any source file that changed. As with makefile dependencies, one way to force synchronization of all files is to remove the `.depend' file. ./MANIFEST Added new files. ./src/H5Eprivate.h Modified HRETURN_ERROR() and HRETURN() for tracing. ./src/H5.c ./src/H5private.h This is where the real tracing work really happens, in H5_trace(). ./src/H5A.c ./src/H5D.c ./src/H5G.c ./src/H5P.c ./src/H5S.c ./src/H5Z.c Added H5TRACE() calls to all API functions. You don't really need these changes if you don't want to merge your stuff because they can be generated automatically by going to the hdf5/src directory and saying ../bin/trace *.c ./src/H5T.c Added H5TRACE() calls. Other stuff below. ./src/H5E.c ./src/H5Epublic.h Added H5TRACE() calls. Created a type H5E_auto_t for the `func' argument of H5Eset_auto() and H5Eget_auto() to make those arguments easier to parse for tracing. It should also make it clearer for users that don't know how to read complicated ANSI data types. ./src/H5F.c Added H5TRACE() calls. Changed a couple `uintn' argument types in API functions to `unsigned int' since `uintn' part of the API. Changed a few "can't" and "cant" error messages to "unable to". ./src/H5Ipublic.h Removed H5_DIRECTORY from the H5I_group_t enum. It wasn't used anywhere. ./src/H5Tconv.c Removed an unused label. ./src/H5Fistore.c ./src/H5Oattr.c ./src/H5Odtype.c ./src/H5T.c ./test/dsets.c ./test/dtypes.c Fixed a warning about a variable possibly used before it's initialized. Added __unused__ to turn off some unused argument warnings that pop up when debugging is turned off and optimizations are turned on.
Diffstat (limited to 'src/H5A.c')
-rw-r--r--src/H5A.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/src/H5A.c b/src/H5A.c
index efe8b2d..9a12ffb 100644
--- a/src/H5A.c
+++ b/src/H5A.c
@@ -150,8 +150,8 @@ H5A_term_interface(void)
*
--------------------------------------------------------------------------*/
hid_t
-H5Acreate(hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace,
- hid_t create_plist)
+H5Acreate (hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace,
+ hid_t create_plist)
{
void *obj = NULL;
H5G_entry_t *ent = NULL;
@@ -161,6 +161,7 @@ H5Acreate(hid_t loc_id, const char *name, hid_t datatype, hid_t dataspace,
hid_t ret_value = FAIL;
FUNC_ENTER(H5Acreate, FAIL);
+ H5TRACE5("i","isiii",loc_id,name,datatype,dataspace,create_plist);
/* check arguments */
if (NULL==(obj=H5I_object (loc_id))) {
@@ -399,7 +400,7 @@ H5A_get_index(H5G_entry_t *ent, const char *name)
* The LOC_ID can also be a named (committed) data type.
--------------------------------------------------------------------------*/
hid_t
-H5Aopen_name(hid_t loc_id, const char *name)
+H5Aopen_name (hid_t loc_id, const char *name)
{
H5G_entry_t *ent = NULL; /*Symtab entry of object to attribute*/
void *obj = NULL;
@@ -407,6 +408,7 @@ H5Aopen_name(hid_t loc_id, const char *name)
hid_t ret_value = FAIL;
FUNC_ENTER(H5Aopen_name, FAIL);
+ H5TRACE2("i","is",loc_id,name);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -475,13 +477,14 @@ H5Aopen_name(hid_t loc_id, const char *name)
*
--------------------------------------------------------------------------*/
hid_t
-H5Aopen_idx(hid_t loc_id, unsigned idx)
+H5Aopen_idx (hid_t loc_id, unsigned idx)
{
H5G_entry_t *ent = NULL; /*Symtab entry of object to attribute */
void *obj = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER(H5Aopen_idx, FAIL);
+ H5TRACE2("i","iIu",loc_id,idx);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -595,13 +598,14 @@ done:
This function writes a complete attribute to disk.
--------------------------------------------------------------------------*/
herr_t
-H5Awrite(hid_t attr_id, hid_t mem_dt, void *buf)
+H5Awrite (hid_t attr_id, hid_t mem_dt, void *buf)
{
H5A_t *attr = NULL;
const H5T_t *mem_type = NULL;
herr_t ret_value = FAIL;
FUNC_ENTER(H5Awrite, FAIL);
+ H5TRACE3("e","iix",attr_id,mem_dt,buf);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -762,13 +766,14 @@ done:
This function reads a complete attribute from disk.
--------------------------------------------------------------------------*/
herr_t
-H5Aread(hid_t attr_id, hid_t mem_dt, void *buf)
+H5Aread (hid_t attr_id, hid_t mem_dt, void *buf)
{
H5A_t *attr = NULL;
const H5T_t *mem_type = NULL;
herr_t ret_value = FAIL;
FUNC_ENTER(H5Aread, FAIL);
+ H5TRACE3("e","iix",attr_id,mem_dt,buf);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -913,13 +918,14 @@ done:
or resource leaks will develop.
--------------------------------------------------------------------------*/
hid_t
-H5Aget_space(hid_t attr_id)
+H5Aget_space (hid_t attr_id)
{
H5A_t *attr = NULL;
H5S_t *dst = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER(H5Aget_space, FAIL);
+ H5TRACE1("i","i",attr_id);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -969,13 +975,14 @@ H5Aget_space(hid_t attr_id)
* then the data type is closed.
--------------------------------------------------------------------------*/
hid_t
-H5Aget_type(hid_t attr_id)
+H5Aget_type (hid_t attr_id)
{
H5A_t *attr = NULL;
H5T_t *dst = NULL;
hid_t ret_value = FAIL;
FUNC_ENTER(H5Aget_type, FAIL);
+ H5TRACE1("i","i",attr_id);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -1033,13 +1040,14 @@ H5Aget_type(hid_t attr_id)
properly terminate the string.
--------------------------------------------------------------------------*/
size_t
-H5Aget_name(hid_t attr_id, char *buf, size_t buf_size)
+H5Aget_name (hid_t attr_id, char *buf, size_t buf_size)
{
H5A_t *attr = NULL;
size_t copy_len=0;
size_t ret_value = FAIL;
FUNC_ENTER(H5Aget_name, FAIL);
+ H5TRACE3("z","isz",attr_id,buf,buf_size);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) ||
@@ -1088,13 +1096,14 @@ H5Aget_name(hid_t attr_id, char *buf, size_t buf_size)
* The LOC_ID can also be a named (committed) data type.
--------------------------------------------------------------------------*/
int
-H5Anum_attrs(hid_t loc_id)
+H5Anum_attrs (hid_t loc_id)
{
H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */
void *obj = NULL;
int ret_value = 0;
FUNC_ENTER(H5Anum_attrs, FAIL);
+ H5TRACE1("Is","i",loc_id);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -1172,7 +1181,7 @@ H5Anum_attrs(hid_t loc_id)
*
--------------------------------------------------------------------------*/
int
-H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
+H5Aiterate (hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
{
H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */
void *obj = NULL;
@@ -1181,6 +1190,7 @@ H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
intn idx;
FUNC_ENTER(H5Aiterate, FAIL);
+ H5TRACE4("Is","i*Iuxx",loc_id,attr_num,op,op_data);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -1259,7 +1269,7 @@ H5Aiterate(hid_t loc_id, unsigned *attr_num, H5A_operator_t op, void *op_data)
*
--------------------------------------------------------------------------*/
herr_t
-H5Adelete(hid_t loc_id, const char *name)
+H5Adelete (hid_t loc_id, const char *name)
{
H5A_t found_attr;
H5G_entry_t *ent = NULL; /*symtab ent of object to attribute */
@@ -1268,6 +1278,7 @@ H5Adelete(hid_t loc_id, const char *name)
herr_t ret_value = FAIL;
FUNC_ENTER(H5Aopen_name, FAIL);
+ H5TRACE2("e","is",loc_id,name);
/* check arguments */
if(NULL == (obj = H5I_object(loc_id))) {
@@ -1342,9 +1353,10 @@ H5Adelete(hid_t loc_id, const char *name)
attribute ID will result in undefined behavior.
--------------------------------------------------------------------------*/
herr_t
-H5Aclose(hid_t attr_id)
+H5Aclose (hid_t attr_id)
{
FUNC_ENTER(H5Aclose, FAIL);
+ H5TRACE1("e","i",attr_id);
/* check arguments */
if (H5_ATTR != H5I_group(attr_id) || NULL == H5I_object(attr_id)) {