MISR Toolkit  1.5.1
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 #ifndef H5E_PACKAGE
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_auto_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 */
100 } H5E_cls_t;
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 */
107 } H5E_msg_t;
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 */
138  char *msg, size_t size);
139 H5_DLL herr_t H5E_print(const H5E_t *estack, FILE *stream, hbool_t bk_compat);
140 H5_DLL herr_t H5E_walk(const H5E_t *estack, H5E_direction_t direction,
141  const H5E_walk_op_t *op, void *client_data);
142 H5_DLL herr_t H5E_get_auto(const H5E_t *estack, H5E_auto_op_t *op,
143  void **client_data);
144 H5_DLL herr_t H5E_set_auto(H5E_t *estack, const H5E_auto_op_t *op,
145  void *client_data);
146 H5_DLL herr_t H5E_pop(H5E_t *err_stack, size_t count);
147 
148 #endif /* _H5Epkg_H */
149 
HDFFCLIBAPI intf intf intf * count
H5E_type_t
Definition: H5Epublic.h:30
Definition: H5Epkg.h:110
unsigned int hbool_t
Definition: H5public.h:142
H5_DLL herr_t H5E__term_deprec_interface(void)
H5E_auto1_t func1
Definition: H5Epkg.h:73
herr_t(* H5E_auto2_t)(hid_t estack, void *client_data)
Definition: H5Epublic.h:152
H5_DLL herr_t H5E_set_auto(H5E_t *estack, const H5E_auto_op_t *op, void *client_data)
long long ssize_t
Definition: H5public.h:156
struct H5E_cls_t H5E_cls_t
#define H5_DLL
Definition: H5api_adpt.h:256
int herr_t
Definition: H5public.h:124
char * lib_vers
Definition: H5Epkg.h:99
char * cls_name
Definition: H5Epkg.h:97
char * msg
Definition: H5Epkg.h:104
H5_DLL ssize_t H5E_get_msg(const H5E_msg_t *msg_ptr, H5E_type_t *type, char *msg, size_t size)
H5E_auto2_t func2_default
Definition: H5Epkg.h:76
H5E_auto_op_t auto_op
Definition: H5Epkg.h:113
herr_t(* H5E_walk1_t)(int n, H5E_error1_t *err_desc, void *client_data)
Definition: H5Epublic.h:205
H5E_direction_t
Definition: H5Epublic.h:139
H5E_auto2_t func2
Definition: H5Epkg.h:74
herr_t(* H5E_walk2_t)(unsigned n, const H5E_error2_t *err_desc, void *client_data)
Definition: H5Epublic.h:150
size_t nused
Definition: H5Epkg.h:111
H5E_cls_t * cls
Definition: H5Epkg.h:106
HDFFCLIBAPI intf * size
H5_DLLVAR H5E_t H5E_stack_g[1]
Definition: H5Epkg.h:126
void * auto_data
Definition: H5Epkg.h:114
struct H5E_msg_t H5E_msg_t
H5E_walk1_t func1
Definition: H5Epkg.h:89
H5_DLL herr_t H5E_get_auto(const H5E_t *estack, H5E_auto_op_t *op, void **client_data)
H5E_auto1_t func1_default
Definition: H5Epkg.h:75
hbool_t is_default
Definition: H5Epkg.h:72
H5_DLL herr_t H5E_pop(H5E_t *err_stack, size_t count)
HDFFCLIBAPI intf intf intf * type
#define H5_DLLVAR
Definition: H5api_adpt.h:257
H5E_walk2_t func2
Definition: H5Epkg.h:91
H5E_type_t type
Definition: H5Epkg.h:105
unsigned vers
Definition: H5Epkg.h:71
#define H5E_auto_t
Definition: H5version.h:397
H5_DLL herr_t H5E_walk(const H5E_t *estack, H5E_direction_t direction, const H5E_walk_op_t *op, void *client_data)
H5_DLL herr_t H5E_print(const H5E_t *estack, FILE *stream, hbool_t bk_compat)
herr_t(* H5E_auto1_t)(void *client_data)
Definition: H5Epublic.h:206
#define H5E_NSLOTS
Definition: H5Epkg.h:43
unsigned vers
Definition: H5Epkg.h:86
char * lib_name
Definition: H5Epkg.h:98

MISR Toolkit - Copyright © 2005 - 2020 Jet Propulsion Laboratory
Generated on Fri Jun 19 2020 22:49:52