1 #ifndef PPAM_UTIL_UTILS_H
2 #define PPAM_UTIL_UTILS_H
4 #include "Util/types.h"
8 #define CURVES_PER_REQUEST 50
10 void free_work(Work_t
* work
);
12 void free_result(Result_t
* result
);
14 char readInt(FILE* stream
, int64_t* integer
);
16 char readReal(FILE* stream
, float* real
);
18 // convert n-bytes binary integers to uint32_t
19 uint32_t bInt_to_uint(Byte
* pInteger
);
21 // serialize integers with a portable bytes order
22 void write_int(uint32_t integer
, Byte
* buffer
);
24 float bReal_to_float(Byte
* pFloat
);
26 void write_real(float x
, Byte
* buffer
);
28 // Expected size of a Work message in bytes:
29 uint32_t get_packedWork_length(uint32_t nbSeriesInChunk
);
31 // Expected size of a Result message in bytes: (uint32_t is on 4 bytes)
32 uint32_t get_packedResult_length(uint32_t nbClusters
);
34 // get metadata: nbSeries
35 uint32_t get_nbSeries(const char* ifileName
);
37 // get metadata: tsLength
38 uint32_t get_tsLength(const char* ifileName
);