summaryrefslogtreecommitdiff
path: root/src/utils/size_info.h
blob: 238ddf8cfb52a89bf03bf9da622257ba18206f0a (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 long n);

#endif