diff options
| author | Karel Zak <kzak@redhat.com> | 2010-03-30 13:47:33 +0200 |
|---|---|---|
| committer | Karel Zak <kzak@redhat.com> | 2010-03-30 13:51:58 +0200 |
| commit | cf8de26afe0db5c330f4c913d736dc1f840add88 (patch) | |
| tree | f84ed27c9f14a7bdf3e98b0fdc79a35b6bb91ec4 /tests/expected | |
| parent | 2e5627fa032967512a5f55c933af4216c5b672e0 (diff) | |
| download | util-linux-old-cf8de26afe0db5c330f4c913d736dc1f840add88.tar.gz | |
lib: add strtosize() function
This function
int strtosize(const char *str, uintmax_t *res)
supports {K,M,G,T,E,P}iB and {K,M,G,T,E,P}B suffixes.
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'tests/expected')
| -rw-r--r-- | tests/expected/misc/strtosize | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/expected/misc/strtosize b/tests/expected/misc/strtosize new file mode 100644 index 00000000..b7cb2461 --- /dev/null +++ b/tests/expected/misc/strtosize @@ -0,0 +1,23 @@ +test_strtosize: invalid size '-1' value + 0 : 0 + 1 : 1 + 123 : 123 + 18446744073709551615 : 18446744073709551615 + 1K : 1024 + 1KiB : 1024 + 1M : 1048576 + 1MiB : 1048576 + 1G : 1073741824 + 1GiB : 1073741824 + 1T : 1099511627776 + 1TiB : 1099511627776 + 1P : 1125899906842624 + 1PiB : 1125899906842624 + 1E : 1152921504606846976 + 1EiB : 1152921504606846976 + 1KB : 1000 + 1MB : 1000000 + 1GB : 1000000000 + 1TB : 1000000000000 + 1PB : 1000000000000000 + 1EB : 1000000000000000000 |
