HDF5  1.12.0
H5Lprivate.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  * This file contains private information about the H5L module
16  * for dealing with links in an HDF5 file.
17  */
18 #ifndef _H5Lprivate_H
19 #define _H5Lprivate_H
20 
21 /* Include package's public header */
22 #include "H5Lpublic.h"
23 
24 /* Private headers needed by this file */
25 #include "H5Gprivate.h" /* Groups */
26 #include "H5Oprivate.h" /* Object headers */
27 
28 
29 /**************************/
30 /* Library Private Macros */
31 /**************************/
32 
33 /* Default number of soft links to traverse */
34 #define H5L_NUM_LINKS 16
35 
36 /* ======== Link creation property names ======== */
37 #define H5L_CRT_INTERMEDIATE_GROUP_NAME "intermediate_group" /* Create intermediate groups flag */
38 
39 /* ======== Link access property names ======== */
40 #define H5L_ACS_NLINKS_NAME "max soft links" /* Number of soft links to traverse */
41 #define H5L_ACS_ELINK_PREFIX_NAME "external link prefix" /* External link prefix */
42 #define H5L_ACS_ELINK_FAPL_NAME "external link fapl" /* file access property list for external link access */
43 #define H5L_ACS_ELINK_FLAGS_NAME "external link flags" /* file access flags for external link traversal */
44 #define H5L_ACS_ELINK_CB_NAME "external link callback" /* callback function for external link traversal */
45 
46 
47 /****************************/
48 /* Library Private Typedefs */
49 /****************************/
50 
51 /* User data for path traversal routine for getting link value by index */
52 typedef struct {
53  /* In */
54  H5_index_t idx_type; /* Index to use */
55  H5_iter_order_t order; /* Order to iterate in index */
56  hsize_t n; /* Offset of link within index */
57  size_t size; /* Size of user buffer */
58 
59  /* Out */
60  void *buf; /* User buffer */
62 
63 /* User data for path traversal routine for getting link info by index */
64 typedef struct {
65  /* In */
66  H5_index_t idx_type; /* Index to use */
67  H5_iter_order_t order; /* Order to iterate in index */
68  hsize_t n; /* Offset of link within index */
69 
70  /* Out */
71  H5L_info2_t *linfo; /* Buffer to return to user */
73 
74 /* User data for path traversal routine for getting name by index */
75 typedef struct {
76  /* In */
77  H5_index_t idx_type; /* Index to use */
78  H5_iter_order_t order; /* Order to iterate in index */
79  hsize_t n; /* Offset of link within index */
80  size_t size; /* Size of name buffer */
81 
82  /* Out */
83  char *name; /* Buffer to return name to user */
84  ssize_t name_len; /* Length of full name */
86 
87 /* User data for path traversal routine for removing link by index */
88 typedef struct {
89  /* In */
90  H5_index_t idx_type; /* Index to use */
91  H5_iter_order_t order; /* Order to iterate in index */
92  hsize_t n; /* Offset of link within index */
94 
95 /* Structure for external link traversal callback property */
96 typedef struct H5L_elink_cb_t {
98  void *user_data;
100 
101 /*****************************/
102 /* Library Private Variables */
103 /*****************************/
104 
105 
106 /******************************/
107 /* Library Private Prototypes */
108 /******************************/
109 
110 /* General operations on links */
111 H5_DLL herr_t H5L_init(void);
112 H5_DLL herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name,
113  H5G_loc_t *obj_loc, hid_t lcpl_id);
114 H5_DLL herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name,
115  H5O_obj_create_t *ocrt_info, hid_t lcpl_id);
116 H5_DLL herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name,
117  const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id);
118 H5_DLL herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *cur_loc,
119  const char *cur_name, hid_t lcpl_id);
120 H5_DLL herr_t H5L_move(const H5G_loc_t *src_loc, const char *src_name,
121  const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag,
122  hid_t lcpl_id);
123 H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name);
124 H5_DLL htri_t H5L_exists(const H5G_loc_t *loc, const char *name);
125 H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name,
126  H5L_info2_t *linkbuf/*out*/);
127 H5_DLL herr_t H5L_delete(const H5G_loc_t *loc, const char *name);
128 H5_DLL herr_t H5L_delete_by_idx(const H5G_loc_t *loc, const char *name,
129  H5_index_t idx_type, H5_iter_order_t order, hsize_t n);
130 H5_DLL herr_t H5L_get_info_by_idx(const H5G_loc_t *loc, const char *name,
131  H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
132  H5L_info2_t *linfo /*out*/);
133 H5_DLL ssize_t H5L_get_name_by_idx(const H5G_loc_t *loc, const char *group_name,
134  H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
135  char *name /*out*/, size_t size);
136 H5_DLL herr_t H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf/*out*/,
137  size_t size);
138 H5_DLL herr_t H5L_get_val_by_idx(const H5G_loc_t *loc, const char *name,
139  H5_index_t idx_type, H5_iter_order_t order, hsize_t n,
140  void *buf/*out*/, size_t size);
142 H5_DLL herr_t H5L_iterate(H5G_loc_t *loc, const char *group_name,
143  H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p,
144  H5L_iterate2_t op, void *op_data);
145 
146 /* User-defined link functions */
150 
151 #endif /* _H5Lprivate_H */
152 
H5L_trav_gibi_t::idx_type
H5_index_t idx_type
Definition: H5Lprivate.h:66
H5Lpublic.h
ssize_t
int ssize_t
Definition: H5public.h:167
H5L_delete
H5_DLL herr_t H5L_delete(const H5G_loc_t *loc, const char *name)
Definition: H5L.c:2556
size
iblock size
Definition: H5EAcache.c:787
H5L_elink_cb_t
struct H5L_elink_cb_t H5L_elink_cb_t
H5L_trav_gibi_t::linfo
H5L_info2_t * linfo
Definition: H5Lprivate.h:71
H5L_iterate2_t
herr_t(* H5L_iterate2_t)(hid_t group, const char *name, const H5L_info2_t *info, void *op_data)
Definition: H5Lpublic.h:132
H5L_get_name_by_idx
H5_DLL ssize_t H5L_get_name_by_idx(const H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, char *name, size_t size)
Definition: H5L.c:3380
H5L_get_info_by_idx
H5_DLL herr_t H5L_get_info_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, H5L_info2_t *linfo)
Definition: H5L.c:3301
H5L_info2_t
Definition: H5Lpublic.h:76
H5Gprivate.h
H5L_trav_gibi_t::n
hsize_t n
Definition: H5Lprivate.h:68
H5L_register
H5_DLL herr_t H5L_register(const H5L_class_t *cls)
Definition: H5L.c:1671
H5G_loc_t
Definition: H5Gprivate.h:144
H5L_delete_by_idx
H5_DLL herr_t H5L_delete_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n)
Definition: H5L.c:2637
H5L_get_val_by_idx
H5_DLL herr_t H5L_get_val_by_idx(const H5G_loc_t *loc, const char *name, H5_index_t idx_type, H5_iter_order_t order, hsize_t n, void *buf, size_t size)
Definition: H5L.c:2466
H5L_elink_traverse_t
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:136
H5L_get_val
H5_DLL herr_t H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf, size_t size)
Definition: H5L.c:2377
htri_t
int htri_t
Definition: H5public.h:160
H5_iter_order_t
H5_iter_order_t
Definition: H5public.h:295
H5L_trav_rmbi_t::order
H5_iter_order_t order
Definition: H5Lprivate.h:91
H5L_trav_gibi_t
Definition: H5Lprivate.h:64
H5L_register_external
H5_DLL herr_t H5L_register_external(void)
Definition: H5Lexternal.c:432
hid_t
int64_t hid_t
Definition: H5Ipublic.h:55
H5L_trav_gnbi_t::n
hsize_t n
Definition: H5Lprivate.h:79
H5L_trav_gnbi_t
Definition: H5Lprivate.h:75
H5L_link_object
H5_DLL herr_t H5L_link_object(const H5G_loc_t *new_loc, const char *new_name, H5O_obj_create_t *ocrt_info, hid_t lcpl_id)
Definition: H5L.c:1809
H5L_trav_rmbi_t
Definition: H5Lprivate.h:88
H5L_trav_gvbi_t
Definition: H5Lprivate.h:52
H5Oprivate.h
H5L_trav_gvbi_t::order
H5_iter_order_t order
Definition: H5Lprivate.h:55
H5L_get_info
H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info2_t *linkbuf)
Definition: H5L.c:3221
H5L_unregister
H5_DLL herr_t H5L_unregister(H5L_type_t id)
Definition: H5L.c:1724
H5L_exists
H5_DLL htri_t H5L_exists(const H5G_loc_t *loc, const char *name)
Definition: H5L.c:3145
H5L_class_t
Definition: H5Lpublic.h:117
H5L_trav_gvbi_t::buf
void * buf
Definition: H5Lprivate.h:60
H5L_iterate
H5_DLL herr_t H5L_iterate(H5G_loc_t *loc, const char *group_name, H5_index_t idx_type, H5_iter_order_t order, hsize_t *idx_p, H5L_iterate2_t op, void *op_data)
Definition: H5L.c:3554
H5L_trav_gnbi_t::name_len
ssize_t name_len
Definition: H5Lprivate.h:84
H5L_create_soft
H5_DLL herr_t H5L_create_soft(const char *target_path, const H5G_loc_t *cur_loc, const char *cur_name, hid_t lcpl_id)
Definition: H5L.c:2170
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5L_find_class
H5_DLL const H5L_class_t * H5L_find_class(H5L_type_t id)
Definition: H5L.c:1636
H5L_create_hard
H5_DLL herr_t H5L_create_hard(H5G_loc_t *cur_loc, const char *cur_name, const H5G_loc_t *link_loc, const char *link_name, hid_t lcpl_id)
Definition: H5L.c:2097
H5L_trav_rmbi_t::n
hsize_t n
Definition: H5Lprivate.h:92
H5L_trav_gvbi_t::idx_type
H5_index_t idx_type
Definition: H5Lprivate.h:54
H5L_trav_gvbi_t::size
size_t size
Definition: H5Lprivate.h:57
H5L_init
H5_DLL herr_t H5L_init(void)
Definition: H5L.c:181
H5L_exists_tolerant
H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name)
Definition: H5L.c:3078
H5L_trav_gnbi_t::idx_type
H5_index_t idx_type
Definition: H5Lprivate.h:77
H5L_trav_gnbi_t::size
size_t size
Definition: H5Lprivate.h:80
n
*s *s n
Definition: H5HLdbg.c:111
H5L_move
H5_DLL herr_t H5L_move(const H5G_loc_t *src_loc, const char *src_name, const H5G_loc_t *dst_loc, const char *dst_name, hbool_t copy_flag, hid_t lcpl_id)
Definition: H5L.c:2910
H5L_trav_gvbi_t::n
hsize_t n
Definition: H5Lprivate.h:56
herr_t
int herr_t
Definition: H5public.h:128
H5L_trav_rmbi_t::idx_type
H5_index_t idx_type
Definition: H5Lprivate.h:90
H5L_trav_gnbi_t::name
char * name
Definition: H5Lprivate.h:83
hbool_t
bool hbool_t
Definition: H5public.h:159
H5L_type_t
H5L_type_t
Definition: H5Lpublic.h:63
H5L_trav_gnbi_t::order
H5_iter_order_t order
Definition: H5Lprivate.h:78
hsize_t
hsize_t
Definition: H5overflow.txt:44
H5L_trav_gibi_t::order
H5_iter_order_t order
Definition: H5Lprivate.h:67
H5_index_t
H5_index_t
Definition: H5public.h:316
H5L_link
H5_DLL herr_t H5L_link(const H5G_loc_t *new_loc, const char *new_name, H5G_loc_t *obj_loc, hid_t lcpl_id)
Definition: H5L.c:1766
H5O_obj_create_t
Definition: H5Oprivate.h:874