HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 files COPYING and Copyright.html. COPYING can be found at the root *
9  * of the source code distribution tree; Copyright.html can be found at the *
10  * root level of an installed copy of the electronic HDF5 document set and *
11  * is linked from the top-level documents page. It can also be found at *
12  * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
13  * access to either file, you may request a copy from help@hdfgroup.org. *
14  * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
15 
16 /*-------------------------------------------------------------------------
17  *
18  * Created: H5Gpublic.h
19  * Jul 11 1997
20  * Robb Matzke <matzke@llnl.gov>
21  *
22  * Purpose: Public declarations for the H5G package
23  *
24  *-------------------------------------------------------------------------
25  */
26 #ifndef _H5Gpublic_H
27 #define _H5Gpublic_H
28 
29 /* System headers needed by this file */
30 #include <sys/types.h>
31 
32 /* Public headers needed by this file */
33 #include "H5public.h" /* Generic Functions */
34 #include "H5Lpublic.h" /* Links */
35 #include "H5Opublic.h" /* Object headers */
36 #include "H5Tpublic.h" /* Datatypes */
37 
38 /*****************/
39 /* Public Macros */
40 /*****************/
41 
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45 
46 /*******************/
47 /* Public Typedefs */
48 /*******************/
49 
50 /* Types of link storage for groups */
51 typedef enum H5G_storage_type_t {
52  H5G_STORAGE_TYPE_UNKNOWN = -1, /* Unknown link storage type */
53  H5G_STORAGE_TYPE_SYMBOL_TABLE, /* Links in group are stored with a "symbol table" */
54  /* (this is sometimes called "old-style" groups) */
55  H5G_STORAGE_TYPE_COMPACT, /* Links are stored in object header */
56  H5G_STORAGE_TYPE_DENSE /* Links are stored in fractal heap & indexed with v2 B-tree */
58 
59 /* Information struct for group (for H5Gget_info/H5Gget_info_by_name/H5Gget_info_by_idx) */
60 typedef struct H5G_info_t {
61  H5G_storage_type_t storage_type; /* Type of storage for links in group */
62  hsize_t nlinks; /* Number of links in group */
63  int64_t max_corder; /* Current max. creation order value for group */
64  hbool_t mounted; /* Whether group has a file mounted on it */
65 } H5G_info_t;
66 
67 /********************/
68 /* Public Variables */
69 /********************/
70 
71 
72 /*********************/
73 /* Public Prototypes */
74 /*********************/
75 H5_DLL hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id,
76  hid_t gcpl_id, hid_t gapl_id);
77 H5_DLL hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id);
78 H5_DLL hid_t H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id);
80 H5_DLL herr_t H5Gget_info(hid_t loc_id, H5G_info_t *ginfo);
81 H5_DLL herr_t H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *ginfo,
82  hid_t lapl_id);
83 H5_DLL herr_t H5Gget_info_by_idx(hid_t loc_id, const char *group_name,
84  H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5G_info_t *ginfo,
85  hid_t lapl_id);
86 H5_DLL herr_t H5Gclose(hid_t group_id);
87 
88 /* Symbols defined for compatibility with previous versions of the HDF5 API.
89  *
90  * Use of these symbols is deprecated.
91  */
92 #ifndef H5_NO_DEPRECATED_SYMBOLS
93 
94 /* Macros */
95 
96 /* Link definitions */
97 #define H5G_SAME_LOC H5L_SAME_LOC
98 #define H5G_LINK_ERROR H5L_TYPE_ERROR
99 #define H5G_LINK_HARD H5L_TYPE_HARD
100 #define H5G_LINK_SOFT H5L_TYPE_SOFT
101 #define H5G_link_t H5L_type_t
102 
103 /* Macros for types of objects in a group (see H5G_obj_t definition) */
104 #define H5G_NTYPES 256 /* Max possible number of types */
105 #define H5G_NLIBTYPES 8 /* Number of internal types */
106 #define H5G_NUSERTYPES (H5G_NTYPES - H5G_NLIBTYPES)
107 #define H5G_USERTYPE(X) (8 + (X)) /* User defined types */
108 
109 
110 /* Typedefs */
111 
112 /*
113  * An object has a certain type. The first few numbers are reserved for use
114  * internally by HDF5. Users may add their own types with higher values. The
115  * values are never stored in the file -- they only exist while an
116  * application is running. An object may satisfy the `isa' function for more
117  * than one type.
118  */
119 typedef enum H5G_obj_t {
120  H5G_UNKNOWN = -1, /* Unknown object type */
121  H5G_GROUP, /* Object is a group */
122  H5G_DATASET, /* Object is a dataset */
123  H5G_TYPE, /* Object is a named data type */
124  H5G_LINK, /* Object is a symbolic link */
125  H5G_UDLINK, /* Object is a user-defined link */
126  H5G_RESERVED_5, /* Reserved for future use */
127  H5G_RESERVED_6, /* Reserved for future use */
128  H5G_RESERVED_7 /* Reserved for future use */
129 } H5G_obj_t;
130 
131 /* Prototype for H5Giterate() operator */
132 typedef herr_t (*H5G_iterate_t)(hid_t group, const char *name, void *op_data);
133 
134 /* Information about an object */
135 typedef struct H5G_stat_t {
136  unsigned long fileno[2]; /*file number */
137  unsigned long objno[2]; /*object number */
138  unsigned nlink; /*number of hard links to object*/
139  H5G_obj_t type; /*basic object type */
140  time_t mtime; /*modification time */
141  size_t linklen; /*symbolic link value length */
142  H5O_stat_t ohdr; /* Object header information */
143 } H5G_stat_t;
144 
145 
146 /* Function prototypes */
147 H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint);
148 H5_DLL hid_t H5Gopen1(hid_t loc_id, const char *name);
149 H5_DLL herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name,
150  const char *new_name);
151 H5_DLL herr_t H5Glink2(hid_t cur_loc_id, const char *cur_name, H5G_link_t type,
152  hid_t new_loc_id, const char *new_name);
153 H5_DLL herr_t H5Gmove(hid_t src_loc_id, const char *src_name,
154  const char *dst_name);
155 H5_DLL herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id,
156  const char *dst_name);
157 H5_DLL herr_t H5Gunlink(hid_t loc_id, const char *name);
158 H5_DLL herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size,
159  char *buf/*out*/);
160 H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment);
161 H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize,
162  char *buf);
163 H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx,
164  H5G_iterate_t op, void *op_data);
165 H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs);
166 H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name,
167  hbool_t follow_link, H5G_stat_t *statbuf/*out*/);
168 H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char* name,
169  size_t size);
171 
172 #endif /* H5_NO_DEPRECATED_SYMBOLS */
173 
174 #ifdef __cplusplus
175 }
176 #endif
177 #endif /* _H5Gpublic_H */
178 
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)
GLenum GLuint GLsizei bufsize
Definition: glcorearb.h:1817
hsize_t nlinks
Definition: H5Gpublic.h:62
unsigned int hbool_t
Definition: H5public.h:125
int64_t max_corder
Definition: H5Gpublic.h:63
H5_DLL hid_t H5Gopen1(hid_t loc_id, const char *name)
struct H5G_stat_t H5G_stat_t
H5_DLL hid_t H5Gget_create_plist(hid_t group_id)
H5_index_t
Definition: H5public.h:289
#define H5_DLL
Definition: H5api_adpt.h:406
unsigned long fileno[2]
Definition: H5Gpublic.h:136
int herr_t
Definition: H5public.h:107
H5_DLL hid_t H5Gopen2(hid_t loc_id, const char *name, hid_t gapl_id)
H5_DLL int H5Gget_comment(hid_t loc_id, const char *name, size_t bufsize, char *buf)
unsigned nlink
Definition: H5Gpublic.h:138
H5_DLL herr_t H5Gmove2(hid_t src_loc_id, const char *src_name, hid_t dst_loc_id, const char *dst_name)
H5_DLL herr_t H5Glink(hid_t cur_loc_id, H5G_link_t type, const char *cur_name, const char *new_name)
unsigned long long hsize_t
Definition: H5public.h:151
struct H5G_info_t H5G_info_t
hbool_t mounted
Definition: H5Gpublic.h:64
herr_t(* H5G_iterate_t)(hid_t group, const char *name, void *op_data)
Definition: H5Gpublic.h:132
GLsizeiptr size
Definition: glcorearb.h:663
H5_DLL herr_t H5Gclose(hid_t group_id)
#define H5G_link_t
Definition: H5Gpublic.h:101
GLdouble n
Definition: glcorearb.h:2007
H5G_storage_type_t
Definition: H5Gpublic.h:51
H5_DLL herr_t H5Gget_info(hid_t loc_id, H5G_info_t *ginfo)
H5_DLL H5G_obj_t H5Gget_objtype_by_idx(hid_t loc_id, hsize_t idx)
H5_iter_order_t
Definition: H5public.h:268
H5G_storage_type_t storage_type
Definition: H5Gpublic.h:61
size_t linklen
Definition: H5Gpublic.h:141
H5_DLL herr_t H5Gget_info_by_name(hid_t loc_id, const char *name, H5G_info_t *ginfo, hid_t lapl_id)
int hid_t
Definition: H5Ipublic.h:56
GLuint const GLchar * name
Definition: glcorearb.h:785
H5_DLL hid_t H5Gcreate2(hid_t loc_id, const char *name, hid_t lcpl_id, hid_t gcpl_id, hid_t gapl_id)
H5_DLL herr_t H5Gset_comment(hid_t loc_id, const char *name, const char *comment)
H5_DLL herr_t H5Gunlink(hid_t loc_id, const char *name)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2539
time_t mtime
Definition: H5Gpublic.h:140
H5G_obj_t type
Definition: H5Gpublic.h:139
H5_DLL herr_t H5Giterate(hid_t loc_id, const char *name, int *idx, H5G_iterate_t op, void *op_data)
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
H5G_obj_t
Definition: H5Gpublic.h:119
H5_DLL herr_t H5Gget_linkval(hid_t loc_id, const char *name, size_t size, char *buf)
H5_DLL hid_t H5Gcreate1(hid_t loc_id, const char *name, size_t size_hint)
H5_DLL herr_t H5Gget_objinfo(hid_t loc_id, const char *name, hbool_t follow_link, H5G_stat_t *statbuf)
H5_DLL herr_t H5Gmove(hid_t src_loc_id, const char *src_name, const char *dst_name)
H5_DLL ssize_t H5Gget_objname_by_idx(hid_t loc_id, hsize_t idx, char *name, size_t size)
H5O_stat_t ohdr
Definition: H5Gpublic.h:142
H5_DLL hid_t H5Gcreate_anon(hid_t loc_id, hid_t gcpl_id, hid_t gapl_id)
H5_DLL herr_t H5Gget_num_objs(hid_t loc_id, hsize_t *num_objs)
unsigned long objno[2]
Definition: H5Gpublic.h:137
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)