summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRaymond Lu <songyulu@hdfgroup.org>2003-07-11 21:04:38 (GMT)
committerRaymond Lu <songyulu@hdfgroup.org>2003-07-11 21:04:38 (GMT)
commit344eb1c83c19e552e281735782ec29d8b68d52df (patch)
tree05c370d16fa3adfc2c2a8580e030708b3e2d5ef4
parent01e9075358e6b1212d45dd13613203110c8f5373 (diff)
downloadhdf5-344eb1c83c19e552e281735782ec29d8b68d52df.zip
hdf5-344eb1c83c19e552e281735782ec29d8b68d52df.tar.gz
hdf5-344eb1c83c19e552e281735782ec29d8b68d52df.tar.bz2
[svn-r7212] Purpose: New error API design is being checked gradually.
Platforms tested: RH 8
-rw-r--r--src/H5E.c175
-rw-r--r--src/H5Eprivate.h157
-rw-r--r--src/H5Epublic.h177
-rw-r--r--src/H5Iprivate.h3
-rw-r--r--src/H5Ipublic.h3
-rw-r--r--src/H5Pfcpl.c4
-rw-r--r--test/errors.c29
7 files changed, 532 insertions, 16 deletions
diff --git a/src/H5E.c b/src/H5E.c
index 0607725..cd10b49 100644
--- a/src/H5E.c
+++ b/src/H5E.c
@@ -280,6 +280,39 @@ done:
}
#endif /* H5_HAVE_THREADSAFE */
+#ifndef NEW_ERR
+
+/*--------------------------------------------------------------------------
+ * Function: H5E_init_interface
+ *
+ * Purpose: Initialize interface-specific information
+ *
+ * Return: Non-negative on success/Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * Friday, July 11, 2003
+ *
+ *--------------------------------------------------------------------------
+ */
+static herr_t
+H5E_init_interface(void)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOINIT(H5E_init_interface);
+
+ /* Initialize the atom group for the dataset IDs */
+ H5I_init_group(H5I_ERROR_CLASS, H5I_ERRORCLS_HASHSIZE, H5E_RESERVED_ATOMS,
+ (H5I_free_t)H5E_unregister_class);
+
+ /* From the old function; take out later */
+ H5E_auto_data_g = stderr;
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+
+#else /* NEW_ERR */
/*-------------------------------------------------------------------------
* Function: H5E_init_interface
@@ -308,6 +341,147 @@ H5E_init_interface (void)
FUNC_LEAVE_NOAPI(SUCCEED);
}
+#endif /* NEW_ERR */
+
+#ifndef NEW_ERR
+
+/*-------------------------------------------------------------------------
+ * Function: H5Eregister_class
+ *
+ * Purpose: Registers an error class.
+ *
+ * Return: Non-negative value as class ID on success/Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * Friday, July 11, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5Eregister_class(const char *cls_name, const char *lib_name, const char *version)
+{
+ hid_t ret_value; /* Return value */
+
+ FUNC_ENTER_API(H5Eregister_class, FAIL);
+ H5TRACE3("i","sss",cls_name,lib_name,version);
+
+ /* Add HGOTO_ERROR later */
+ ret_value=H5E_register_class(cls_name, lib_name, version);
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+
+/*-------------------------------------------------------------------------
+ * Function: H5E_register_class
+ *
+ * Purpose: Private function to register an error class.
+ *
+ * Return: Non-negative value as class ID on success/Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * Friday, July 11, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5E_register_class(const char *cls_name, const char *lib_name, const char *version)
+{
+ hid_t ret_value; /* Return value */
+ H5E_cls_t *cls;
+
+ FUNC_ENTER_NOAPI(H5E_register_class, FAIL);
+
+ cls = HDmalloc(sizeof(H5E_cls_t));
+
+ cls->cls_name = (char*)HDmalloc(sizeof(char)*(HDstrlen(cls_name)+1));
+ HDstrcpy(cls->cls_name, cls_name);
+
+ cls->lib_name = HDmalloc(sizeof(char)*(strlen(lib_name)+1));
+ HDstrcpy(cls->lib_name, lib_name);
+
+ cls->lib_vers = HDmalloc(sizeof(char)*(strlen(version)+1));
+ HDstrcpy(cls->lib_vers, version);
+
+ /* Register the new error class to get an ID for it */
+ ret_value = H5I_register(H5I_ERROR_CLASS, cls);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+
+/*-------------------------------------------------------------------------
+ * Function: H5Eunregister_class
+ *
+ * Purpose: Closes an error class.
+ *
+ * Return: Non-negative value on success/Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * Friday, July 11, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5Eunregister_class(hid_t class_id)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+ H5E_cls_t *cls;
+
+ FUNC_ENTER_API(H5Eunregister_class, FAIL);
+ H5TRACE1("e","i",class_id);
+
+ cls = H5I_object_verify(class_id, H5I_ERROR_CLASS);
+
+ /*
+ * Decrement the counter on the dataset. It will be freed if the count
+ * reaches zero.
+ */
+ H5I_dec_ref(class_id);
+
+done:
+ FUNC_LEAVE_API(ret_value);
+}
+
+/*-------------------------------------------------------------------------
+ * Function: H5E_unregister_class
+ *
+ * Purpose: Private function to close an error class.
+ *
+ * Return: Non-negative value on success/Negative on failure
+ *
+ * Programmer: Raymond Lu
+ * Friday, July 11, 2003
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+hid_t
+H5E_unregister_class(H5E_cls_t *cls)
+{
+ herr_t ret_value = SUCCEED; /* Return value */
+
+ FUNC_ENTER_NOAPI(H5E_unregister_class, FAIL);
+
+ HDfree(cls->cls_name);
+ HDfree(cls->lib_name);
+ HDfree(cls->lib_vers);
+ HDfree(cls);
+
+done:
+ FUNC_LEAVE_NOAPI(ret_value);
+}
+
+#endif /* NEW_ERR */
+
+
/*-------------------------------------------------------------------------
@@ -837,4 +1011,3 @@ H5E_walk (H5E_direction_t direction, H5E_walk_t func, void *client_data)
done:
FUNC_LEAVE_NOAPI(ret_value);
}
-
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
index c5fb04e..228ebc0 100644
--- a/src/H5Eprivate.h
+++ b/src/H5Eprivate.h
@@ -25,6 +25,160 @@
#define H5E_NSLOTS 32 /*number of slots in an error stack */
+#ifndef NEW_ERR
+
+#define H5E_RESERVED_ATOMS 0
+#ifdef TMP
+/* HDF5 error class */
+#define H5E_CLS_NAME "HDF5"
+#define H5E_CLS_LIB_NAME "HDF5"
+#define H5E_CLS_LIB_VERS "" /* How to find out version number? */
+
+/* HDF5 error class: major errors */
+#define H5E_NONE_MAJOR_MSG "No error"
+#define H5E_ARGS_MSG "Function arguments"
+#define H5E_RESOURCE_MSG "Resource unavailable"
+#define H5E_INTERNAL_MSG "Internal HDF5 error"
+#define H5E_FILE_MSG "File interface"
+#define H5E_IO_MSG "Low-level I/O layer"
+#define H5E_FUNC_MSG "Function entry/exit"
+#define H5E_ATOM_MSG "Atom layer"
+#define H5E_CACHE_MSG "Meta data cache layer"
+#define H5E_BTREE_MSG "B-tree layer"
+#define H5E_SYM_MSG "Symbol table layer"
+#define H5E_HEAP_MSG "Heap layer"
+#define H5E_OHDR_MSG "Object header layer"
+#define H5E_DATATYPE_MSG "Datatype interface"
+#define H5E_DATASPACE_MSG "Dataspace interface"
+#define H5E_DATASET_MSG "Dataset interface"
+#define H5E_STORAGE_MSG "Data storage layer"
+#define H5E_PLIST_MSG "Property list interface"
+#define H5E_ATTR_MSG "Attribute layer"
+#define H5E_PLINE_MSG "Data filters layer"
+#define H5E_EFL_MSG "External file list"
+#define H5E_REFERENCE_MSG "References layer"
+#define H5E_VFL_MSG "Virtual File Layer"
+#define H5E_TBBT_MSG "Threaded, Balanced, Binary Trees"
+#define H5E_FPHDF5_MSG "Flexible Parallel HDF5"
+#define H5E_TST_MSG "Ternary Search Trees"
+#define H5E_RS_MSG "Reference Counted Strings"
+
+/* HDF5 error class: minor errors */
+#define H5E_NONE_MINOR "No error"
+
+ /* Argument errors */
+#define H5E_UNINITIALIZED_MSG "Information is uninitialized"
+#define H5E_UNSUPPORTED_MSG "Feature is unsupported"
+#define H5E_BADTYPE_MSG "Inappropriate type"
+#define H5E_BADRANGE_MSG "Out of range"
+#define H5E_BADVALUE_MSG "Bad value"
+
+ /* Resource errors */
+#define H5E_NOSPACE_MSG "No space available for allocation"
+#define H5E_CANTCOPY_MSG "Unable to copy object"
+#define H5E_CANTFREE_MSG "Unable to free object"
+#define H5E_ALREADYEXISTS_MSG "Object already exists"
+#define H5E_CANTLOCK_MSG "Unable to lock object"
+#define H5E_CANTUNLOCK_MSG "Unable to unlock object"
+#define H5E_CANTGC_MSG "Unable to garbage collect"
+
+ /* File accessability errors */
+#define H5E_FILEEXISTS_MSG "File already exists"
+#define H5E_FILEOPEN_MSG "File already open"
+#define H5E_CANTCREATE_MSG "Unable to create file"
+#define H5E_CANTOPENFILE_MSG "Unable to open file"
+#define H5E_CANTCLOSEFILE_MSG "Unable to close file"
+#define H5E_NOTHDF5_MSG "Not an HDF5 file"
+#define H5E_BADFILE_MSG "Bad file ID accessed"
+#define H5E_TRUNCATED_MSG "File has been truncated"
+#define H5E_MOUNT_MSG "File mount error"
+
+ /* Generic low-level file I/O errors */
+#define H5E_SEEKERROR_MSG "Seek failed"
+#define H5E_READERROR_MSG "Read failed"
+#define H5E_WRITEERROR_MSG "Write failed"
+#define H5E_CLOSEERROR_MSG "Close failed"
+#define H5E_OVERFLOW_MSG "Address overflowed"
+#define H5E_FCNTL_MSG "File control (fcntl) failed"
+
+ /* Function entry/exit interface errors */
+#define H5E_CANTINIT_MSG "Unable to initialize object"
+#define H5E_ALREADYINIT_MSG "Object already initialized"
+#define H5E_CANTRELEASE_MSG "Unable to release object"
+
+ /* Object atom related errors */
+#define H5E_BADATOM_MSG "Unable to find atom information (already closed?)"
+#define H5E_BADGROUP_MSG "Unable to find ID group information"
+#define H5E_CANTREGISTER_MSG "Unable to register new atom"
+#define H5E_CANTINC_MSG "Unable to increment reference count"
+#define H5E_CANTDEC_MSG "Unable to decrement reference count"
+#define H5E_NOIDS_MSG "Out of IDs for group"
+
+ /* Cache related errors */
+#define H5E_CANTFLUSH_MSG "Unable to flush data from cache"
+#define H5E_CANTLOAD_MSG "Unable to load meta data into cache"
+#define H5E_PROTECT_MSG "Protected meta data error"
+#define H5E_NOTCACHED_MSG "Meta data not currently cached"
+
+ /* B-tree related errors */
+#define H5E_NOTFOUND_MSG "Object not found"
+#define H5E_EXISTS_MSG "Object already exists"
+#define H5E_CANTENCODE_MSG "Unable to encode value"
+#define H5E_CANTDECODE_MSG "Unable to decode value"
+#define H5E_CANTSPLIT_MSG "Unable to split node"
+#define H5E_CANTINSERT_MSG "Unable to insert object"
+#define H5E_CANTLIST_MSG "Unable to list node"
+
+ /* Object header related errors */
+#define H5E_LINKCOUNT_MSG "Bad object header link count"
+#define H5E_VERSION_MSG "Wrong version number"
+#define H5E_ALIGNMENT_MSG "Alignment error"
+#define H5E_BADMESG_MSG "Unrecognized message"
+#define H5E_CANTDELETE_MSG "Can't delete message"
+
+ /* Group related errors */
+#define H5E_CANTOPENOBJ_MSG "Can't open object"
+#define H5E_COMPLEN_MSG "Name component is too long"
+#define H5E_CWG_MSG "Problem with current working group"
+#define H5E_LINK_MSG "Link count failure"
+#define H5E_SLINK_MSG "Symbolic link error"
+
+ /* Datatype conversion errors */
+#define H5E_CANTCONVERT_MSG "Can't convert datatypes"
+#define H5E_BADSIZE_MSG "Bad size for object"
+
+ /* Dataspace errors */
+#define H5E_CANTCLIP_MSG "Can't clip hyperslab region"
+#define H5E_CANTCOUNT_MSG "Can't count elements"
+#define H5E_CANTSELECT_MSG "Can't select hyperslab"
+#define H5E_CANTNEXT_MSG "Can't move to next iterator location"
+#define H5E_BADSELECT_MSG "Invalid selection"
+#define H5E_CANTCOMPARE_MSG "Can't compare objects"
+
+ /* Property list errors */
+#define H5E_CANTGET_MSG "Can't get value"
+#define H5E_CANTSET_MSG "Can't set value"
+#define H5E_DUPCLASS_MSG "Duplicate class name in parent class"
+
+ /* Parallel MPI errors */
+#define H5E_MPI_MSG "Some MPI function failed"
+#define H5E_MPIERRSTR_MSG "MPI Error String"
+
+ /* FPHDF5 errors */
+#define H5E_CANTMAKETREE_MSG "Can't create a binary tree node"
+#define H5E_CANTRECV_MSG "Can't receive messages from processes"
+#define H5E_CANTSENDMDATA_MSG "Can't send metadata message"
+#define H5E_CANTCHANGE_MSG "Can't register change with server"
+#define H5E_CANTALLOC_MSG "Can't allocate from file"
+
+ /* I/O pipeline errors */
+#define H5E_NOFILTER_MSG "Requested filter is not available"
+#define H5E_CALLBACK_MSG "Callback failed"
+#define H5E_CANAPPLY_MSG "Error from filter \"can apply\" callback"
+#define H5E_SETLOCAL_MSG "Error from filter \"set local\" callback"
+#endif /* TMP */
+#endif /* NEW_ERR */
+
/*
* HERROR macro, used to facilitate error reporting between a FUNC_ENTER()
* and a FUNC_LEAVE() within a function body. The arguments are the major
@@ -98,6 +252,9 @@ H5_DLLVAR const hbool_t H5E_clearable_g;/*safe to call H5E_clear() on enter?*/
H5_DLLVAR herr_t (*H5E_auto_g)(void *client_data);
H5_DLLVAR void *H5E_auto_data_g;
+H5_DLL hid_t H5E_register_class(const char *cls_name, const char *lib_name,
+ const char *version);
+H5_DLL hid_t H5E_unregister_class(H5E_cls_t *cls);
H5_DLL herr_t H5E_push (H5E_major_t maj_num, H5E_minor_t min_num,
const char *func_name, const char *file_name,
unsigned line, const char *desc);
diff --git a/src/H5Epublic.h b/src/H5Epublic.h
index ee61a9f..1cd8b09 100644
--- a/src/H5Epublic.h
+++ b/src/H5Epublic.h
@@ -24,6 +24,180 @@
#include "H5public.h"
#include "H5Ipublic.h"
+#ifndef NEW_ERR
+
+typedef struct H5E_cls_t {
+ char *cls_name;
+ const char *lib_name;
+ const char *lib_vers;
+} H5E_cls_t;
+
+typedef struct H5E_maj_t {
+ const char *mesg;
+ H5E_cls_t *cls;
+} H5E_maj_t;
+
+typedef struct H5E_min_t {
+ const char *mesg;
+ H5E_cls_t *cls;
+} H5E_min_t;
+
+typedef enum H5E_msg_t {
+ H5E_ERROR =-1,
+ H5E_MAJOR,
+ H5E_MINOR,
+ H5E_LIMIT
+} H5E_msg_t;
+
+/* HDF5 error class */
+hid_t HDF5_ERR_CLS;
+
+#ifdef TMP
+/* HDF5 error class: major errors. */
+hid_t H5E_NONE_MAJOR; /*special zero, no error */
+hid_t H5E_ARGS; /*invalid arguments to routine */
+hid_t H5E_RESOURCE; /*resource unavailable */
+hid_t H5E_INTERNAL; /* Internal error (too specific to document in detail) */
+hid_t H5E_FILE; /*file Accessability */
+hid_t H5E_IO; /*Low-level I/O */
+hid_t H5E_FUNC; /*function Entry/Exit */
+hid_t H5E_ATOM; /*object Atom */
+hid_t H5E_CACHE; /*object Cache */
+hid_t H5E_BTREE; /*B-Tree Node */
+hid_t H5E_SYM; /*symbol Table */
+hid_t H5E_HEAP; /*Heap */
+hid_t H5E_OHDR; /*object Header */
+hid_t H5E_DATATYPE; /*Datatype */
+hid_t H5E_DATASPACE; /*Dataspace */
+hid_t H5E_DATASET; /*Dataset */
+hid_t H5E_STORAGE; /*data storage */
+hid_t H5E_PLIST; /*Property lists */
+hid_t H5E_ATTR; /*Attribute */
+hid_t H5E_PLINE; /*Data filters */
+hid_t H5E_EFL; /*External file list */
+hid_t H5E_REFERENCE; /*References */
+hid_t H5E_VFL; /*Virtual File Layer */
+hid_t H5E_TBBT; /*Threaded, Balanced, Binary Trees */
+hid_t H5E_FPHDF5; /*Flexible Parallel HDF5 */
+hid_t H5E_TST; /*Ternary Search Trees */
+hid_t H5E_RS; /*Reference Counted Strings */
+
+
+/* HDF5 error class: minor errors. */
+hid_t H5E_NONE_MINOR; /*special zero, no error */
+hid_t H5E_UNINITIALIZED; /*information is unitialized */
+hid_t H5E_UNSUPPORTED; /*feature is unsupported */
+hid_t H5E_BADTYPE; /*incorrect type found */
+hid_t H5E_BADRANGE; /*argument out of range */
+hid_t H5E_BADVALUE; /*bad value for argument */
+
+ /* Resource errors */
+hid_t H5E_NOSPACE; /*no space available for allocation */
+hid_t H5E_CANTCOPY; /*unable to copy object */
+hid_t H5E_CANTFREE; /*unable to free object */
+hid_t H5E_ALREADYEXISTS; /*Object already exists */
+hid_t H5E_CANTLOCK; /*Unable to lock object */
+hid_t H5E_CANTUNLOCK; /*Unable to unlock object */
+hid_t H5E_CANTGC; /*Unable to garbage collect */
+
+ /* File accessability errors */
+hid_t H5E_FILEEXISTS; /*file already exists */
+hid_t H5E_FILEOPEN; /*file already open */
+hid_t H5E_CANTCREATE; /*Can't create file */
+hid_t H5E_CANTOPENFILE; /*Can't open file */
+hid_t H5E_CANTCLOSEFILE; /*Can't close file */
+hid_t H5E_NOTHDF5; /*not an HDF5 format file */
+hid_t H5E_BADFILE; /*bad file ID accessed */
+hid_t H5E_TRUNCATED; /*file has been truncated */
+hid_t H5E_MOUNT; /*file mount error */
+
+ /* Generic low-level file I/O errors */
+hid_t H5E_SEEKERROR; /*seek failed */
+hid_t H5E_READERROR; /*read failed */
+hid_t H5E_WRITEERROR; /*write failed */
+hid_t H5E_CLOSEERROR; /*close failed */
+hid_t H5E_OVERFLOW; /*address overflowed */
+hid_t H5E_FCNTL; /*file fcntl failed */
+
+ /* Function entry/exit interface errors */
+hid_t H5E_CANTINIT; /*Can't initialize object */
+hid_t H5E_ALREADYINIT; /*object already initialized */
+hid_t H5E_CANTRELEASE; /*Can't release object */
+
+ /* Object atom related errors */
+hid_t H5E_BADATOM; /*Can't find atom information */
+hid_t H5E_BADGROUP; /*Can't find group information */
+hid_t H5E_CANTREGISTER; /*Can't register new atom */
+hid_t H5E_CANTINC; /*Can't increment reference count */
+hid_t H5E_CANTDEC; /*Can't decrement reference count */
+hid_t H5E_NOIDS; /*Out of IDs for group */
+
+ /* Cache related errors */
+hid_t H5E_CANTFLUSH; /*Can't flush object from cache */
+hid_t H5E_CANTLOAD; /*Can't load object into cache */
+hid_t H5E_PROTECT; /*protected object error */
+hid_t H5E_NOTCACHED; /*object not currently cached */
+
+ /* B-tree related errors */
+hid_t H5E_NOTFOUND; /*object not found */
+hid_t H5E_EXISTS; /*object already exists */
+hid_t H5E_CANTENCODE; /*Can't encode value */
+hid_t H5E_CANTDECODE; /*Can't decode value */
+hid_t H5E_CANTSPLIT; /*Can't split node */
+hid_t H5E_CANTINSERT; /*Can't insert object */
+hid_t H5E_CANTLIST; /*Can't list node */
+
+ /* Object header related errors */
+hid_t H5E_LINKCOUNT; /*bad object header link count */
+hid_t H5E_VERSION; /*wrong version number */
+hid_t H5E_ALIGNMENT; /*alignment error */
+hid_t H5E_BADMESG; /*unrecognized message */
+hid_t H5E_CANTDELETE; /* Can't delete message */
+
+ /* Group related errors */
+hid_t H5E_CANTOPENOBJ; /*Can't open object */
+hid_t H5E_COMPLEN; /*name component is too long */
+hid_t H5E_CWG; /*problem with current working group */
+hid_t H5E_LINK; /*link count failure */
+hid_t H5E_SLINK; /*symbolic link error */
+
+ /* Datatype conversion errors */
+hid_t H5E_CANTCONVERT; /*Can't convert datatypes */
+hid_t H5E_BADSIZE; /*Bad size for object */
+
+ /* Dataspace errors */
+hid_t H5E_CANTCLIP; /*Can't clip hyperslab region */
+hid_t H5E_CANTCOUNT; /*Can't count elements */
+hid_t H5E_CANTSELECT; /*Can't select hyperslab */
+hid_t H5E_CANTNEXT; /*Can't move to next iterator location */
+hid_t H5E_BADSELECT; /*Invalid selection */
+hid_t H5E_CANTCOMPARE; /*Can't compare objects */
+
+ /* Property list errors */
+hid_t H5E_CANTGET; /*Can't get value */
+hid_t H5E_CANTSET; /*Can't set value */
+hid_t H5E_DUPCLASS; /*Duplicate class name in parent class */
+
+ /* Parallel errors */
+hid_t H5E_MPI; /*some MPI function failed */
+hid_t H5E_MPIERRSTR; /*MPI Error String */
+
+ /* FPHDF5 errors */
+hid_t H5E_CANTMAKETREE; /*can't make a TBBT tree */
+hid_t H5E_CANTRECV; /*can't receive messages from processes */
+hid_t H5E_CANTSENDMDATA; /*can't send metadata message */
+hid_t H5E_CANTCHANGE; /*can't register change on server */
+hid_t H5E_CANTALLOC; /*can't allocate from file */
+
+ /* I/O pipeline errors */
+hid_t H5E_NOFILTER; /*requested filter is not available */
+hid_t H5E_CALLBACK; /*callback failed */
+hid_t H5E_CANAPPLY; /*error from filter "can apply" callback */
+hid_t H5E_SETLOCAL /*error from filter "set local" callback */
+
+#endif /* TMP */
+#endif /* NEW_ERR */
+
/*
* One often needs to temporarily disable automatic error reporting when
* trying something that's likely or expected to fail. For instance, to
@@ -239,6 +413,7 @@ typedef enum H5E_direction_t {
H5E_WALK_DOWNWARD = 1 /*begin at API function, end deep */
} H5E_direction_t;
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -247,6 +422,8 @@ extern "C" {
typedef herr_t (*H5E_walk_t)(int n, H5E_error_t *err_desc, void *client_data);
typedef herr_t (*H5E_auto_t)(void *client_data);
+H5_DLL hid_t H5Eregister_class(const char *cls_name, const char *lib_name, const char *version);
+H5_DLL herr_t H5Eunregister_class(hid_t class_id);
H5_DLL herr_t H5Eset_auto (H5E_auto_t func, void *client_data);
H5_DLL herr_t H5Eget_auto (H5E_auto_t *func, void **client_data);
H5_DLL herr_t H5Eclear (void);
diff --git a/src/H5Iprivate.h b/src/H5Iprivate.h
index 766d7df..1174e5b 100644
--- a/src/H5Iprivate.h
+++ b/src/H5Iprivate.h
@@ -42,6 +42,9 @@
#define H5I_VFL_HASHSIZE 64
#define H5I_GENPROPCLS_HASHSIZE 64
#define H5I_GENPROPOBJ_HASHSIZE 128
+#define H5I_ERRORCLS_HASHSIZE 64
+#define H5I_MAJORERR_HASHSIZE 64
+#define H5I_MINORERR_HASHSIZE 64
/*
* Function for freeing objects. This function will be called with an object
diff --git a/src/H5Ipublic.h b/src/H5Ipublic.h
index ca32b2a..acf64af 100644
--- a/src/H5Ipublic.h
+++ b/src/H5Ipublic.h
@@ -42,6 +42,9 @@ typedef enum {
H5I_VFL, /*group ID for virtual file layer */
H5I_GENPROP_CLS, /*group ID for generic property list classes */
H5I_GENPROP_LST, /*group ID for generic property lists */
+ H5I_ERROR_CLASS, /*group ID for error classes */
+ H5I_ERROR_MAJOR, /*group ID for major errors */
+ H5I_ERROR_MINOR, /*group ID for minor errors */
H5I_NGROUPS /*number of valid groups, MUST BE LAST! */
} H5I_type_t;
diff --git a/src/H5Pfcpl.c b/src/H5Pfcpl.c
index bde4d57..f13e79c 100644
--- a/src/H5Pfcpl.c
+++ b/src/H5Pfcpl.c
@@ -439,7 +439,7 @@ H5Pset_sym_k(hid_t plist_id, unsigned ik, unsigned lk)
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(H5Pset_sym_k, FAIL);
- H5TRACE3("e","iIsIu",plist_id,ik,lk);
+ H5TRACE3("e","iIuIu",plist_id,ik,lk);
/* Get the plist structure */
if(NULL == (plist = H5P_object_verify(plist_id,H5P_FILE_CREATE)))
@@ -636,7 +636,7 @@ H5Pset_istore_k(hid_t plist_id, unsigned ik)
herr_t ret_value=SUCCEED; /* Return value */
FUNC_ENTER_API(H5Pset_istore_k, FAIL);
- H5TRACE2("e","iIs",plist_id,ik);
+ H5TRACE2("e","iIu",plist_id,ik);
/* Check arguments */
if (ik == 0)
diff --git a/test/errors.c b/test/errors.c
index dcd4e67..bd832d6 100644
--- a/test/errors.c
+++ b/test/errors.c
@@ -35,7 +35,7 @@ hid_t ERR_CLS;
hid_t ERR_MAJ_TEST;
hid_t ERR_MIN_SUBROUTINE;
-#define DSET_ATOMIC_NAME_1 "atomic_type_1"
+#define DSET_NAME "a_dataset"
#define ERR_CLS_NAME "Error Test"
#define PROG_NAME "Error Program"
@@ -90,7 +90,7 @@ test_error(hid_t file)
/*------------------- Test data values ------------------------*/
/* Create the dataset */
- if ((dataset = H5Dcreate(file, DSET_ATOMIC_NAME_1, H5T_STD_I32BE, space,
+ if ((dataset = H5Dcreate(file, DSET_NAME, H5T_STD_I32BE, space,
H5P_DEFAULT))<0) TEST_ERROR;
/* Write the data to the dataset */
@@ -101,7 +101,7 @@ test_error(hid_t file)
if(H5Dclose(dataset)<0) TEST_ERROR;
/* Open dataset again to check H5Tget_native_type */
- if((dataset=H5Dopen(file, DSET_ATOMIC_NAME_1))<0) TEST_ERROR;
+ if((dataset=H5Dopen(file, DSET_NAME))<0) TEST_ERROR;
if((dtype=H5Dget_type(dataset))<0) TEST_ERROR;
@@ -172,18 +172,19 @@ test_error(hid_t file)
*
*-------------------------------------------------------------------------
*/
-#ifdef NEW_ERR
+#ifndef NEW_ERR
static herr_t
init_error(void)
{
if((ERR_CLS = H5Eregister_class(ERR_CLS_NAME, PROG_NAME, PROG_VERS))<0)
goto error;
-
+
+ /*
if((ERR_MAJ_TEST = H5Ecreate_mesg(ERR_CLS, H5E_MAJOR, "Error in test"))<0)
goto error;
if((ERR_MIN_SUBROUTINE = H5Ecreate_mesg(ERR_CLS, H5E_MINOR, "Error in subroutine"))<0)
goto error;
-
+ */
PASSED();
return 0;
@@ -211,29 +212,31 @@ main(void)
hid_t file, fapl;
char filename[1024];
const char *FUNC="main()";
+
+ h5_reset();
-#ifdef NEW_ERR
+#ifndef NEW_ERR
if(init_error()<0)
goto error;
#endif /* NEW_ERR */
- h5_reset();
fapl = h5_fileaccess();
h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, H5P_DEFAULT, fapl))<0)
goto error;
- if(test_error(file)<0) {
-#ifdef NEW_ERR
- H5Epush(H5E_DEFAULT, __FILE__, FUNC, __LINE__, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed");
+ /*if(test_error(file)<0) {*/
+#ifndef NEW_ERR
+ /*H5Epush(H5E_DEFAULT, __FILE__, FUNC, __LINE__, ERR_MAJ_TEST, ERR_MIN_SUBROUTINE, "Error test failed");*/
#endif /* NEW_ERR */
- goto error;
- }
+ /* goto error;
+ }*/
if (H5Fclose(file)<0) goto error;
printf("All error API test based on native datatype test passed.\n");
h5_cleanup(FILENAME, fapl);
+
return 0;
error: