MISR Toolkit  1.5.1
H5Opublic.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  *
16  * Created: H5Opublic.h
17  * Aug 5 1997
18  * Robb Matzke <matzke@llnl.gov>
19  *
20  * Purpose: Public declarations for the H5O (object header)
21  * package.
22  *
23  *-------------------------------------------------------------------------
24  */
25 #ifndef _H5Opublic_H
26 #define _H5Opublic_H
27 
28 /* Public headers needed by this file */
29 #include "H5public.h" /* Generic Functions */
30 #include "H5Ipublic.h" /* IDs */
31 #include "H5Lpublic.h" /* Links */
32 
33 /*****************/
34 /* Public Macros */
35 /*****************/
36 
37 /* Flags for object copy (H5Ocopy) */
38 #define H5O_COPY_SHALLOW_HIERARCHY_FLAG (0x0001u) /* Copy only immediate members */
39 #define H5O_COPY_EXPAND_SOFT_LINK_FLAG (0x0002u) /* Expand soft links into new objects */
40 #define H5O_COPY_EXPAND_EXT_LINK_FLAG (0x0004u) /* Expand external links into new objects */
41 #define H5O_COPY_EXPAND_REFERENCE_FLAG (0x0008u) /* Copy objects that are pointed by references */
42 #define H5O_COPY_WITHOUT_ATTR_FLAG (0x0010u) /* Copy object without copying attributes */
43 #define H5O_COPY_PRESERVE_NULL_FLAG (0x0020u) /* Copy NULL messages (empty space) */
44 #define H5O_COPY_MERGE_COMMITTED_DTYPE_FLAG (0x0040u) /* Merge committed datatypes in dest file */
45 #define H5O_COPY_ALL (0x007Fu) /* All object copying flags (for internal checking) */
46 
47 /* Flags for shared message indexes.
48  * Pass these flags in using the mesg_type_flags parameter in
49  * H5P_set_shared_mesg_index.
50  * (Developers: These flags correspond to object header message type IDs,
51  * but we need to assign each kind of message to a different bit so that
52  * one index can hold multiple types.)
53  */
54 #define H5O_SHMESG_NONE_FLAG 0x0000 /* No shared messages */
55 #define H5O_SHMESG_SDSPACE_FLAG ((unsigned)1 << 0x0001) /* Simple Dataspace Message. */
56 #define H5O_SHMESG_DTYPE_FLAG ((unsigned)1 << 0x0003) /* Datatype Message. */
57 #define H5O_SHMESG_FILL_FLAG ((unsigned)1 << 0x0005) /* Fill Value Message. */
58 #define H5O_SHMESG_PLINE_FLAG ((unsigned)1 << 0x000b) /* Filter pipeline message. */
59 #define H5O_SHMESG_ATTR_FLAG ((unsigned)1 << 0x000c) /* Attribute Message. */
60 #define H5O_SHMESG_ALL_FLAG (H5O_SHMESG_SDSPACE_FLAG | H5O_SHMESG_DTYPE_FLAG | H5O_SHMESG_FILL_FLAG | H5O_SHMESG_PLINE_FLAG | H5O_SHMESG_ATTR_FLAG)
61 
62 /* Object header status flag definitions */
63 #define H5O_HDR_CHUNK0_SIZE 0x03 /* 2-bit field indicating # of bytes to store the size of chunk 0's data */
64 #define H5O_HDR_ATTR_CRT_ORDER_TRACKED 0x04 /* Attribute creation order is tracked */
65 #define H5O_HDR_ATTR_CRT_ORDER_INDEXED 0x08 /* Attribute creation order has index */
66 #define H5O_HDR_ATTR_STORE_PHASE_CHANGE 0x10 /* Non-default attribute storage phase change values stored */
67 #define H5O_HDR_STORE_TIMES 0x20 /* Store access, modification, change & birth times for object */
68 #define H5O_HDR_ALL_FLAGS (H5O_HDR_CHUNK0_SIZE | H5O_HDR_ATTR_CRT_ORDER_TRACKED | H5O_HDR_ATTR_CRT_ORDER_INDEXED | H5O_HDR_ATTR_STORE_PHASE_CHANGE | H5O_HDR_STORE_TIMES)
69 
70 /* Maximum shared message values. Number of indexes is 8 to allow room to add
71  * new types of messages.
72  */
73 #define H5O_SHMESG_MAX_NINDEXES 8
74 #define H5O_SHMESG_MAX_LIST_SIZE 5000
75 
76 /*******************/
77 /* Public Typedefs */
78 /*******************/
79 
80 /* Types of objects in file */
81 typedef enum H5O_type_t {
82  H5O_TYPE_UNKNOWN = -1, /* Unknown object type */
83  H5O_TYPE_GROUP, /* Object is a group */
84  H5O_TYPE_DATASET, /* Object is a dataset */
85  H5O_TYPE_NAMED_DATATYPE, /* Object is a named data type */
86  H5O_TYPE_NTYPES /* Number of different object types (must be last!) */
87 } H5O_type_t;
88 
89 /* Information struct for object header metadata (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) */
90 typedef struct H5O_hdr_info_t {
91  unsigned version; /* Version number of header format in file */
92  unsigned nmesgs; /* Number of object header messages */
93  unsigned nchunks; /* Number of object header chunks */
94  unsigned flags; /* Object header status flags */
95  struct {
96  hsize_t total; /* Total space for storing object header in file */
97  hsize_t meta; /* Space within header for object header metadata information */
98  hsize_t mesg; /* Space within header for actual message information */
99  hsize_t free; /* Free space within object header */
100  } space;
101  struct {
102  uint64_t present; /* Flags to indicate presence of message type in header */
103  uint64_t shared; /* Flags to indicate message type is shared in header */
104  } mesg;
106 
107 /* Information struct for object (for H5Oget_info/H5Oget_info_by_name/H5Oget_info_by_idx) */
108 typedef struct H5O_info_t {
109  unsigned long fileno; /* File number that object is located in */
110  haddr_t addr; /* Object address in file */
111  H5O_type_t type; /* Basic object type (group, dataset, etc.) */
112  unsigned rc; /* Reference count of object */
113  time_t atime; /* Access time */
114  time_t mtime; /* Modification time */
115  time_t ctime; /* Change time */
116  time_t btime; /* Birth time */
117  hsize_t num_attrs; /* # of attributes attached to object */
118  H5O_hdr_info_t hdr; /* Object header information */
119  /* Extra metadata storage for obj & attributes */
120  struct {
121  H5_ih_info_t obj; /* v1/v2 B-tree & local/fractal heap for groups, B-tree for chunked datasets */
122  H5_ih_info_t attr; /* v2 B-tree & heap for attributes */
123  } meta_size;
124 } H5O_info_t;
125 
126 /* Typedef for message creation indexes */
127 typedef uint32_t H5O_msg_crt_idx_t;
128 
129 /* Prototype for H5Ovisit/H5Ovisit_by_name() operator */
130 typedef herr_t (*H5O_iterate_t)(hid_t obj, const char *name, const H5O_info_t *info,
131  void *op_data);
132 
133 typedef enum H5O_mcdt_search_ret_t {
134  H5O_MCDT_SEARCH_ERROR = -1, /* Abort H5Ocopy */
135  H5O_MCDT_SEARCH_CONT, /* Continue the global search of all committed datatypes in the destination file */
136  H5O_MCDT_SEARCH_STOP /* Stop the search, but continue copying. The committed datatype will be copied but not merged. */
138 
139 /* Callback to invoke when completing the search for a matching committed datatype from the committed dtype list */
140 typedef H5O_mcdt_search_ret_t (*H5O_mcdt_search_cb_t)(void *op_data);
141 
142 /********************/
143 /* Public Variables */
144 /********************/
145 
146 
147 #ifdef __cplusplus
148 extern "C" {
149 #endif
150 
151 /*********************/
152 /* Public Prototypes */
153 /*********************/
154 H5_DLL hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id);
156 H5_DLL hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name,
157  H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id);
158 H5_DLL htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id);
159 H5_DLL herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo);
160 H5_DLL herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo,
161  hid_t lapl_id);
162 H5_DLL herr_t H5Oget_info_by_idx(hid_t loc_id, const char *group_name,
163  H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo,
164  hid_t lapl_id);
165 H5_DLL herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name,
166  hid_t lcpl_id, hid_t lapl_id);
169 H5_DLL herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
170  const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id);
171 H5_DLL herr_t H5Oset_comment(hid_t obj_id, const char *comment);
172 H5_DLL herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name,
173  const char *comment, hid_t lapl_id);
174 H5_DLL ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize);
175 H5_DLL ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name,
176  char *comment, size_t bufsize, hid_t lapl_id);
177 H5_DLL herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order,
178  H5O_iterate_t op, void *op_data);
179 H5_DLL herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name,
180  H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op,
181  void *op_data, hid_t lapl_id);
182 H5_DLL herr_t H5Oclose(hid_t object_id);
183 
184 /* Symbols defined for compatibility with previous versions of the HDF5 API.
185  *
186  * Use of these symbols is deprecated.
187  */
188 #ifndef H5_NO_DEPRECATED_SYMBOLS
189 
190 /* Macros */
191 
192 /* Typedefs */
193 
194 /* A struct that's part of the H5G_stat_t routine (deprecated) */
195 typedef struct H5O_stat_t {
196  hsize_t size; /* Total size of object header in file */
197  hsize_t free; /* Free space within object header */
198  unsigned nmesgs; /* Number of object header messages */
199  unsigned nchunks; /* Number of object header chunks */
200 } H5O_stat_t;
201 
202 /* Function prototypes */
203 
204 #endif /* H5_NO_DEPRECATED_SYMBOLS */
205 
206 #ifdef __cplusplus
207 }
208 #endif
209 #endif /* _H5Opublic_H */
210 
HDFFCLIBAPI intf * info
H5_DLL htri_t H5Oexists_by_name(hid_t loc_id, const char *name, hid_t lapl_id)
H5_DLL herr_t H5Oset_comment_by_name(hid_t loc_id, const char *name, const char *comment, hid_t lapl_id)
H5_DLL hid_t H5Oopen_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id)
H5_index_t
Definition: H5public.h:305
long long ssize_t
Definition: H5public.h:156
unsigned version
Definition: H5Opublic.h:91
hsize_t num_attrs
Definition: H5Opublic.h:117
H5_DLL herr_t H5Oget_info_by_name(hid_t loc_id, const char *name, H5O_info_t *oinfo, hid_t lapl_id)
#define H5_DLL
Definition: H5api_adpt.h:256
time_t btime
Definition: H5Opublic.h:116
haddr_t addr
Definition: H5Opublic.h:110
H5_DLL herr_t H5Oget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5O_info_t *oinfo, hid_t lapl_id)
H5_DLL herr_t H5Odecr_refcount(hid_t object_id)
int herr_t
Definition: H5public.h:124
H5_DLL herr_t H5Ocopy(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name, hid_t ocpypl_id, hid_t lcpl_id)
herr_t(* H5O_iterate_t)(hid_t obj, const char *name, const H5O_info_t *info, void *op_data)
Definition: H5Opublic.h:130
unsigned long long hsize_t
Definition: H5public.h:169
unsigned rc
Definition: H5Opublic.h:112
H5_DLL herr_t H5Oclose(hid_t object_id)
unsigned nchunks
Definition: H5Opublic.h:93
H5O_type_t
Definition: H5Opublic.h:81
H5_DLL ssize_t H5Oget_comment(hid_t obj_id, char *comment, size_t bufsize)
struct H5O_stat_t H5O_stat_t
unsigned nmesgs
Definition: H5Opublic.h:198
hsize_t free
Definition: H5Opublic.h:99
hsize_t meta
Definition: H5Opublic.h:97
uint64_t haddr_t
Definition: H5public.h:182
HDFFCLIBAPI _fcd name
unsigned nchunks
Definition: H5Opublic.h:199
H5_DLL herr_t H5Oincr_refcount(hid_t object_id)
H5O_mcdt_search_ret_t(* H5O_mcdt_search_cb_t)(void *op_data)
Definition: H5Opublic.h:140
unsigned nmesgs
Definition: H5Opublic.h:92
hsize_t free
Definition: H5Opublic.h:197
H5_iter_order_t
Definition: H5public.h:284
time_t mtime
Definition: H5Opublic.h:114
HDFFCLIBAPI _fcd intf intf * order
hsize_t size
Definition: H5Opublic.h:196
H5_DLL herr_t H5Ovisit(hid_t obj_id, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data)
int hid_t
Definition: H5Ipublic.h:54
H5_DLL hid_t H5Oopen(hid_t loc_id, const char *name, hid_t lapl_id)
time_t ctime
Definition: H5Opublic.h:115
struct H5O_hdr_info_t::@34 space
unsigned flags
Definition: H5Opublic.h:94
HDFFCLIBAPI _fcd _fcd intf * n
time_t atime
Definition: H5Opublic.h:113
uint64_t shared
Definition: H5Opublic.h:103
H5O_mcdt_search_ret_t
Definition: H5Opublic.h:133
H5_DLL herr_t H5Oget_info(hid_t loc_id, H5O_info_t *oinfo)
H5_DLL herr_t H5Ovisit_by_name(hid_t loc_id, const char *obj_name, H5_index_t idx_type, H5_iter_order_t order, H5O_iterate_t op, void *op_data, hid_t lapl_id)
uint32_t H5O_msg_crt_idx_t
Definition: H5Opublic.h:127
H5O_hdr_info_t hdr
Definition: H5Opublic.h:118
H5_ih_info_t obj
Definition: H5Opublic.h:121
hsize_t mesg
Definition: H5Opublic.h:98
H5_DLL ssize_t H5Oget_comment_by_name(hid_t loc_id, const char *name, char *comment, size_t bufsize, hid_t lapl_id)
unsigned long fileno
Definition: H5Opublic.h:109
H5O_type_t type
Definition: H5Opublic.h:111
hsize_t total
Definition: H5Opublic.h:96
H5_DLL hid_t H5Oopen_by_addr(hid_t loc_id, haddr_t addr)
H5_ih_info_t attr
Definition: H5Opublic.h:122
H5_DLL herr_t H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, hid_t lapl_id)
H5_DLL herr_t H5Oset_comment(hid_t obj_id, const char *comment)
uint64_t present
Definition: H5Opublic.h:102
struct H5O_hdr_info_t H5O_hdr_info_t
int htri_t
Definition: H5public.h:143
struct H5O_info_t H5O_info_t

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