Stop exposing things that can be private to convtbl.c.
This commit is contained in:
parent
aee371e363
commit
afe7b9fbb5
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164673
@ -33,7 +33,23 @@
|
||||
#include <string.h>
|
||||
#include "convtbl.h"
|
||||
|
||||
struct convtbl convtbl[] = {
|
||||
#define BIT (8)
|
||||
#define BYTE (1)
|
||||
|
||||
#define BITS (1)
|
||||
#define BYTES (1)
|
||||
#define KILO (1024LL)
|
||||
#define MEGA (KILO * 1024)
|
||||
#define GIGA (MEGA * 1024)
|
||||
|
||||
struct convtbl {
|
||||
uintmax_t mul;
|
||||
uintmax_t scale;
|
||||
const char *str;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
static struct convtbl convtbl[] = {
|
||||
/* mul, scale, str, name */
|
||||
[SC_BYTE] = { BYTE, BYTES, "B", "byte" },
|
||||
[SC_KILOBYTE] = { BYTE, KILO, "KB", "kbyte" },
|
||||
|
@ -34,12 +34,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#define BITS (1)
|
||||
#define BYTES (1)
|
||||
#define KILO (1024LL)
|
||||
#define MEGA (KILO * 1024)
|
||||
#define GIGA (MEGA * 1024)
|
||||
|
||||
enum scale {
|
||||
SC_BYTE,
|
||||
SC_KILOBYTE,
|
||||
@ -52,18 +46,6 @@ enum scale {
|
||||
SC_AUTO /* KEEP THIS LAST */
|
||||
};
|
||||
|
||||
#define BIT (8)
|
||||
#define BYTE (1)
|
||||
|
||||
struct convtbl {
|
||||
uintmax_t mul;
|
||||
uintmax_t scale;
|
||||
const char *str;
|
||||
const char *name;
|
||||
};
|
||||
|
||||
extern struct convtbl convtbl[];
|
||||
|
||||
extern double convert(const uintmax_t, const int);
|
||||
extern const char *get_helplist(void);
|
||||
extern int get_scale(const char *);
|
||||
|
Loading…
Reference in New Issue
Block a user