]> err.no Git - util-linux/commit
lib: add strtosize() function
authorKarel Zak <kzak@redhat.com>
Tue, 30 Mar 2010 11:47:33 +0000 (13:47 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 30 Mar 2010 11:51:58 +0000 (13:51 +0200)
commitcf8de26afe0db5c330f4c913d736dc1f840add88
treef84ed27c9f14a7bdf3e98b0fdc79a35b6bb91ec4
parent2e5627fa032967512a5f55c933af4216c5b672e0
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>
include/Makefile.am
include/strtosize.h [new file with mode: 0644]
lib/Makefile.am
lib/strtosize.c [new file with mode: 0644]
tests/commands.sh.in
tests/expected/misc/strtosize [new file with mode: 0644]
tests/ts/misc/strtosize [new file with mode: 0755]