#include <stdlib.h>
#include <string.h>
+struct HPCS_MeasuredData* hpcs_alloc()
+{
+ return malloc(sizeof(struct HPCS_MeasuredData));
+}
+
char* hpcs_error_to_string(const enum HPCS_RetCode err)
{
char* msg;
}
}
+void hpcs_free(struct HPCS_MeasuredData* const mdata)
+{
+ if (mdata == NULL)
+ return;
+ free(mdata->file_description);
+ free(mdata->sample_info);
+ free(mdata->operator_name);
+ free(mdata->method_name);
+ free(mdata->cs_ver);
+ free(mdata->cs_rev);
+ free(mdata->y_units);
+ free(mdata->data);
+ free(mdata);
+}
+
enum HPCS_RetCode hpcs_read_file(const char* filename, struct HPCS_MeasuredData* mdata)
{
FILE* datafile;
};
#ifdef __WIN32__
-__declspec(dllexport) enum HPCS_RetCode __cdecl hpcs_read_file(const char* const filename, struct HPCS_MeasuredData* mdata);
+__declspec(dllexport) struct HPCS_MeasuredData* __cdecl hpcs_alloc();
+__declspec(dllexport) void __cdecl hpcs_free(struct HPCS_MeasuredData* const mdata);
__declspec(dllexport) char* __cdecl hpcs_error_to_string(const enum HPCS_RetCode);
+__declspec(dllexport) enum HPCS_RetCode __cdecl hpcs_read_file(const char* const filename, struct HPCS_MeasuredData* mdata);
#else
-enum HPCS_RetCode hpcs_read_file(const char* const filename, struct HPCS_MeasuredData* mdata);
+struct HPCS_MeasuredData* hpcs_alloc();
+void hpcs_free(struct HPCS_MeasuredData* const mdata);
char* hpcs_error_to_string(const enum HPCS_RetCode);
+enum HPCS_RetCode hpcs_read_file(const char* const filename, struct HPCS_MeasuredData* mdata);
#endif
#ifdef __cplusplus