complete first draft of package
[epclust.git] / old_C_code / stage1 / src / Util / utils.h
CommitLineData
ab4a34ef
BA
1#ifndef PPAM_UTIL_UTILS_H
2#define PPAM_UTIL_UTILS_H
3
4#include "Util/types.h"
5#include <stdlib.h>
6#include <stdio.h>
7
8#define CURVES_PER_REQUEST 50
9
10void free_work(Work_t* work);
11
12void free_result(Result_t* result);
13
14char readInt(FILE* stream, int64_t* integer);
15
73d68777 16char readReal(FILE* stream, float* real);
ab4a34ef
BA
17
18// convert n-bytes binary integers to uint32_t
73d68777 19uint32_t bInt_to_uint(Byte* pInteger);
ab4a34ef
BA
20
21// serialize integers with a portable bytes order
73d68777
BA
22void write_int(uint32_t integer, Byte* buffer);
23
24float bReal_to_float(Byte* pFloat);
25
26void write_real(float x, Byte* buffer);
ab4a34ef
BA
27
28// Expected size of a Work message in bytes:
29uint32_t get_packedWork_length(uint32_t nbSeriesInChunk);
30
31// Expected size of a Result message in bytes: (uint32_t is on 4 bytes)
32uint32_t get_packedResult_length(uint32_t nbClusters);
33
34// get metadata: nbSeries
35uint32_t get_nbSeries(const char* ifileName);
36
37// get metadata: tsLength
38uint32_t get_tsLength(const char* ifileName);
39
40#endif