summaryrefslogtreecommitdiffstats
path: root/src/H5Eprivate.h
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>1997-07-30 21:17:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>1997-07-30 21:17:56 (GMT)
commit03997b1f368f935ab4b3a9a878fd3587cbc74862 (patch)
tree193909bb46d7310f8ea8d31308cddc8850530220 /src/H5Eprivate.h
parentad9255a57faca8454d0a5f2f955001eed32833ea (diff)
downloadhdf5-03997b1f368f935ab4b3a9a878fd3587cbc74862.zip
hdf5-03997b1f368f935ab4b3a9a878fd3587cbc74862.tar.gz
hdf5-03997b1f368f935ab4b3a9a878fd3587cbc74862.tar.bz2
[svn-r2] Oops...
Diffstat (limited to 'src/H5Eprivate.h')
-rw-r--r--src/H5Eprivate.h131
1 files changed, 131 insertions, 0 deletions
diff --git a/src/H5Eprivate.h b/src/H5Eprivate.h
new file mode 100644
index 0000000..9de9d69
--- /dev/null
+++ b/src/H5Eprivate.h
@@ -0,0 +1,131 @@
+/****************************************************************************
+ * NCSA HDF *
+ * Software Development Group *
+ * National Center for Supercomputing Applications *
+ * University of Illinois at Urbana-Champaign *
+ * 605 E. Springfield, Champaign IL 61820 *
+ * *
+ * For conditions of distribution and use, see the accompanying *
+ * hdf/COPYING file. *
+ * *
+ ****************************************************************************/
+
+/* $Id$ */
+
+/*
+ * Header file for error values, etc.
+ */
+
+#ifndef HDF5ERR_H
+#define HDF5ERR_H
+
+#include "H5Eproto.h"
+
+/*
+ ======================================================================
+ Error codes
+
+ NOTE: Remember to update the error_messages[] structure later in this file
+ whenever errors are added/deleted from this list.
+ ======================================================================
+ */
+/*
+ * This section of code is designed to be only accessible to the actual
+ * error-management code.
+ */
+#ifdef HDF5_ERR_MASTER
+
+/*
+ * error_messages is the list of error messages in the system, kept as
+ * error_code-message pairs.
+ */
+
+typedef struct
+ {
+ hdf_maj_err_code_t error_code;
+ const char *str;
+ }
+hdf_maj_error_messages_t;
+
+static const hdf_maj_error_messages_t hdf_maj_error_messages[] =
+{
+ {H5E_NONE_MAJOR, "No error"},
+ {H5E_ARGS, "Invalid arguments to routine"},
+ {H5E_RESOURCE, "Resource unavailable"},
+ {H5E_INTERNAL, "Internal HDF5 error (too specific to document in detail)"},
+ {H5E_FILE, "File Accessability"},
+ {H5E_IO, "Low-level I/O"},
+ {H5E_FUNC, "Function Entry/Exit"},
+ {H5E_ATOM, "Object Atom"},
+};
+
+typedef struct
+ {
+ hdf_min_err_code_t error_code;
+ const char *str;
+ }
+hdf_min_error_messages_t;
+
+static const hdf_min_error_messages_t hdf_min_error_messages[] =
+{
+ {H5E_NONE_MINOR, "No error"},
+ {H5E_UNINITIALIZED, "Information is uninitialized"},
+ {H5E_UNSUPPORTED, "Feature is unsupported"},
+ {H5E_BADTYPE, "Incorrect type found"},
+ {H5E_BADRANGE, "Incorrect range of argument"},
+ {H5E_NOSPACE, "No space available for allocation"},
+ {H5E_FILEEXISTS, "File already exists"},
+ {H5E_FILEOPEN, "File already open"},
+ {H5E_CANTCREATE, "Can't create file"},
+ {H5E_CANTOPEN, "Can't open file"},
+ {H5E_NOTHDF5, "Not an HDF5 format file"},
+ {H5E_BADFILE, "Bad file ID accessed"},
+ {H5E_SEEKERROR, "File seek failed"},
+ {H5E_READERROR, "File read failed"},
+ {H5E_WRITEERROR, "File write failed"},
+ {H5E_CANTINIT, "Can't initialize interface"},
+ {H5E_ALREADYINIT, "Object already initialized"},
+ {H5E_BADATOM, "Can't find atom information"},
+ {H5E_CANTREGISTER, "Can't register new atom"}
+};
+
+/* We use a stack to hold the errors plus we keep track of the function,
+ file and line where the error occurs. */
+
+/* the structure of the error stack element */
+typedef struct error_t
+ {
+ hdf_maj_err_code_t maj; /* Major error number */
+ hdf_min_err_code_t min; /* Minor error number */
+ char function_name[MAX_FUNC_NAME_LEN]; /* function where error occur */
+ const char *file_name; /* file where error occur */
+ intn line; /* line in file where error occurs */
+ char *desc; /* optional supplied description */
+ }
+H5E_error_t;
+
+/* Structure to store error information for a thread */
+typedef struct errstack_t
+ {
+ uintn stack_size; /* Number of elements allocated in the stack */
+ uintn stack_top; /* Offset of the next open stack element */
+ H5E_error_t *err_stack; /* Pointer to the error stack */
+ H5E_push_func_t push; /* Function to call when an error is to be reported */
+ } H5E_errstack_t;
+
+#endif /* HDF5_ERR_MASTER */
+
+#if defined c_plusplus || defined __cplusplus
+extern "C"
+{
+#endif /* c_plusplus || __cplusplus */
+
+/* Private functions in H5E.c */
+void H5E_store(int32 errid, hdf_maj_err_code_t maj, hdf_min_err_code_t min, const char *function_name, const char *file_name, intn line);
+
+#if defined c_plusplus || defined __cplusplus
+}
+#endif /* c_plusplus || __cplusplus */
+
+#endif /* HDF5ERR_H */
+