FiberBundleHDF5  FiberHDF5 Documentation, Revision 2026
High-Performance Fiber Bundle Data Model for Scientific Visualization
Loading...
Searching...
No Matches
F5A.h
Go to the documentation of this file.
1#ifndef __F5_F5A_H
2#define __F5_F5A_H "Attribute Functions"
3
4#include "hdf5inc.h"
5
6#include "F5WinDLLApi.h"
7
8#ifdef __cplusplus
9extern "C"
10{
11#endif
12
13/** Open some attribute if it exists, otherwise create one. */
14F5_API hid_t F5Aappend(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t create_plist );
15
16/** Try to open an HDF5 attribute, silently return -1 if it does not exist. */
17F5_API hid_t F5Atry_to_open(hid_t location, const char*name);
18
19/** @ingroup Internal
20 Wrap HDF5 call by debug verbosity option.
21*/
22F5_API hid_t F5Aopen_name(hid_t location, const char*name);
23
24/**
25 Create a string attribute which is of the size of the given string
26 and write it to the file.
27 */
28F5_API int F5Asave_string(hid_t loc_id, const char*name, const char*buf);
29
30F5_API int F5Asave_strings(hid_t loc_id, const char*name, const char*buf, int HowMany);
31
32/**
33 Get a string attribute from the file.
34 If buf is a NULL pointer, then the string is allocated dynamically and
35 the caller needs to issue free() on the result.
36 If the string could not be read, returns a NULL pointer.
37 */
38F5_API char* F5Aget_string(hid_t loc_id, const char*name, char*buf, size_t len);
39
40/**
41 * Get type of an attribute by name.
42 * After calling this function both, attribute and type
43 * must be closed, otherwise warnings will occur
44 */
45
46F5_API hid_t F5Aget_type(hid_t loc_id, const char*name, hid_t* attrib);
47
48/*
49 Write an attribute to the object loc_id with a version number.
50 A version number is built from three integers.
51 @param loc_id Any HDF5 object that may carry attributes.
52 */
53F5_API herr_t F5Asave_version(hid_t loc_id, int major, int minor, int release);
54
55/**
56 Get version number for given object.
57 @param loc_id Any HDF5 object that may carry attributes.
58 */
59F5_API herr_t F5Aget_version(hid_t loc_id, int*major, int*minor, int*release);
60
61/**
62 Get a number of integers from an attribute which is an integer array.
63 The specified number n must match exactly with the number of elements.
64 @return positive number of elements (n) if success, 0 if attribute not found,
65 and the negative number of elements otherwise.
66 Success can easily be tested by checking the return value to
67 be larger than zero.
68 */
69F5_API long F5Aget_ints(hid_t loc_id, const char*name, int*data, hsize_t n);
70
71/**
72 Save an array of integers as an attribute.
73 @return non-zero in case of error
74 */
75F5_API int F5Asave_ints(hid_t loc_id, const char*name, const int data[], hsize_t n);
76
77/**
78 Save an integer to the file as an attribute, checking if it
79 already existed, and if so, that it had the same value.
80 @return non-zero in case of error, such as different value in file.
81 */
82F5_API int F5Astore_integer(hid_t loc_id, const char*name, int data);
83
84/**
85 Save an integer to the file as an attribute, overwriting
86 any existing value.
87 @return non-zero in case of error
88 */
89F5_API int F5Awrite_integer(hid_t loc_id, const char*name, int data);
90
91
92F5_API int F5Asave(hid_t loc_id, const char*name, hid_t file_type_id, hid_t mem_type_id, const void*data, hsize_t n);
93
94#ifdef __cplusplus
95} /* extern "C" */
96#endif
97
98#endif /* __F5_F5A_H */
F5_API char * F5Aget_string(hid_t loc_id, const char *name, char *buf, size_t len)
Definition F5A.c:109
F5_API int F5Asave_strings(hid_t loc_id, const char *name, const char *buf, int HowMany)
Definition F5A.c:79
F5_API int F5Awrite_integer(hid_t loc_id, const char *name, int data)
Definition F5A.c:494
F5_API herr_t F5Asave_version(hid_t loc_id, int major, int minor, int release)
Definition F5A.c:286
F5_API hid_t F5Atry_to_open(hid_t location, const char *name)
Definition F5A.c:23
F5_API int F5Asave_ints(hid_t loc_id, const char *name, const int data[], hsize_t n)
Definition F5A.c:355
F5_API int F5Astore_integer(hid_t loc_id, const char *name, int data)
Definition F5A.c:436
F5_API int F5Asave(hid_t loc_id, const char *name, hid_t file_type_id, hid_t mem_type_id, const void *data, hsize_t n)
Definition F5A.c:529
F5_API int F5Asave_string(hid_t loc_id, const char *name, const char *buf)
Definition F5A.c:45
F5_API long F5Aget_ints(hid_t loc_id, const char *name, int *data, hsize_t n)
Definition F5A.c:406
F5_API hid_t F5Aappend(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id, hid_t create_plist)
Definition F5A.c:9
F5_API herr_t F5Aget_version(hid_t loc_id, int *major, int *minor, int *release)
Definition F5A.c:304
F5_API hid_t F5Aget_type(hid_t loc_id, const char *name, hid_t *attrib)
Definition F5A.c:167
name
Definition F5P.c:82
#define F5_API
Definition F5WinDLLApi.h:11
F5_API hid_t F5Aopen_name(hid_t location, const char *name)
Definition F5A.c:34