aboutsummaryrefslogtreecommitdiff
path: root/libbb
diff options
context:
space:
mode:
authorAri Sundholm <ari@tuxera.com>2015-03-04 18:46:48 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2015-03-22 17:41:04 +0100
commit8893023ba27ea87b12a333960271c9f86cdebf7b (patch)
tree09664462b0bb252b1227b689a2240e02ec1b0f5b /libbb
parent92edab1aa6eae45ac8fa0cec8c8df9a47f547300 (diff)
downloadbusybox-w32-8893023ba27ea87b12a333960271c9f86cdebf7b.tar.gz
busybox-w32-8893023ba27ea87b12a333960271c9f86cdebf7b.tar.bz2
busybox-w32-8893023ba27ea87b12a333960271c9f86cdebf7b.zip
dd: move suffix struct to xatonum.c
This way it can be used by other applets without duplication. Signed-off-by: Ari Sundholm <ari@tuxera.com> Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'libbb')
-rw-r--r--libbb/xatonum.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/libbb/xatonum.c b/libbb/xatonum.c
index 6f4e023bb..19b54fb0c 100644
--- a/libbb/xatonum.c
+++ b/libbb/xatonum.c
@@ -75,3 +75,22 @@ const struct suffix_mult bkm_suffixes[] = {
75 { "m", 1024*1024 }, 75 { "m", 1024*1024 },
76 { "", 0 } 76 { "", 0 }
77}; 77};
78
79const struct suffix_mult cwbkMG_suffixes[] = {
80 { "c", 1 },
81 { "w", 2 },
82 { "b", 512 },
83 { "kB", 1000 },
84 { "kD", 1000 },
85 { "k", 1024 },
86 { "K", 1024 }, /* compat with coreutils dd (it also accepts KB and KD, TODO?) */
87 { "MB", 1000000 },
88 { "MD", 1000000 },
89 { "M", 1024*1024 },
90 { "GB", 1000000000 },
91 { "GD", 1000000000 },
92 { "G", 1024*1024*1024 },
93 /* "D" suffix for decimal is not in coreutils manpage, looks like it's deprecated */
94 /* coreutils also understands TPEZY suffixes for tera- and so on, with B suffix for decimal */
95 { "", 0 }
96};