mirror of
https://github.com/TREX-CoE/trexio.git
synced 2024-12-31 16:45:59 +01:00
error handling for trexio_text_deinit function
This commit is contained in:
parent
f2c79827b5
commit
0cc24bd21e
@ -232,10 +232,11 @@ trexio_text_deinit (trexio_t* const file)
|
|||||||
|
|
||||||
trexio_exit_code rc;
|
trexio_exit_code rc;
|
||||||
|
|
||||||
assert (trexio_text_free_$group$( (trexio_text_t*) file) == TREXIO_SUCCESS);
|
/* Error handling for this call is added by the generator */
|
||||||
|
rc = trexio_text_free_$group$( (trexio_text_t*) file);
|
||||||
|
|
||||||
rc = trexio_text_free_rdm( (trexio_text_t*) file);
|
rc = trexio_text_free_rdm( (trexio_text_t*) file);
|
||||||
assert (rc == TREXIO_SUCCESS);
|
if (rc != TREXIO_SUCCESS) return rc;
|
||||||
|
|
||||||
return TREXIO_SUCCESS;
|
return TREXIO_SUCCESS;
|
||||||
|
|
||||||
@ -772,7 +773,6 @@ trexio_exit_code trexio_text_flush_rdm(trexio_text_t* const file) {
|
|||||||
|
|
||||||
if (rdm->to_flush == 0) return TREXIO_SUCCESS;
|
if (rdm->to_flush == 0) return TREXIO_SUCCESS;
|
||||||
|
|
||||||
|
|
||||||
FILE* f = fopen(rdm->file_name,"w");
|
FILE* f = fopen(rdm->file_name,"w");
|
||||||
assert (f != NULL);
|
assert (f != NULL);
|
||||||
|
|
||||||
|
@ -386,6 +386,12 @@ for fname in ['def_hdf5.c', 'basic_hdf5.c', 'basic_text_group.c',
|
|||||||
templine1 = line.replace('$GROUP_NUM$', num.upper())
|
templine1 = line.replace('$GROUP_NUM$', num.upper())
|
||||||
templine2 = templine1.replace('$group_num$', num)
|
templine2 = templine1.replace('$group_num$', num)
|
||||||
f_out.write(templine2)
|
f_out.write(templine2)
|
||||||
|
# special case for proper error handling when deallocting text groups
|
||||||
|
elif 'rc = trexio_text_free_$group$' in line:
|
||||||
|
for grname in config.keys():
|
||||||
|
templine1 = line.replace('$group$', grname)
|
||||||
|
templine2 = templine1 + ' if (rc != TREXIO_SUCCESS) return rc;\n'
|
||||||
|
f_out.write(templine2)
|
||||||
elif '$group$' in line or '$GROUP$' in line :
|
elif '$group$' in line or '$GROUP$' in line :
|
||||||
for grname in config.keys():
|
for grname in config.keys():
|
||||||
templine1 = line.replace('$group$', grname)
|
templine1 = line.replace('$group$', grname)
|
||||||
|
Loading…
Reference in New Issue
Block a user