HDF5  1.12.0
H5Gpublic.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: H5Gpublic.h
17  * Jul 11 1997
18  * Robb Matzke <matzke@llnl.gov>
19  *
20  * Purpose: Public declarations for the H5G package
21  *
22  *-------------------------------------------------------------------------
23  */
24 #ifndef _H5Gpublic_H
25 #define _H5Gpublic_H
26 
27 /* System headers needed by this file */
28 #include <sys/types.h>
29 
30 /* Public headers needed by this file */
31 #include "H5public.h" /* Generic Functions */
32 #include "H5Lpublic.h" /* Links */
33 #include "H5Opublic.h" /* Object headers */
34 #include "H5Tpublic.h" /* Datatypes */
35 
36 /*****************/
37 /* Public Macros */
38 /*****************/
39 
40 /*******************/
41 /* Public Typedefs */
42 /*******************/
43 
44 /* Types of link storage for groups */
45 typedef enum H5G_storage_type_t {
46  H5G_STORAGE_TYPE_UNKNOWN = -1, /* Unknown link storage type */
47  H5G_STORAGE_TYPE_SYMBOL_TABLE, /* Links in group are stored with a "symbol table" */
48  /* (this is sometimes called "old-style" groups) */
49  H5G_STORAGE_TYPE_COMPACT, /* Links are stored in object header */
50  H5G_STORAGE_TYPE_DENSE /* Links are stored in fractal heap & indexed with v2 B-tree */
52 
53 /* Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) */
54 typedef struct H5G_info_t {
55  H5G_storage_type_t storage_type; /* Type of storage for links in group */
56  hsize_t nlinks; /* Number of links in group */
57  int64_t max_corder; /* Current max. creation order value for group */
58  hbool_t mounted; /* Whether group has a file mounted on it */
60 
61 
62 /********************/
63 /* Public Variables */
64 /********************/
65 
66 
67 /*********************/
68 /* Public Prototypes */
69 /*********************/
70 #ifdef __cplusplus
71 extern "C" {
72 #endif
73 
74 H5_DLL hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id,
75  hid_t gcpl_id, hid_t gapl_id);
76 H5_DLL hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id);
77 H5_DLL hid_t H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id);
79 H5_DLL herr_t H5Gget_info(hid_t loc_id, H5G_info_t *ginfo);
80 H5_DLL herr_t H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *ginfo,
81  hid_t lapl_id);
82 H5_DLL herr_t H5Gget_info_by_idx(hid_t loc_id, const char *group_name,
83  H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *ginfo,
84  hid_t lapl_id);
85 H5_DLL herr_t H5Gclose(hid_t group_id);
86 H5_DLL herr_t H5Gflush(hid_t group_id);
87 H5_DLL herr_t H5Grefresh(hid_t group_id);
88 
89 /* Symbols defined for compatibility with previous versions of the HDF5 API.
90  *
91  * Use of these symbols is deprecated.
92  */
93 #ifndef H5_NO_DEPRECATED_SYMBOLS
94 
95 /* Macros */
96 
97 /* Link definitions */
98 #define H5G_SAME_LOC H5L_SAME_LOC
99 #define H5G_LINK_ERROR H5L_TYPE_ERROR
100 #define H5G_LINK_HARD H5L_TYPE_HARD
101 #define H5G_LINK_SOFT H5L_TYPE_SOFT
102 #define H5G_link_t H5L_type_t
103 
104 /* Macros for types of objects in a group (see H5G_obj_t definition) */
105 #define H5G_NTYPES 256 /* Max possible number of types */
106 #define H5G_NLIBTYPES 8 /* Number of internal types */
107 #define H5G_NUSERTYPES (H5G_NTYPES - H5G_NLIBTYPES)
108 #define H5G_USERTYPE(X) (8 + (X)) /* User defined types */
109 
110 
111 /* Typedefs */
112 
113 /*
114  * An object has a certain type. The first few numbers are reserved for use
115  * internally by HDF5. Users may add their own types with higher values. The
116  * values are never stored in the file -- they only exist while an
117  * application is running. An object may satisfy the `isa' function for more
118  * than one type.
119  */
120 typedef enum H5G_obj_t {
121  H5G_UNKNOWN = -1, /* Unknown object type */
122  H5G_GROUP, /* Object is a group */
123  H5G_DATASET, /* Object is a dataset */
124  H5G_TYPE, /* Object is a named data type */
125  H5G_LINK, /* Object is a symbolic link */
126  H5G_UDLINK, /* Object is a user-defined link */
127  H5G_RESERVED_5, /* Reserved for future use */
128  H5G_RESERVED_6, /* Reserved for future use */
129  H5G_RESERVED_7 /* Reserved for future use */
131 
132 /* Prototype for H5Giterate() operator */
133 typedef herr_t (*H5G_iterate_t)(hid_t group, const char *name, void *op_data);
134 
135 /* Information about an object */
136 typedef struct H5G_stat_t {
137  unsigned long fileno[2]; /*file number */
138  unsigned long objno[2]; /*object number */
139  unsigned nlink; /*number of hard links to object*/
140  H5G_obj_t type; /*basic object type */
141  time_t mtime; /*modification time */
142  size_t linklen; /*symbolic link value length */
143  H5O_stat_t ohdr; /* Object header information */
145 
146 
147 /* Function prototypes */
148 H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint);
149 H5_DLL hid_t H5Gopen1(hid_t loc_id, const char *name);
150 H5_DLL herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name,
151  const char *new_name);
152 H5_DLL herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type,
153  hid_t new_loc_id, const char *new_name);
154 H5_DLL herr_t H5Gmove(hid_t src_loc_id, const char *src_name,
155  const char *dst_name);
156 H5_DLL herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
157  const char *dst_name);
158 H5_DLL herr_t H5Gunlink(hid_t loc_id, const char *name);
159 H5_DLL herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size,
160  char *buf/*out*/);
161 H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment);
162 H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize,
163  char *buf);
164 H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx,
165  H5G_iterate_t op, void *op_data);
166 H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs);
167 H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name,
168  hbool_t follow_link, H5G_stat_t *statbuf/*out*/);
169 H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char* name,
170  size_t size);
172 
173 #endif /* H5_NO_DEPRECATED_SYMBOLS */
174 
175 #ifdef __cplusplus
176 }
177 #endif
178 #endif /* _H5Gpublic_H */
179 
H5public.h
H5G_RESERVED_5
@ H5G_RESERVED_5
Definition: H5Gpublic.h:127
H5G_storage_type_t
H5G_storage_type_t
Definition: H5Gpublic.h:45
H5Gflush
H5_DLL herr_t H5Gflush(hid_t group_id)
Definition: H5G.c:778
H5Lpublic.h
H5G_STORAGE_TYPE_SYMBOL_TABLE
@ H5G_STORAGE_TYPE_SYMBOL_TABLE
Definition: H5Gpublic.h:47
H5Gget_objtype_by_idx
H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx)
Definition: H5Gdeprec.c:1201
ssize_t
int ssize_t
Definition: H5public.h:167
size
iblock size
Definition: H5EAcache.c:787
H5Gset_comment
H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment)
Definition: H5Gdeprec.c:681
H5Gget_linkval
H5_DLL herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf)
Definition: H5Gdeprec.c:628
H5G_stat_t
Definition: H5Gpublic.h:136
H5G_UNKNOWN
@ H5G_UNKNOWN
Definition: H5Gpublic.h:121
H5Tpublic.h
H5G_link_t
#define H5G_link_t
Definition: H5Gpublic.h:102
H5Gget_info_by_idx
H5_DLL herr_t H5Gget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *ginfo, hid_t lapl_id)
Definition: H5G.c:683
H5Gcreate_anon
H5_DLL hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id)
Definition: H5G.c:436
H5G_RESERVED_7
@ H5G_RESERVED_7
Definition: H5Gpublic.h:129
H5Gopen2
H5_DLL hid_t H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id)
Definition: H5G.c:499
int64_t
int64_t
Definition: H5overflow.txt:35
H5Glink2
H5_DLL herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type, hid_t new_loc_id, const char *new_name)
Definition: H5Gdeprec.c:399
H5G_info_t::max_corder
int64_t max_corder
Definition: H5Gpublic.h:57
H5Gmove
H5_DLL herr_t H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name)
Definition: H5Gdeprec.c:484
H5G_RESERVED_6
@ H5G_RESERVED_6
Definition: H5Gpublic.h:128
H5_iter_order_t
H5_iter_order_t
Definition: H5public.h:295
H5G_stat_t::objno
unsigned long objno[2]
Definition: H5Gpublic.h:138
H5Gopen1
H5_DLL hid_t H5Gopen1(hid_t loc_id, const char *name)
Definition: H5Gdeprec.c:269
H5Gget_num_objs
H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs)
Definition: H5Gdeprec.c:875
hid_t
int64_t hid_t
Definition: H5Ipublic.h:55
H5Gclose
H5_DLL herr_t H5Gclose(hid_t group_id)
Definition: H5G.c:743
H5Gget_objinfo
H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf)
Definition: H5Gdeprec.c:931
H5Giterate
H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx, H5G_iterate_t op, void *op_data)
Definition: H5Gdeprec.c:806
H5Gget_create_plist
H5_DLL hid_t H5Gget_create_plist(hid_t group_id)
Definition: H5G.c:557
H5Gmove2
H5_DLL herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name)
Definition: H5Gdeprec.c:529
H5G_STORAGE_TYPE_DENSE
@ H5G_STORAGE_TYPE_DENSE
Definition: H5Gpublic.h:50
H5Gget_comment
H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf)
Definition: H5Gdeprec.c:740
H5G_info_t::mounted
hbool_t mounted
Definition: H5Gpublic.h:58
H5Gcreate1
H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint)
Definition: H5Gdeprec.c:173
H5G_stat_t::fileno
unsigned long fileno[2]
Definition: H5Gpublic.h:137
H5G_TYPE
@ H5G_TYPE
Definition: H5Gpublic.h:124
H5Gget_objname_by_idx
H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size)
Definition: H5Gdeprec.c:1150
H5G_LINK
@ H5G_LINK
Definition: H5Gpublic.h:125
H5Gget_info_by_name
H5_DLL herr_t H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *ginfo, hid_t lapl_id)
Definition: H5G.c:631
H5Grefresh
H5_DLL herr_t H5Grefresh(hid_t group_id)
Definition: H5G.c:816
H5G_stat_t::nlink
unsigned nlink
Definition: H5Gpublic.h:139
H5G_info_t::storage_type
H5G_storage_type_t storage_type
Definition: H5Gpublic.h:55
H5G_UDLINK
@ H5G_UDLINK
Definition: H5Gpublic.h:126
H5Glink
H5_DLL herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new_name)
Definition: H5Gdeprec.c:318
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5Gunlink
H5_DLL herr_t H5Gunlink(hid_t loc_id, const char *name)
Definition: H5Gdeprec.c:584
H5G_stat_t::mtime
time_t mtime
Definition: H5Gpublic.h:141
H5G_info_t
struct H5G_info_t H5G_info_t
H5G_stat_t::type
H5G_obj_t type
Definition: H5Gpublic.h:140
n
*s *s n
Definition: H5HLdbg.c:111
H5G_GROUP
@ H5G_GROUP
Definition: H5Gpublic.h:122
H5Gcreate2
H5_DLL hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id)
Definition: H5G.c:340
herr_t
int herr_t
Definition: H5public.h:128
H5G_stat_t::linklen
size_t linklen
Definition: H5Gpublic.h:142
H5G_stat_t::ohdr
H5O_stat_t ohdr
Definition: H5Gpublic.h:143
hbool_t
bool hbool_t
Definition: H5public.h:159
H5G_stat_t
struct H5G_stat_t H5G_stat_t
H5G_iterate_t
herr_t(* H5G_iterate_t)(hid_t group, const char *name, void *op_data)
Definition: H5Gpublic.h:133
H5Gget_info
H5_DLL herr_t H5Gget_info(hid_t loc_id, H5G_info_t *ginfo)
Definition: H5G.c:588
hsize_t
hsize_t
Definition: H5overflow.txt:44
H5G_DATASET
@ H5G_DATASET
Definition: H5Gpublic.h:123
H5G_STORAGE_TYPE_COMPACT
@ H5G_STORAGE_TYPE_COMPACT
Definition: H5Gpublic.h:49
H5G_STORAGE_TYPE_UNKNOWN
@ H5G_STORAGE_TYPE_UNKNOWN
Definition: H5Gpublic.h:46
H5_index_t
H5_index_t
Definition: H5public.h:316
H5G_obj_t
H5G_obj_t
Definition: H5Gpublic.h:120
H5G_info_t
Definition: H5Gpublic.h:54
H5G_info_t::nlinks
hsize_t nlinks
Definition: H5Gpublic.h:56
H5O_stat_t
Definition: H5Opublic.h:248
H5Opublic.h