summaryrefslogtreecommitdiff
path: root/src/utils/size_info.h
blob: e0994c15b9200f526166a7fd6d87374e00e2289b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#ifndef SIZE_INFO_H_
#define SIZE_INFO_H_

typedef enum size_unit { SIZE_B, SIZE_KB, SIZE_MB, SIZE_GB } size_unit_t;

typedef struct size_info {
  long double n;
  size_unit_t unit;
  const char *unit_str;
} size_info_t;

size_info_t num2sizeinfo(const unsigned long n);

#endif