diff options
author | Jes Sorensen <Jes.Sorensen@redhat.com> | 2010-12-09 14:17:24 +0100 |
---|---|---|
committer | Kevin Wolf <kwolf@redhat.com> | 2010-12-17 16:10:59 +0100 |
commit | d8427002dc1be0a9337cde3ef505ee6e57718675 (patch) | |
tree | 507ed786e970dc5ec0b0e7c26260b65bded8e6ad /qemu-common.h | |
parent | df2dbb4a508ebea7bcacff3f07caecbae969d528 (diff) |
Introduce strtosz_suffix()
This introduces strtosz_suffix() which allows the caller to specify a
default suffix in case the non default of MB is wanted.
strtosz() is kept as a wrapper for strtosz_suffix() which keeps it's
current default of MB.
Signed-off-by: Jes Sorensen <Jes.Sorensen@redhat.com>
Reviewed-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'qemu-common.h')
-rw-r--r-- | qemu-common.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/qemu-common.h b/qemu-common.h index de82c2ea13..1ed32e5b2c 100644 --- a/qemu-common.h +++ b/qemu-common.h @@ -149,7 +149,14 @@ time_t mktimegm(struct tm *tm); int qemu_fls(int i); int qemu_fdatasync(int fd); int fcntl_setfl(int fd, int flag); + +#define STRTOSZ_DEFSUFFIX_TB 'T' +#define STRTOSZ_DEFSUFFIX_GB 'G' +#define STRTOSZ_DEFSUFFIX_MB 'M' +#define STRTOSZ_DEFSUFFIX_KB 'K' +#define STRTOSZ_DEFSUFFIX_B 'B' ssize_t strtosz(const char *nptr, char **end); +ssize_t strtosz_suffix(const char *nptr, char **end, const char default_suffix); /* path.c */ void init_paths(const char *prefix); |