summaryrefslogtreecommitdiffstats
path: root/hl/src
diff options
context:
space:
mode:
authorAlessandro Felder <alessandrofelder@users.noreply.github.com>2021-09-08 20:53:15 (GMT)
committerGitHub <noreply@github.com>2021-09-08 20:53:15 (GMT)
commit8e06298ecfde5eb647b39cfe0dab70005f092199 (patch)
tree60812779599015ee44990d56a643767e9c93da73 /hl/src
parent919f9daec6f397dfdf3fd41d2ecf002d197db293 (diff)
downloadhdf5-8e06298ecfde5eb647b39cfe0dab70005f092199.zip
hdf5-8e06298ecfde5eb647b39cfe0dab70005f092199.tar.gz
hdf5-8e06298ecfde5eb647b39cfe0dab70005f092199.tar.bz2
Add high-level set/get for `unsigned long long` attributes. (#973)
* add ULL attr set/get signatures to LT public API * add LT implementation of ULL set/get attribute * fix copy-paste typo in test comment * add ULL test data * define ullong attr name global variable * add LT tests for ULL attr set/get * Committing clang-format changes * correct type passed to lt get attr test for ULL * update RELEASE.txt with added ULL set/get functionality Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'hl/src')
-rw-r--r--hl/src/H5LT.c53
-rw-r--r--hl/src/H5LTpublic.h6
2 files changed, 59 insertions, 0 deletions
diff --git a/hl/src/H5LT.c b/hl/src/H5LT.c
index 1ef0f9d..a314f3f 100644
--- a/hl/src/H5LT.c
+++ b/hl/src/H5LT.c
@@ -1776,6 +1776,32 @@ H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_nam
}
/*-------------------------------------------------------------------------
+ * Function: H5LTset_attribute_ullong
+ *
+ * Purpose: Create and write an attribute.
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Alessandro Felder
+ *
+ * Date: August 27, 2021
+ *
+ * Comments:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
+ const unsigned long long *data, size_t size)
+{
+
+ if (H5LT_set_attribute_numerical(loc_id, obj_name, attr_name, size, H5T_NATIVE_ULLONG, data) < 0)
+ return -1;
+
+ return 0;
+}
+
+/*-------------------------------------------------------------------------
* Function: H5LTset_attribute_float
*
* Purpose: Create and write an attribute.
@@ -3317,6 +3343,33 @@ H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_nam
}
/*-------------------------------------------------------------------------
+ * Function: H5LTget_attribute_ullong
+ *
+ * Purpose: Reads an attribute named attr_name
+ *
+ * Return: Success: 0, Failure: -1
+ *
+ * Programmer: Alessandro Felder
+ *
+ * Date: August 27, 2021
+ *
+ * Comments:
+ *
+ * Modifications:
+ *
+ *-------------------------------------------------------------------------
+ */
+herr_t
+H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name, unsigned long long *data)
+{
+ /* Get the attribute */
+ if (H5LT_get_attribute_mem(loc_id, obj_name, attr_name, H5T_NATIVE_ULLONG, data) < 0)
+ return -1;
+
+ return 0;
+}
+
+/*-------------------------------------------------------------------------
* Function: H5LTget_attribute_float
*
* Purpose: Reads an attribute named attr_name
diff --git a/hl/src/H5LTpublic.h b/hl/src/H5LTpublic.h
index 2af9b07..f19d353 100644
--- a/hl/src/H5LTpublic.h
+++ b/hl/src/H5LTpublic.h
@@ -139,6 +139,9 @@ H5_HLDLL herr_t H5LTset_attribute_long_long(hid_t loc_id, const char *obj_name,
H5_HLDLL herr_t H5LTset_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name,
const unsigned long *buffer, size_t size);
+H5_HLDLL herr_t H5LTset_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
+ const unsigned long long *buffer, size_t size);
+
H5_HLDLL herr_t H5LTset_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name,
const float *buffer, size_t size);
@@ -182,6 +185,9 @@ H5_HLDLL herr_t H5LTget_attribute_long_long(hid_t loc_id, const char *obj_name,
H5_HLDLL herr_t H5LTget_attribute_ulong(hid_t loc_id, const char *obj_name, const char *attr_name,
unsigned long *data);
+H5_HLDLL herr_t H5LTget_attribute_ullong(hid_t loc_id, const char *obj_name, const char *attr_name,
+ unsigned long long *data);
+
H5_HLDLL herr_t H5LTget_attribute_float(hid_t loc_id, const char *obj_name, const char *attr_name,
float *data);