summary refs log tree commit diff stats
path: root/include/qemu
diff options
context:
space:
mode:
authorDaniel P. Berrange <berrange@redhat.com>2017-12-22 12:46:23 +0000
committerDaniel P. Berrangé <berrange@redhat.com>2018-03-13 18:06:05 +0000
commit473a2a331ee382703f7ca0067ba2545350cfa06c (patch)
tree4c1eef0279b4a65ff55c20ec0b39d6c09fc8aefa /include/qemu
parent63bab2b69688dee0ddadff7449143830e59567cd (diff)
downloadfocaccia-qemu-473a2a331ee382703f7ca0067ba2545350cfa06c.tar.gz
focaccia-qemu-473a2a331ee382703f7ca0067ba2545350cfa06c.zip
cutils: add qemu_strtoi & qemu_strtoui parsers for int/unsigned int types
There are qemu_strtoNN functions for various sized integers. This adds two
more for plain int & unsigned int types, with suitable range checking.

Reviewed-by: Eric Blake <eblake@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
Diffstat (limited to 'include/qemu')
-rw-r--r--include/qemu/cutils.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/include/qemu/cutils.h b/include/qemu/cutils.h
index f0878eaafa..a663340b23 100644
--- a/include/qemu/cutils.h
+++ b/include/qemu/cutils.h
@@ -126,6 +126,10 @@ time_t mktimegm(struct tm *tm);
 int qemu_fdatasync(int fd);
 int fcntl_setfl(int fd, int flag);
 int qemu_parse_fd(const char *param);
+int qemu_strtoi(const char *nptr, const char **endptr, int base,
+                int *result);
+int qemu_strtoui(const char *nptr, const char **endptr, int base,
+                 unsigned int *result);
 int qemu_strtol(const char *nptr, const char **endptr, int base,
                 long *result);
 int qemu_strtoul(const char *nptr, const char **endptr, int base,