MISR Toolkit  1.5.1
H5Lpublic.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: H5Lpublic.h
17  * Dec 1 2005
18  * James Laird
19  *
20  * Purpose: Public declarations for the H5L package (links)
21  *
22  *-------------------------------------------------------------------------
23  */
24 #ifndef _H5Lpublic_H
25 #define _H5Lpublic_H
26 
27 /* Public headers needed by this file */
28 #include "H5public.h" /* Generic Functions */
29 #include "H5Ipublic.h" /* IDs */
30 #include "H5Tpublic.h" /* Datatypes */
31 
32 /*****************/
33 /* Public Macros */
34 /*****************/
35 
36 /* Maximum length of a link's name */
37 /* (encoded in a 32-bit unsigned integer) */
38 #define H5L_MAX_LINK_NAME_LEN ((uint32_t)(-1)) /* (4GB - 1) */
39 
40 /* Macro to indicate operation occurs on same location */
41 #define H5L_SAME_LOC (hid_t)0
42 
43 /* Current version of the H5L_class_t struct */
44 #define H5L_LINK_CLASS_T_VERS 0
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 /*******************/
51 /* Public Typedefs */
52 /*******************/
53 
54 /* Link class types.
55  * Values less than 64 are reserved for the HDF5 library's internal use.
56  * Values 64 to 255 are for "user-defined" link class types; these types are
57  * defined by HDF5 but their behavior can be overridden by users.
58  * Users who want to create new classes of links should contact the HDF5
59  * development team at hdfhelp@ncsa.uiuc.edu .
60  * These values can never change because they appear in HDF5 files.
61  */
62 typedef enum {
63  H5L_TYPE_ERROR = (-1), /* Invalid link type id */
64  H5L_TYPE_HARD = 0, /* Hard link id */
65  H5L_TYPE_SOFT = 1, /* Soft link id */
66  H5L_TYPE_EXTERNAL = 64, /* External link id */
67  H5L_TYPE_MAX = 255 /* Maximum link type id */
68 } H5L_type_t;
69 #define H5L_TYPE_BUILTIN_MAX H5L_TYPE_SOFT /* Maximum value link value for "built-in" link types */
70 #define H5L_TYPE_UD_MIN H5L_TYPE_EXTERNAL /* Link ids at or above this value are "user-defined" link types. */
71 
72 /* Information struct for link (for H5Lget_info/H5Lget_info_by_idx) */
73 typedef struct {
74  H5L_type_t type; /* Type of link */
75  hbool_t corder_valid; /* Indicate if creation order is valid */
76  int64_t corder; /* Creation order */
77  H5T_cset_t cset; /* Character set of link name */
78  union {
79  haddr_t address; /* Address hard link points to */
80  size_t val_size; /* Size of a soft link or UD link value */
81  } u;
82 } H5L_info_t;
83 
84 /* The H5L_class_t struct can be used to override the behavior of a
85  * "user-defined" link class. Users should populate the struct with callback
86  * functions defined below.
87  */
88 /* Callback prototypes for user-defined links */
89 /* Link creation callback */
90 typedef herr_t (*H5L_create_func_t)(const char *link_name, hid_t loc_group,
91  const void *lnkdata, size_t lnkdata_size, hid_t lcpl_id);
92 
93 /* Callback for when the link is moved */
94 typedef herr_t (*H5L_move_func_t)(const char *new_name, hid_t new_loc,
95  const void *lnkdata, size_t lnkdata_size);
96 
97 /* Callback for when the link is copied */
98 typedef herr_t (*H5L_copy_func_t)(const char *new_name, hid_t new_loc,
99  const void *lnkdata, size_t lnkdata_size);
100 
101 /* Callback during link traversal */
102 typedef hid_t (*H5L_traverse_func_t)(const char *link_name, hid_t cur_group,
103  const void *lnkdata, size_t lnkdata_size, hid_t lapl_id);
104 
105 /* Callback for when the link is deleted */
106 typedef herr_t (*H5L_delete_func_t)(const char *link_name, hid_t file,
107  const void *lnkdata, size_t lnkdata_size);
108 
109 /* Callback for querying the link */
110 /* Returns the size of the buffer needed */
111 typedef ssize_t (*H5L_query_func_t)(const char *link_name, const void *lnkdata,
112  size_t lnkdata_size, void *buf /*out*/, size_t buf_size);
113 
114 /* User-defined link types */
115 typedef struct {
116  int version; /* Version number of this struct */
117  H5L_type_t id; /* Link type ID */
118  const char *comment; /* Comment for debugging */
119  H5L_create_func_t create_func; /* Callback during link creation */
120  H5L_move_func_t move_func; /* Callback after moving link */
121  H5L_copy_func_t copy_func; /* Callback after copying link */
122  H5L_traverse_func_t trav_func; /* Callback during link traversal */
123  H5L_delete_func_t del_func; /* Callback for link deletion */
124  H5L_query_func_t query_func; /* Callback for queries */
125 } H5L_class_t;
126 
127 /* Prototype for H5Literate/H5Literate_by_name() operator */
128 typedef herr_t (*H5L_iterate_t)(hid_t group, const char *name, const H5L_info_t *info,
129  void *op_data);
130 
131 /* Callback for external link traversal */
132 typedef herr_t (*H5L_elink_traverse_t)(const char *parent_file_name,
133  const char *parent_group_name, const char *child_file_name,
134  const char *child_object_name, unsigned *acc_flags, hid_t fapl_id,
135  void *op_data);
136 
137 
138 /********************/
139 /* Public Variables */
140 /********************/
141 
142 
143 /*********************/
144 /* Public Prototypes */
145 /*********************/
146 H5_DLL herr_t H5Lmove(hid_t src_loc, const char *src_name, hid_t dst_loc,
147  const char *dst_name, hid_t lcpl_id, hid_t lapl_id);
148 H5_DLL herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc,
149  const char *dst_name, hid_t lcpl_id, hid_t lapl_id);
150 H5_DLL herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name,
151  hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id);
152 H5_DLL herr_t H5Lcreate_soft(const char *link_target, hid_t link_loc_id,
153  const char *link_name, hid_t lcpl_id, hid_t lapl_id);
154 H5_DLL herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id);
155 H5_DLL herr_t H5Ldelete_by_idx(hid_t loc_id, const char *group_name,
156  H5_index_t idx_type, H5_iter_order_t order, hsize_t n, hid_t lapl_id);
157 H5_DLL herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf/*out*/,
158  size_t size, hid_t lapl_id);
159 H5_DLL herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name,
161  void *buf/*out*/, size_t size, hid_t lapl_id);
162 H5_DLL htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id);
163 H5_DLL herr_t H5Lget_info(hid_t loc_id, const char *name,
164  H5L_info_t *linfo /*out*/, hid_t lapl_id);
165 H5_DLL herr_t H5Lget_info_by_idx(hid_t loc_id, const char *group_name,
167  H5L_info_t *linfo /*out*/, hid_t lapl_id);
168 H5_DLL ssize_t H5Lget_name_by_idx(hid_t loc_id, const char *group_name,
170  char *name /*out*/, size_t size, hid_t lapl_id);
171 H5_DLL herr_t H5Literate(hid_t grp_id, H5_index_t idx_type,
172  H5_iter_order_t order, hsize_t *idx, H5L_iterate_t op, void *op_data);
173 H5_DLL herr_t H5Literate_by_name(hid_t loc_id, const char *group_name,
175  H5L_iterate_t op, void *op_data, hid_t lapl_id);
177  H5L_iterate_t op, void *op_data);
178 H5_DLL herr_t H5Lvisit_by_name(hid_t loc_id, const char *group_name,
180  void *op_data, hid_t lapl_id);
181 
182 /* UD link functions */
183 H5_DLL herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name,
184  H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id,
185  hid_t lapl_id);
189 
190 /* External link functions */
191 H5_DLL herr_t H5Lunpack_elink_val(const void *ext_linkval/*in*/, size_t link_size,
192  unsigned *flags, const char **filename/*out*/, const char **obj_path /*out*/);
193 H5_DLL herr_t H5Lcreate_external(const char *file_name, const char *obj_name,
194  hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id);
195 
196 #ifdef __cplusplus
197 }
198 #endif
199 #endif /* _H5Lpublic_H */
200 
H5T_cset_t cset
Definition: H5Lpublic.h:77
herr_t(* H5L_elink_traverse_t)(const char *parent_file_name, const char *parent_group_name, const char *child_file_name, const char *child_object_name, unsigned *acc_flags, hid_t fapl_id, void *op_data)
Definition: H5Lpublic.h:132
H5_DLL herr_t H5Lcopy(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id)
HDFFCLIBAPI intf * info
ssize_t(* H5L_query_func_t)(const char *link_name, const void *lnkdata, size_t lnkdata_size, void *buf, size_t buf_size)
Definition: H5Lpublic.h:111
unsigned int hbool_t
Definition: H5public.h:142
HDFFCLIBAPI intf * idx
char * filename
Definition: cdjpeg.h:133
herr_t(* H5L_iterate_t)(hid_t group, const char *name, const H5L_info_t *info, void *op_data)
Definition: H5Lpublic.h:128
H5L_type_t id
Definition: H5Lpublic.h:117
H5_DLL herr_t H5Lget_info(hid_t loc_id, const char *name, H5L_info_t *linfo, hid_t lapl_id)
H5_index_t
Definition: H5public.h:305
long long ssize_t
Definition: H5public.h:156
#define H5_DLL
Definition: H5api_adpt.h:256
int herr_t
Definition: H5public.h:124
H5_DLL htri_t H5Lis_registered(H5L_type_t id)
H5_DLL herr_t H5Lvisit(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data)
haddr_t address
Definition: H5Lpublic.h:79
unsigned long long hsize_t
Definition: H5public.h:169
H5_DLL herr_t H5Lunregister(H5L_type_t id)
H5_DLL ssize_t H5Lget_name_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, size_t size, hid_t lapl_id)
H5_DLL herr_t H5Lcreate_external(const char *file_name, const char *obj_name, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id)
H5_DLL htri_t H5Lexists(hid_t loc_id, const char *name, hid_t lapl_id)
int64_t corder
Definition: H5Lpublic.h:76
size_t val_size
Definition: H5Lpublic.h:80
uint64_t haddr_t
Definition: H5public.h:182
H5L_copy_func_t copy_func
Definition: H5Lpublic.h:121
H5_DLL herr_t H5Lget_val(hid_t loc_id, const char *name, void *buf, size_t size, hid_t lapl_id)
H5_DLL herr_t H5Lcreate_ud(hid_t link_loc_id, const char *link_name, H5L_type_t link_type, const void *udata, size_t udata_size, hid_t lcpl_id, hid_t lapl_id)
H5_DLL herr_t H5Lmove(hid_t src_loc, const char *src_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id)
HDFFCLIBAPI _fcd name
H5T_cset_t
Definition: H5Tpublic.h:78
herr_t(* H5L_copy_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata, size_t lnkdata_size)
Definition: H5Lpublic.h:98
H5_DLL herr_t H5Lget_val_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, void *buf, size_t size, hid_t lapl_id)
H5_iter_order_t
Definition: H5public.h:284
H5_DLL herr_t H5Literate(hid_t grp_id, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5L_iterate_t op, void *op_data)
H5_DLL herr_t H5Lregister(const H5L_class_t *cls)
HDFFCLIBAPI _fcd intf intf * order
H5_DLL herr_t H5Ldelete(hid_t loc_id, const char *name, hid_t lapl_id)
HDFFCLIBAPI intf * size
int hid_t
Definition: H5Ipublic.h:54
HDFFCLIBAPI _fcd _fcd intf * n
herr_t(* H5L_delete_func_t)(const char *link_name, hid_t file, const void *lnkdata, size_t lnkdata_size)
Definition: H5Lpublic.h:106
H5_DLL herr_t H5Lunpack_elink_val(const void *ext_linkval, size_t link_size, unsigned *flags, const char **filename, const char **obj_path)
H5_DLL herr_t H5Lcreate_hard(hid_t cur_loc, const char *cur_name, hid_t dst_loc, const char *dst_name, hid_t lcpl_id, hid_t lapl_id)
herr_t(* H5L_create_func_t)(const char *link_name, hid_t loc_group, const void *lnkdata, size_t lnkdata_size, hid_t lcpl_id)
Definition: H5Lpublic.h:90
H5_DLL herr_t H5Lvisit_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, H5L_iterate_t op, void *op_data, hid_t lapl_id)
hid_t(* H5L_traverse_func_t)(const char *link_name, hid_t cur_group, const void *lnkdata, size_t lnkdata_size, hid_t lapl_id)
Definition: H5Lpublic.h:102
H5L_traverse_func_t trav_func
Definition: H5Lpublic.h:122
const char * comment
Definition: H5Lpublic.h:118
H5L_type_t
Definition: H5Lpublic.h:62
HDFFCLIBAPI intf intf * flags
hbool_t corder_valid
Definition: H5Lpublic.h:75
H5L_create_func_t create_func
Definition: H5Lpublic.h:119
H5L_move_func_t move_func
Definition: H5Lpublic.h:120
H5_DLL herr_t H5Lcreate_soft(const char *link_target, hid_t link_loc_id, const char *link_name, hid_t lcpl_id, hid_t lapl_id)
H5_DLL herr_t H5Ldelete_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)
H5L_query_func_t query_func
Definition: H5Lpublic.h:124
int htri_t
Definition: H5public.h:143
H5L_type_t type
Definition: H5Lpublic.h:74
H5_DLL herr_t H5Literate_by_name(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx, H5L_iterate_t op, void *op_data, hid_t lapl_id)
HDFFCLIBAPI intf * buf
H5L_delete_func_t del_func
Definition: H5Lpublic.h:123
herr_t(* H5L_move_func_t)(const char *new_name, hid_t new_loc, const void *lnkdata, size_t lnkdata_size)
Definition: H5Lpublic.h:94
H5_DLL herr_t H5Lget_info_by_idx(hid_t loc_id, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5L_info_t *linfo, hid_t lapl_id)

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