HDF5  1.12.0
H5Epkg.h
Go to the documentation of this file.
1 /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
2  * Copyright by The HDF Group. *
3  * Copyright by the Board of Trustees of the University of Illinois. *
4  * All rights reserved. *
5  * *
6  * This file is part of HDF5. The full HDF5 copyright notice, including *
7  * terms governing use, modification, and redistribution, is contained in *
8  * the COPYING file, which can be found at the root of the source code *
9  * distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
10  * If you do not have access to either file, you may request a copy from *
11  * help@hdfgroup.org. *
12  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
13 
14 /*
15  * Programmer: Quincey Koziol <koziol@hdfgroup.org>
16  * Wednesday, April 11, 2007
17  *
18  * Purpose: This file contains declarations which are visible only within
19  * the H5E package. Source files outside the H5E package should
20  * include H5Eprivate.h instead.
21  */
22 #if !(defined H5E_FRIEND || defined H5E_MODULE)
23 #error "Do not include this file outside the H5E package!"
24 #endif
25 
26 #ifndef _H5Epkg_H
27 #define _H5Epkg_H
28 
29 /* Get package's private header */
30 #include "H5Eprivate.h"
31 
32 /* Other private headers needed by this file */
33 
34 
35 /**************************/
36 /* Package Private Macros */
37 /**************************/
38 
39 /* Amount to indent each error */
40 #define H5E_INDENT 2
41 
42 /* Number of slots in an error stack */
43 #define H5E_NSLOTS 32
44 
45 #ifdef H5_HAVE_THREADSAFE
46 /*
47  * The per-thread error stack. pthread_once() initializes a special
48  * key that will be used by all threads to create a stack specific to
49  * each thread individually. The association of stacks to threads will
50  * be handled by the pthread library.
51  *
52  * In order for this macro to work, H5E__get_my_stack() must be preceeded
53  * by "H5E_t *estack =".
54  */
55 #define H5E__get_my_stack() H5E__get_stack()
56 #else /* H5_HAVE_THREADSAFE */
57 /*
58  * The current error stack.
59  */
60 #define H5E__get_my_stack() (H5E_stack_g + 0)
61 #endif /* H5_HAVE_THREADSAFE */
62 
63 
64 /****************************/
65 /* Package Private Typedefs */
66 /****************************/
67 
68 /* Some syntactic sugar to make the compiler happy with two different kinds of callbacks */
69 #ifndef H5_NO_DEPRECATED_SYMBOLS
70 typedef struct {
71  unsigned vers; /* Which version callback to use */
72  hbool_t is_default; /* If the printing function is the library's own. */
73  H5E_auto1_t func1; /* Old-style callback, NO error stack param. */
74  H5E_auto2_t func2; /* New-style callback, with error stack param. */
75  H5E_auto1_t func1_default; /* The saved library's default function - old style. */
76  H5E_auto2_t func2_default; /* The saved library's default function - new style. */
78 #else /* H5_NO_DEPRECATED_SYMBOLS */
79 typedef struct {
80  H5E_auto2_t func2; /* Only the new style callback function is available. */
82 #endif /* H5_NO_DEPRECATED_SYMBOLS */
83 
84 /* Some syntactic sugar to make the compiler happy with two different kinds of callbacks */
85 typedef struct {
86  unsigned vers; /* Which version callback to use */
87  union {
88 #ifndef H5_NO_DEPRECATED_SYMBOLS
89  H5E_walk1_t func1; /* Old-style callback, NO error stack param. */
90 #endif /* H5_NO_DEPRECATED_SYMBOLS */
91  H5E_walk2_t func2; /* New-style callback, with error stack param. */
92  }u;
94 
95 /* Error class */
96 typedef struct H5E_cls_t {
97  char *cls_name; /* Name of error class */
98  char *lib_name; /* Name of library within class */
99  char *lib_vers; /* Version of library */
101 
102 /* Major or minor message */
103 typedef struct H5E_msg_t {
104  char *msg; /* Message for error */
105  H5E_type_t type; /* Type of error (major or minor) */
106  H5E_cls_t *cls; /* Which error class this message belongs to */
108 
109 /* Error stack */
110 struct H5E_t {
111  size_t nused; /* Num slots currently used in stack */
112  H5E_error2_t slot[H5E_NSLOTS]; /* Array of error records */
113  H5E_auto_op_t auto_op; /* Operator for 'automatic' error reporting */
114  void *auto_data; /* Callback data for 'automatic error reporting */
115 };
116 
117 
118 /*****************************/
119 /* Package Private Variables */
120 /*****************************/
121 
122 #ifndef H5_HAVE_THREADSAFE
123 /*
124  * The current error stack.
125  */
127 #endif /* H5_HAVE_THREADSAFE */
128 
129 
130 /******************************/
131 /* Package Private Prototypes */
132 /******************************/
134 #ifdef H5_HAVE_THREADSAFE
135 H5_DLL H5E_t *H5E__get_stack(void);
136 #endif /* H5_HAVE_THREADSAFE */
137 H5_DLL herr_t H5E__push_stack(H5E_t *estack, const char *file, const char *func,
138  unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc);
139 H5_DLL ssize_t H5E__get_msg(const H5E_msg_t *msg_ptr, H5E_type_t *type,
140  char *msg, size_t size);
141 H5_DLL herr_t H5E__print(const H5E_t *estack, FILE *stream, hbool_t bk_compat);
142 H5_DLL herr_t H5E__walk(const H5E_t *estack, H5E_direction_t direction,
143  const H5E_walk_op_t *op, void *client_data);
144 H5_DLL herr_t H5E__get_auto(const H5E_t *estack, H5E_auto_op_t *op,
145  void **client_data);
146 H5_DLL herr_t H5E__set_auto(H5E_t *estack, const H5E_auto_op_t *op,
147  void *client_data);
148 H5_DLL herr_t H5E__pop(H5E_t *err_stack, size_t count);
149 
150 #endif /* _H5Epkg_H */
151 
u
hsize_t u
Definition: H5EA.c:1007
H5E__print
H5_DLL herr_t H5E__print(const H5E_t *estack, FILE *stream, hbool_t bk_compat)
Definition: H5Eint.c:436
ssize_t
int ssize_t
Definition: H5public.h:167
H5E_cls_t
struct H5E_cls_t H5E_cls_t
size
iblock size
Definition: H5EAcache.c:787
H5E_t
Definition: H5Epkg.h:110
H5E_cls_t::lib_name
char * lib_name
Definition: H5Epkg.h:98
H5E_auto_op_t::func1_default
H5E_auto1_t func1_default
Definition: H5Epkg.h:75
H5E_cls_t::cls_name
char * cls_name
Definition: H5Epkg.h:97
H5E__push_stack
H5_DLL herr_t H5E__push_stack(H5E_t *estack, const char *file, const char *func, unsigned line, hid_t cls_id, hid_t maj_id, hid_t min_id, const char *desc)
Definition: H5Eint.c:779
H5E_auto_op_t::func1
H5E_auto1_t func1
Definition: H5Epkg.h:73
H5E_walk_op_t::func2
H5E_walk2_t func2
Definition: H5Epkg.h:91
H5_DLLVAR
#define H5_DLLVAR
Definition: H5api_adpt.h:235
H5E_auto2_t
herr_t(* H5E_auto2_t)(hid_t estack, void *client_data)
Definition: H5Epublic.h:152
H5E_auto1_t
herr_t(* H5E_auto1_t)(void *client_data)
Definition: H5Epublic.h:206
H5E_t::auto_data
void * auto_data
Definition: H5Epkg.h:114
H5E_t::auto_op
H5E_auto_op_t auto_op
Definition: H5Epkg.h:113
H5E__get_auto
H5_DLL herr_t H5E__get_auto(const H5E_t *estack, H5E_auto_op_t *op, void **client_data)
Definition: H5Eint.c:607
H5E_direction_t
H5E_direction_t
Definition: H5Epublic.h:139
hid_t
int64_t hid_t
Definition: H5Ipublic.h:55
H5E_stack_g
H5_DLLVAR H5E_t H5E_stack_g[1]
Definition: H5Epkg.h:126
H5E_error2_t
Definition: H5Epublic.h:36
H5E_auto_op_t::is_default
hbool_t is_default
Definition: H5Epkg.h:72
H5E_NSLOTS
#define H5E_NSLOTS
Definition: H5Epkg.h:43
FILE
Invalid arguments to routine Resource unavailable Internal File accessibility Low level I O Function entry exit Object atom Object cache Links B Tree node Symbol table Heap Object header Datatype Dataspace Dataset Data storage Property lists Attribute Data filters External file list References Virtual File Layer Virtual Object Layer Ternary Search Trees Reference Counted Strings Error API Skip Lists Free Space Manager Shared Object Header Messages Extensible Array Fixed Array Plugin for dynamically loaded library Page Buffering API Context Map No error Argument errors Resource errors File accessibility errors FILE
Definition: H5err.txt:88
H5E__get_msg
H5_DLL ssize_t H5E__get_msg(const H5E_msg_t *msg_ptr, H5E_type_t *type, char *msg, size_t size)
Definition: H5Eint.c:130
H5E_msg_t
Definition: H5Epkg.h:103
H5E__term_deprec_interface
H5_DLL herr_t H5E__term_deprec_interface(void)
H5E_cls_t
Definition: H5Epkg.h:96
H5E_cls_t::lib_vers
char * lib_vers
Definition: H5Epkg.h:99
H5E_auto_op_t
Definition: H5Epkg.h:70
H5E_walk2_t
herr_t(* H5E_walk2_t)(unsigned n, const H5E_error2_t *err_desc, void *client_data)
Definition: H5Epublic.h:150
H5E_msg_t::type
H5E_type_t type
Definition: H5Epkg.h:105
H5E__walk
H5_DLL herr_t H5E__walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *op, void *client_data)
Definition: H5Eint.c:510
H5E_auto_op_t::func2_default
H5E_auto2_t func2_default
Definition: H5Epkg.h:76
H5E_auto_op_t::vers
unsigned vers
Definition: H5Epkg.h:71
H5E_walk_op_t::func1
H5E_walk1_t func1
Definition: H5Epkg.h:89
H5E_auto_op_t::func2
H5E_auto2_t func2
Definition: H5Epkg.h:74
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5E__set_auto
H5_DLL herr_t H5E__set_auto(H5E_t *estack, const H5E_auto_op_t *op, void *client_data)
Definition: H5Eint.c:647
H5E_t::slot
H5E_error2_t slot[H5E_NSLOTS]
Definition: H5Epkg.h:112
H5E__pop
H5_DLL herr_t H5E__pop(H5E_t *err_stack, size_t count)
Definition: H5Eint.c:951
H5E_msg_t::cls
H5E_cls_t * cls
Definition: H5Epkg.h:106
H5E_msg_t::msg
char * msg
Definition: H5Epkg.h:104
H5E_msg_t
struct H5E_msg_t H5E_msg_t
H5E_t::nused
size_t nused
Definition: H5Epkg.h:111
herr_t
int herr_t
Definition: H5public.h:128
H5E_walk1_t
herr_t(* H5E_walk1_t)(int n, H5E_error1_t *err_desc, void *client_data)
Definition: H5Epublic.h:205
hbool_t
bool hbool_t
Definition: H5public.h:159
H5E_walk_op_t
Definition: H5Epkg.h:85
H5E_type_t
H5E_type_t
Definition: H5Epublic.h:30
H5E_walk_op_t::vers
unsigned vers
Definition: H5Epkg.h:86
H5Eprivate.h