summaryrefslogtreecommitdiffstats
path: root/src/H5Lprivate.h
blob: fe7ee686a017f40dbcda34a8c85b114fd314b69e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
 * Copyright by The HDF Group.                                               *
 * Copyright by the Board of Trustees of the University of Illinois.         *
 * All rights reserved.                                                      *
 *                                                                           *
 * This file is part of HDF5.  The full HDF5 copyright notice, including     *
 * terms governing use, modification, and redistribution, is contained in    *
 * the COPYING file, which can be found at the root of the source code       *
 * distribution tree, or in https://www.hdfgroup.org/licenses.               *
 * If you do not have access to either file, you may request a copy from     *
 * help@hdfgroup.org.                                                        *
 * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */

/*
 * This file contains private information about the H5L module
 * for dealing with links in an HDF5 file.
 */
#ifndef H5Lprivate_H
#define H5Lprivate_H

/* Include package's public header */
#include "H5Lpublic.h"

/* Private headers needed by this file */
#include "H5Gprivate.h" /* Groups                */
#include "H5Oprivate.h" /* Object headers            */

/**************************/
/* Library Private Macros */
/**************************/

/* Default number of soft links to traverse */
#define H5L_NUM_LINKS 16

/* ========  Link creation property names ======== */
#define H5L_CRT_INTERMEDIATE_GROUP_NAME "intermediate_group" /* Create intermediate groups flag */

/* ========  Link access property names ======== */
/* Number of soft links to traverse */
#define H5L_ACS_NLINKS_NAME "max soft links"
/* External link prefix */
#define H5L_ACS_ELINK_PREFIX_NAME "external link prefix"
/* file access property list for external link access */
#define H5L_ACS_ELINK_FAPL_NAME "external link fapl"
/* file access flags for external link traversal */
#define H5L_ACS_ELINK_FLAGS_NAME "external link flags"
/*  callback function for external link traversal */
#define H5L_ACS_ELINK_CB_NAME "external link callback"

/****************************/
/* Library Private Typedefs */
/****************************/

/* User data for path traversal routine for getting link value by index */
typedef struct {
    /* In */
    H5_index_t      idx_type; /* Index to use */
    H5_iter_order_t order;    /* Order to iterate in index */
    hsize_t         n;        /* Offset of link within index */
    size_t          size;     /* Size of user buffer */

    /* Out */
    void *buf; /* User buffer */
} H5L_trav_gvbi_t;

/* User data for path traversal routine for getting link info by index */
typedef struct {
    /* In */
    H5_index_t      idx_type; /* Index to use */
    H5_iter_order_t order;    /* Order to iterate in index */
    hsize_t         n;        /* Offset of link within index */

    /* Out */
    H5L_info_t *linfo; /* Buffer to return to user */
} H5L_trav_gibi_t;

/* User data for path traversal routine for getting name by index */
typedef struct {
    /* In */
    H5_index_t      idx_type; /* Index to use */
    H5_iter_order_t order;    /* Order to iterate in index */
    hsize_t         n;        /* Offset of link within index */
    size_t          size;     /* Size of name buffer */

    /* Out */
    char *  name;     /* Buffer to return name to user */
    ssize_t name_len; /* Length of full name */
} H5L_trav_gnbi_t;

/* User data for path traversal routine for removing link by index */
typedef struct {
    /* In */
    H5_index_t      idx_type; /* Index to use */
    H5_iter_order_t order;    /* Order to iterate in index */
    hsize_t         n;        /* Offset of link within index */
} H5L_trav_rmbi_t;

/* Structure for external link traversal callback property */
typedef struct H5L_elink_cb_t {
    H5L_elink_traverse_t func;
    void *               user_data;
} H5L_elink_cb_t;

/*****************************/
/* Library Private Variables */
/*****************************/

/******************************/
/* Library Private Prototypes */
/******************************/

/* General operations on links */
H5_DLL herr_t H5L_init(void);
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);
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);
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);
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);
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);
H5_DLL htri_t H5L_exists_tolerant(const H5G_loc_t *loc, const char *name);
H5_DLL herr_t H5L_get_info(const H5G_loc_t *loc, const char *name, H5L_info_t *linkbuf /*out*/);
H5_DLL herr_t H5L_delete(const H5G_loc_t *loc, const char *name);
H5_DLL herr_t H5L_get_val(const H5G_loc_t *loc, const char *name, void *buf /*out*/, size_t size);
H5_DLL herr_t H5L_register_external(void);

/* User-defined link functions */
H5_DLL herr_t H5L_register(const H5L_class_t *cls);
H5_DLL herr_t H5L_unregister(H5L_type_t id);
H5_DLL const H5L_class_t *H5L_find_class(H5L_type_t id);

#endif /* H5Lprivate_H */