cmdl-tool #45

Merged
Gregor Weiss merged 21 commits from cmdl-tool into feat/api 2024-11-07 15:40:29 +00:00
2 changed files with 44 additions and 12 deletions
Showing only changes of commit 6d5dc06446 - Show all commits

View file

@ -347,6 +347,18 @@
|| | |__| |__] |___ | |___ | |__| | \| |___ | | |__| | \| ___] ||
|| ||
\************************************************************************************************************/
/*----------------------------------------------------------------------------------------------------------*\
! !
! DESCRIPTION: !
! ------------ !
! This function deallocates the data structure used to store an numerical dataset !
! and can be called if an error occurs or once the data is no longer needed is to be closed. !
! The deallocation will be carried out down to the structure levels that have been allocated. !
! !
\*----------------------------------------------------------------------------------------------------------*/
void
eas3_free_data(eas3_data* data);
/*----------------------------------------------------------------------------------------------------------*\
! FUNCTION NAME: bwc_data* read_eas3(const char* const filename) !
! -------------- !

View file

@ -76,7 +76,25 @@
#include <string.h>
#include "eas3.h"
#include "bwccmdl.h"
/************************************************************************************************************\
|| _ _ ____ ____ ____ ____ ____ ||
|| |\/| |__| | |__/ | | [__ ||
|| | | | | |___ | \ |__| ___] ||
|| ||
\************************************************************************************************************/
#define MEMERROR "o##########################################################o\n"\
"| ERROR: Out of memory |\n"\
"o##########################################################o\n"
#define RDERROR "o##########################################################o\n"\
"| ERROR: Invalid Number of Bytes Read from File. |\n"\
"o##########################################################o\n"
#define WRTERROR "o##########################################################o\n"\
"| ERROR: Invalid Number of Bytes Written to File. |\n"\
"o##########################################################o\n"
/************************************************************************************************************\
|| ___ ____ _ _ _ ____ ___ ____ ____ _ _ _ _ ____ ___ _ ____ _ _ ____ ||
@ -213,18 +231,20 @@ endian_conversion(void *value,
void
eas3_free_data(eas3_data* data)
{
if(data)
if(data != NULL)
{
//if(data->aux)
//{
//free(data->aux->memory);
//data->aux->access = NULL;
//data->aux->position = 0;
//data->aux->size = 0;
// TODO: remove
//data->aux->L = 0;
//}
//free(data->aux);
if (data->param_names != NULL)
free(data->param_names);
if (data->field.d != NULL)
free(data->field.d);
if (data->field.f != NULL)
free(data->field.f);
if(data->aux.ptr != NULL)
free(data->aux.ptr);
free(data);
}
}