diff --git a/README.html b/README.html index 29fad68..1da723f 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- +
As the size of the dataset should be extensible, the simplest
@@ -256,8 +256,8 @@ The offset can be used with fseek(69L*offset, SEEK_SET)
We need to declare the number of rows of the dataset as @@ -278,7 +278,7 @@ If the offset+num > nmax, we need to extend the dataset.
stdint.h
Memory allocation of structures can be facilitated by using the @@ -438,8 +438,8 @@ The maximum string size for the filenames is 4096 characters.
All calls to TREXIO are thread-safe. @@ -447,10 +447,10 @@ TREXIO front end is modular, which simplifies implementation of new back ends.
TREXIO_NUM_ALREADY_EXISTS |
+TREXIO_ATTR_ALREADY_EXISTS |
13 | -'Dimensioning variable already exists' | +'Attribute (num/str) already exists' |
The C
templates that correspond to each of the abovementioned
@@ -1474,7 +1474,7 @@ precision (see Table above).
{
if (file == NULL) return TREXIO_INVALID_ARG_1;
if (num < 0 ) return TREXIO_INVALID_ARG_2;
- if (trexio_has_$group_num$(file) == TREXIO_SUCCESS) return TREXIO_NUM_ALREADY_EXISTS;
+ if (trexio_has_$group_num$(file) == TREXIO_SUCCESS) return TREXIO_ATTR_ALREADY_EXISTS;
switch (file->back_end) {
@@ -1537,7 +1537,7 @@ precision (see Table above).
if (file == NULL) return TREXIO_INVALID_ARG_1;
if (num < 0 ) return TREXIO_INVALID_ARG_2;
- if (trexio_has_$group_num$(file) == TREXIO_SUCCESS) return TREXIO_NUM_ALREADY_EXISTS;
+ if (trexio_has_$group_num$(file) == TREXIO_SUCCESS) return TREXIO_ATTR_ALREADY_EXISTS;
switch (file->back_end) {
@@ -1610,8 +1610,8 @@ precision (see Table above).
The Fortran
templates that provide an access to the C
API calls from Fortran.
@@ -1697,8 +1697,8 @@ These templates are based on the use of iso_c_binding
. Pointers hav
This section concerns API calls related to datasets. @@ -1767,8 +1767,8 @@ This section concerns API calls related to datasets.
The C templates that correspond to each of the abovementioned functions can be found below. @@ -2087,8 +2087,8 @@ The basic (non-suffixed) API call on datasets deals with double precision (see T
The Fortran
templates that provide an access to the C
API calls from Fortran
.
@@ -2174,8 +2174,8 @@ These templates are based on the use of iso_c_binding
. Pointers hav
Sparse data structures are used typically for large tensors such as @@ -2316,12 +2316,12 @@ For the values,
This section concerns API calls related to datasets of strings. @@ -2361,8 +2361,8 @@ This section concerns API calls related to datasets of strings.
First parameter is the TREXIO
file handle. Second parameter is the variable to be written/read
@@ -2605,8 +2605,8 @@ to/from the TREXIO
file (except for trexio_has_
functi
The Fortran
templates that provide an access to the C
API calls from Fortran
.
@@ -2703,12 +2703,12 @@ These templates are based on the use of iso_c_binding
. Pointers hav
This section concerns API calls related to string attributes. @@ -2748,8 +2748,8 @@ This section concerns API calls related to string attributes.
trexio_exit_code @@ -2791,7 +2791,7 @@ This section concerns API calls related to string attributes. if (file == NULL) return TREXIO_INVALID_ARG_1; if (str == NULL) return TREXIO_INVALID_ARG_2; if (max_str_len <= 0) return TREXIO_INVALID_ARG_3; - if (trexio_has_$group_str$(file) == TREXIO_SUCCESS) return TREXIO_NUM_ALREADY_EXISTS; + if (trexio_has_$group_str$(file) == TREXIO_SUCCESS) return TREXIO_ATTR_ALREADY_EXISTS; size_t len_write = strlen(str); if (max_str_len < len_write) return TREXIO_INVALID_STR_LEN; @@ -2849,8 +2849,8 @@ This section concerns API calls related to string attributes.
The Fortran
templates that provide an access to the C
API calls from Fortran.
@@ -2929,8 +2929,8 @@ These templates are based on the use of iso_c_binding
. Pointers hav
The function below adapts the original C-based trexio_open
for Fortran.
@@ -3064,7 +3064,7 @@ two code are identical, i.e. if the assert
statement pass.
#define $GROUP$_GROUP_NAME "$group$" @@ -343,8 +343,8 @@ for the JavaScript code in this tag.
typedef struct trexio_hdf5_s { @@ -359,8 +359,8 @@ for the JavaScript code in this tag.
trexio_exit_code
@@ -440,8 +440,8 @@ for the JavaScript code in this tag.
trexio_exit_code @@ -515,25 +515,16 @@ for the JavaScript code in this tag. trexio_exit_code rc = trexio_hdf5_read_$group_num$(file, &(infile_num)); if (rc != TREXIO_SUCCESS) return rc; - if (infile_num != num) { + const hid_t dtype = H5Tcopy(H5T_NATIVE_UINT64); + const hid_t num_id = H5Aopen(f->$group$_group, $GROUP_NUM$_NAME, H5P_DEFAULT); + if (num_id <= 0) return TREXIO_INVALID_ID; - if (infile_num != 0) { + const herr_t status = H5Awrite(num_id, dtype, &(num)); + if (status < 0) return TREXIO_FAILURE; - return TREXIO_NUM_ALREADY_EXISTS; + H5Aclose(num_id); + H5Tclose(dtype); - } else { - - const hid_t dtype = H5Tcopy(H5T_NATIVE_UINT64); - const hid_t num_id = H5Aopen(f->$group$_group, $GROUP_NUM$_NAME, H5P_DEFAULT); - if (num_id <= 0) return TREXIO_INVALID_ID; - - const herr_t status = H5Awrite(num_id, dtype, &(num)); - if (status < 0) return TREXIO_FAILURE; - - H5Aclose(num_id); - H5Tclose(dtype); - } - } return TREXIO_SUCCESS; } @@ -566,8 +557,8 @@ for the JavaScript code in this tag.
trexio_exit_code
@@ -696,8 +687,8 @@ for the JavaScript code in this tag.
trexio_exit_code
@@ -901,8 +892,8 @@ for the JavaScript code in this tag.
trexio_exit_code
@@ -1029,7 +1020,7 @@ for the JavaScript code in this tag.
The "file" produced by the text back end is a directory with one @@ -361,8 +361,8 @@ The file is written when closed, or when the flush function is called.
typedef struct $group$_s { @@ -380,8 +380,8 @@ The file is written when closed, or when the flush function is called.
typedef struct rdm_s { @@ -407,8 +407,8 @@ The file is written when closed, or when the flush function is called.
trexio_exit_code
@@ -509,8 +509,8 @@ The file is written when closed, or when the flush function is called.
trexio_exit_code
@@ -535,8 +535,8 @@ The file is written when closed, or when the flush function is called.
$group$_t* @@ -807,8 +807,8 @@ trexio_text_read_$group$ (trexio_text_t*
trexio_exit_code @@ -872,8 +872,8 @@ trexio_text_read_$group$ (trexio_text_t*
Memory is allocated when reading. The following function frees memory. @@ -918,8 +918,8 @@ Memory is allocated when reading. The following function frees memory.
trexio_exit_code
@@ -981,8 +981,8 @@ Memory is allocated when reading. The following function frees memory.
The group_dset
array is assumed allocated with the appropriate size.
@@ -1078,8 +1078,8 @@ The group_dset
array is assumed allocated with the appropriate size
The group_dset
array is assumed allocated with the appropriate size.
@@ -1181,8 +1181,8 @@ The group_dset
array is assumed allocated with the appropriate size
trexio_exit_code
@@ -1256,12 +1256,12 @@ The group_dset
array is assumed allocated with the appropriate size
rdm_t* trexio_text_read_rdm(trexio_text_t* const file);
@@ -1356,8 +1356,8 @@ The group_dset
array is assumed allocated with the appropriate size
trexio_exit_code trexio_text_flush_rdm(trexio_text_t* const file);
@@ -1399,8 +1399,8 @@ The group_dset
array is assumed allocated with the appropriate size
Memory is allocated when reading. The followig function frees memory. @@ -1436,8 +1436,8 @@ Memory is allocated when reading. The followig function frees memory.
The one_e
array is assumed allocated with the appropriate size.
@@ -1503,8 +1503,8 @@ The one_e
array is assumed allocated with the appropriate size.
two_e
is a sparse data structure, which can be too large to fit
@@ -1612,7 +1612,7 @@ file for each sparse float structure.
index
type which is an
As we expect our files to be archived in open-data repositories, we @@ -390,7 +390,7 @@ which have participated to the creation of the file, a list of authors of the file, and a textual description.
-