-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdistribution.h
49 lines (40 loc) · 1.09 KB
/
distribution.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
/*******************************************************************************
* distribution handler of fraggy.agg
*
* @author Lars Thoms
* @date 2020-01-24
******************************************************************************/
#ifndef FRAGGY_DISTRIBUTION_H
#define FRAGGY_DISTRIBUTION_H
#include <stdio.h>
#include "uthash.h"
/*******************************************************************************
* declarations
******************************************************************************/
/**
* hash map to store fragmentation counts and their frequency
*/
struct distribution_tpl
{
int key, value;
UT_hash_handle hh;
};
/**
* add amount of fragments to distribution table
*
* @param int fragmentation count
*/
void increase_distribution(int);
/**
* sort by key ascending
*
* @param struct distribution_tpl *
* @param struct distribution_tpl *
* @return int
*/
int sort_distribution(struct distribution_tpl *, struct distribution_tpl *);
/**
* generate and print CSV from distribution map
*/
void print_distribution(void);
#endif //FRAGGY_DISTRIBUTION_H