HDF5  1.12.0
H5Spublic.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 public declarations for the H5S module.
16  */
17 #ifndef _H5Spublic_H
18 #define _H5Spublic_H
19 
20 /* Public headers needed by this file */
21 #include "H5public.h"
22 #include "H5Ipublic.h"
23 
24 /* Define atomic datatypes */
25 #define H5S_ALL (hid_t)0
26 #define H5S_UNLIMITED HSIZE_UNDEF
27 
28 /* Define user-level maximum number of dimensions */
29 #define H5S_MAX_RANK 32
30 
31 /* Flags for selection iterators */
32 #define H5S_SEL_ITER_GET_SEQ_LIST_SORTED 0x0001 /* Retrieve elements from iterator
33  * in increasing offset order, for
34  * each call to retrieve sequences.
35  * Currently, this only applies to
36  * point selections, as hyperslab
37  * selections are always returned
38  * in increasing offset order.
39  *
40  * Note that the order is only
41  * increasing for each call to
42  * get_seq_list, the next set of
43  * sequences could start with an
44  * earlier offset than the previous
45  * one.
46  */
47 #define H5S_SEL_ITER_SHARE_WITH_DATASPACE 0x0002 /* Don't copy the dataspace
48  * selection when creating the
49  * selection iterator.
50  *
51  * This can improve performance
52  * of creating the iterator, but
53  * the dataspace _MUST_NOT_ be
54  * modified or closed until the
55  * selection iterator is closed
56  * or the iterator's behavior
57  * will be undefined.
58  */
59 
60 /* Different types of dataspaces */
61 typedef enum H5S_class_t {
62  H5S_NO_CLASS = -1, /*error */
63  H5S_SCALAR = 0, /*scalar variable */
64  H5S_SIMPLE = 1, /*simple dataspace */
65  H5S_NULL = 2 /*null dataspace */
66 } H5S_class_t;
67 
68 /* Different ways of combining selections */
69 typedef enum H5S_seloper_t {
70  H5S_SELECT_NOOP = -1, /* error */
71  H5S_SELECT_SET = 0, /* Select "set" operation */
72  H5S_SELECT_OR, /* Binary "or" operation for hyperslabs
73  * (add new selection to existing selection)
74  * Original region: AAAAAAAAAA
75  * New region: BBBBBBBBBB
76  * A or B: CCCCCCCCCCCCCCCC
77  */
78  H5S_SELECT_AND, /* Binary "and" operation for hyperslabs
79  * (only leave overlapped regions in selection)
80  * Original region: AAAAAAAAAA
81  * New region: BBBBBBBBBB
82  * A and B: CCCC
83  */
84  H5S_SELECT_XOR, /* Binary "xor" operation for hyperslabs
85  * (only leave non-overlapped regions in selection)
86  * Original region: AAAAAAAAAA
87  * New region: BBBBBBBBBB
88  * A xor B: CCCCCC CCCCCC
89  */
90  H5S_SELECT_NOTB, /* Binary "not" operation for hyperslabs
91  * (only leave non-overlapped regions in original selection)
92  * Original region: AAAAAAAAAA
93  * New region: BBBBBBBBBB
94  * A not B: CCCCCC
95  */
96  H5S_SELECT_NOTA, /* Binary "not" operation for hyperslabs
97  * (only leave non-overlapped regions in new selection)
98  * Original region: AAAAAAAAAA
99  * New region: BBBBBBBBBB
100  * B not A: CCCCCC
101  */
102  H5S_SELECT_APPEND, /* Append elements to end of point selection */
103  H5S_SELECT_PREPEND, /* Prepend elements to beginning of point selection */
104  H5S_SELECT_INVALID /* Invalid upper bound on selection operations */
105 } H5S_seloper_t;
106 
107 /* Enumerated type for the type of selection */
108 typedef enum {
109  H5S_SEL_ERROR = -1, /* Error */
110  H5S_SEL_NONE = 0, /* Nothing selected */
111  H5S_SEL_POINTS = 1, /* Points / elements selected */
112  H5S_SEL_HYPERSLABS = 2, /* Hyperslab selected */
113  H5S_SEL_ALL = 3, /* Entire extent selected */
114  H5S_SEL_N /*THIS MUST BE LAST */
115 } H5S_sel_type;
116 
117 #ifdef __cplusplus
118 extern "C" {
119 #endif
120 
121 /* Operations on dataspaces */
123 H5_DLL hid_t H5Screate_simple(int rank, const hsize_t dims[],
124  const hsize_t maxdims[]);
125 H5_DLL herr_t H5Sset_extent_simple(hid_t space_id, int rank,
126  const hsize_t dims[], const hsize_t max[]);
127 H5_DLL hid_t H5Scopy(hid_t space_id);
128 H5_DLL herr_t H5Sclose(hid_t space_id);
129 H5_DLL herr_t H5Sencode2(hid_t obj_id, void *buf, size_t *nalloc, hid_t fapl);
130 H5_DLL hid_t H5Sdecode(const void *buf);
133 H5_DLL int H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[],
134  hsize_t maxdims[]);
135 H5_DLL htri_t H5Sis_simple(hid_t space_id);
138 H5_DLL herr_t H5Sextent_copy(hid_t dst_id,hid_t src_id);
140 
141 /* Operations on dataspace selections */
144 H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id);
146 H5_DLL herr_t H5Sselect_adjust(hid_t spaceid, const hssize_t *offset);
148  hsize_t end[]);
149 H5_DLL htri_t H5Sselect_shape_same(hid_t space1_id, hid_t space2_id);
150 H5_DLL htri_t H5Sselect_intersect_block(hid_t space_id, const hsize_t *start,
151  const hsize_t *end);
152 H5_DLL herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset);
156  size_t num_elem, const hsize_t *coord);
159  hsize_t numpoints, hsize_t buf[/*numpoints*/]);
161  const hsize_t start[], const hsize_t _stride[], const hsize_t count[],
162  const hsize_t _block[]);
164  const hsize_t start[], const hsize_t _stride[], const hsize_t count[],
165  const hsize_t _block[]);
166 H5_DLL herr_t H5Smodify_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id);
167 H5_DLL hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id);
170  hsize_t stride[], hsize_t count[], hsize_t block[]);
173  hsize_t numblocks, hsize_t buf[/*numblocks*/]);
175  hid_t dst_space_id, hid_t src_intersect_space_id);
176 
177 /* Operations on dataspace selection iterators */
178 H5_DLL hid_t H5Ssel_iter_create(hid_t spaceid, size_t elmt_size, unsigned flags);
179 H5_DLL herr_t H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq,
180  size_t maxbytes, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len);
181 H5_DLL herr_t H5Ssel_iter_close(hid_t sel_iter_id);
182 
183 /* Symbols defined for compatibility with previous versions of the HDF5 API.
184  *
185  * Use of these symbols is deprecated.
186  */
187 #ifndef H5_NO_DEPRECATED_SYMBOLS
188 /* Function prototypes */
189 H5_DLL herr_t H5Sencode1(hid_t obj_id, void *buf, size_t *nalloc);
190 
191 #endif /* H5_NO_DEPRECATED_SYMBOLS */
192 
193 #ifdef __cplusplus
194 }
195 #endif
196 #endif /* _H5Spublic_H */
197 
H5public.h
H5S_SELECT_NOTB
@ H5S_SELECT_NOTB
Definition: H5Spublic.h:65
H5Scombine_hyperslab
H5_DLL hid_t H5Scombine_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], const hsize_t _stride[], const hsize_t count[], const hsize_t _block[])
Definition: H5Shyper.c:10493
H5Sclose
H5_DLL herr_t H5Sclose(hid_t space_id)
Definition: H5S.c:497
H5Sencode1
H5_DLL herr_t H5Sencode1(hid_t obj_id, void *buf, size_t *nalloc)
Definition: H5Sdeprec.c:96
H5Scombine_select
H5_DLL hid_t H5Scombine_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
Definition: H5Shyper.c:10618
H5Ipublic.h
H5S_SCALAR
@ H5S_SCALAR
Definition: H5Spublic.h:38
H5S_SELECT_NOOP
@ H5S_SELECT_NOOP
Definition: H5Spublic.h:45
H5Ssel_iter_close
H5_DLL herr_t H5Ssel_iter_close(hid_t sel_iter_id)
Definition: H5Sselect.c:3155
H5Sselect_adjust
H5_DLL herr_t H5Sselect_adjust(hid_t spaceid, const hssize_t *offset)
Definition: H5Sselect.c:1023
H5Sget_simple_extent_ndims
H5_DLL int H5Sget_simple_extent_ndims(hid_t space_id)
Definition: H5S.c:900
H5S_NO_CLASS
@ H5S_NO_CLASS
Definition: H5Spublic.h:37
H5Screate
H5_DLL hid_t H5Screate(H5S_class_t type)
Definition: H5S.c:384
H5Soffset_simple
H5_DLL herr_t H5Soffset_simple(hid_t space_id, const hssize_t *offset)
Definition: H5Sselect.c:145
H5Scopy
H5_DLL hid_t H5Scopy(hid_t space_id)
Definition: H5S.c:531
H5Sget_select_hyper_nblocks
H5_DLL hssize_t H5Sget_select_hyper_nblocks(hid_t spaceid)
Definition: H5Shyper.c:3491
H5Sis_simple
H5_DLL htri_t H5Sis_simple(hid_t space_id)
Definition: H5S.c:1251
H5Sselect_valid
H5_DLL htri_t H5Sselect_valid(hid_t spaceid)
Definition: H5Sselect.c:467
H5Sset_extent_none
H5_DLL herr_t H5Sset_extent_none(hid_t space_id)
Definition: H5S.c:1838
H5Sextent_equal
H5_DLL htri_t H5Sextent_equal(hid_t sid1, hid_t sid2)
Definition: H5S.c:2002
H5Sselect_project_intersection
H5_DLL hid_t H5Sselect_project_intersection(hid_t src_space_id, hid_t dst_space_id, hid_t src_intersect_space_id)
Definition: H5Sselect.c:2827
H5Sget_simple_extent_type
H5_DLL H5S_class_t H5Sget_simple_extent_type(hid_t space_id)
Definition: H5S.c:1804
H5Sextent_copy
H5_DLL herr_t H5Sextent_copy(hid_t dst_id, hid_t src_id)
Definition: H5S.c:574
H5S_SEL_POINTS
@ H5S_SEL_POINTS
Definition: H5Spublic.h:86
H5Sselect_elements
H5_DLL herr_t H5Sselect_elements(hid_t space_id, H5S_seloper_t op, size_t num_elem, const hsize_t *coord)
Definition: H5Spoint.c:2405
H5Sget_simple_extent_dims
H5_DLL int H5Sget_simple_extent_dims(hid_t space_id, hsize_t dims[], hsize_t maxdims[])
Definition: H5S.c:981
H5Sis_regular_hyperslab
H5_DLL htri_t H5Sis_regular_hyperslab(hid_t spaceid)
Definition: H5Shyper.c:12235
H5Sget_simple_extent_npoints
H5_DLL hssize_t H5Sget_simple_extent_npoints(hid_t space_id)
Definition: H5S.c:802
H5S_SELECT_SET
@ H5S_SELECT_SET
Definition: H5Spublic.h:46
H5S_SELECT_OR
@ H5S_SELECT_OR
Definition: H5Spublic.h:47
H5S_SEL_NONE
@ H5S_SEL_NONE
Definition: H5Spublic.h:85
H5Sget_select_elem_pointlist
H5_DLL herr_t H5Sget_select_elem_pointlist(hid_t spaceid, hsize_t startpoint, hsize_t numpoints, hsize_t buf[])
Definition: H5Spoint.c:1603
H5Sget_regular_hyperslab
H5_DLL htri_t H5Sget_regular_hyperslab(hid_t spaceid, hsize_t start[], hsize_t stride[], hsize_t count[], hsize_t block[])
Definition: H5Shyper.c:12283
H5S_NULL
@ H5S_NULL
Definition: H5Spublic.h:40
H5Sselect_intersect_block
H5_DLL htri_t H5Sselect_intersect_block(hid_t space_id, const hsize_t *start, const hsize_t *end)
Definition: H5Sselect.c:2159
block
unable to release heap data block
Definition: H5HL.c:384
H5Sselect_none
H5_DLL herr_t H5Sselect_none(hid_t spaceid)
Definition: H5Snone.c:1110
htri_t
int htri_t
Definition: H5public.h:160
H5Sdecode
H5_DLL hid_t H5Sdecode(const void *buf)
Definition: H5S.c:1652
hssize_t
hssize_t
Definition: H5overflow.txt:45
H5S_SELECT_INVALID
@ H5S_SELECT_INVALID
Definition: H5Spublic.h:79
hid_t
int64_t hid_t
Definition: H5Ipublic.h:55
H5Sencode2
H5_DLL herr_t H5Sencode2(hid_t obj_id, void *buf, size_t *nalloc, hid_t fapl)
Definition: H5S.c:1532
H5Sget_select_hyper_blocklist
H5_DLL herr_t H5Sget_select_hyper_blocklist(hid_t spaceid, hsize_t startblock, hsize_t numblocks, hsize_t buf[])
Definition: H5Shyper.c:4781
H5Screate_simple
H5_DLL hid_t H5Screate_simple(int rank, const hsize_t dims[], const hsize_t maxdims[])
Definition: H5S.c:1432
H5S_SIMPLE
@ H5S_SIMPLE
Definition: H5Spublic.h:39
H5Ssel_iter_create
H5_DLL hid_t H5Ssel_iter_create(hid_t spaceid, size_t elmt_size, unsigned flags)
Definition: H5Sselect.c:2982
H5Sselect_all
H5_DLL herr_t H5Sselect_all(hid_t spaceid)
Definition: H5Sall.c:1205
H5S_SEL_ALL
@ H5S_SEL_ALL
Definition: H5Spublic.h:88
H5S_SELECT_AND
@ H5S_SELECT_AND
Definition: H5Spublic.h:53
H5Smodify_select
H5_DLL herr_t H5Smodify_select(hid_t space1_id, H5S_seloper_t op, hid_t space2_id)
Definition: H5Shyper.c:10753
H5Ssel_iter_get_seq_list
H5_DLL herr_t H5Ssel_iter_get_seq_list(hid_t sel_iter_id, size_t maxseq, size_t maxbytes, size_t *nseq, size_t *nbytes, hsize_t *off, size_t *len)
Definition: H5Sselect.c:3066
H5Sselect_copy
H5_DLL herr_t H5Sselect_copy(hid_t dst_id, hid_t src_id)
Definition: H5Sselect.c:193
H5S_sel_type
H5S_sel_type
Definition: H5Spublic.h:83
H5S_SELECT_NOTA
@ H5S_SELECT_NOTA
Definition: H5Spublic.h:71
H5Sget_select_bounds
H5_DLL herr_t H5Sget_select_bounds(hid_t spaceid, hsize_t start[], hsize_t end[])
Definition: H5Sselect.c:626
H5_DLL
#define H5_DLL
Definition: H5api_adpt.h:234
H5Sget_select_elem_npoints
H5_DLL hssize_t H5Sget_select_elem_npoints(hid_t spaceid)
Definition: H5Spoint.c:1025
H5S_SELECT_APPEND
@ H5S_SELECT_APPEND
Definition: H5Spublic.h:77
H5S_SEL_N
@ H5S_SEL_N
Definition: H5Spublic.h:89
H5S_SELECT_XOR
@ H5S_SELECT_XOR
Definition: H5Spublic.h:59
H5S_SEL_HYPERSLABS
@ H5S_SEL_HYPERSLABS
Definition: H5Spublic.h:87
H5Sget_select_npoints
H5_DLL hssize_t H5Sget_select_npoints(hid_t spaceid)
Definition: H5Sselect.c:395
H5S_seloper_t
H5S_seloper_t
Definition: H5Spublic.h:44
H5Sset_extent_simple
H5_DLL herr_t H5Sset_extent_simple(hid_t space_id, int rank, const hsize_t dims[], const hsize_t max[])
Definition: H5S.c:1297
H5S_SEL_ERROR
@ H5S_SEL_ERROR
Definition: H5Spublic.h:84
herr_t
int herr_t
Definition: H5public.h:128
H5Sget_select_type
H5_DLL H5S_sel_type H5Sget_select_type(hid_t spaceid)
Definition: H5Sselect.c:1705
H5S_SELECT_PREPEND
@ H5S_SELECT_PREPEND
Definition: H5Spublic.h:78
H5Sselect_shape_same
H5_DLL htri_t H5Sselect_shape_same(hid_t space1_id, hid_t space2_id)
Definition: H5Sselect.c:2053
hsize_t
hsize_t
Definition: H5overflow.txt:44
H5S_class_t
H5S_class_t
Definition: H5Spublic.h:36
H5Sselect_hyperslab
H5_DLL herr_t H5Sselect_hyperslab(hid_t space_id, H5S_seloper_t op, const hsize_t start[], const hsize_t _stride[], const hsize_t count[], const hsize_t _block[])
Definition: H5Shyper.c:10167