From 764e0fa497ff5bbc9c9d7c116da2f00f34e71716 Mon Sep 17 00:00:00 2001 From: "Carlos L. Torres" Date: Sun, 19 Jul 2015 18:02:17 -0500 Subject: cutils: Add qemu_strtol() wrapper Add wrapper for strtol() function. Include unit tests. Signed-off-by: Carlos L. Torres Message-Id: <07199f1c0ff3892790c6322123aee1e92f580550.1437346779.git.carlos.torres@rackspace.com> Signed-off-by: Paolo Bonzini --- include/qemu-common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/qemu-common.h') diff --git a/include/qemu-common.h b/include/qemu-common.h index bbaffd12e7..1c1169f68a 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -203,6 +203,8 @@ int qemu_fls(int i); int qemu_fdatasync(int fd); int fcntl_setfl(int fd, int flag); int qemu_parse_fd(const char *param); +int qemu_strtol(const char *nptr, const char **endptr, int base, + long *result); int parse_uint(const char *s, unsigned long long *value, char **endptr, int base); -- cgit v1.2.3 From c817c01548b1500753d0bea3852938d919161778 Mon Sep 17 00:00:00 2001 From: "Carlos L. Torres" Date: Sun, 19 Jul 2015 18:02:18 -0500 Subject: cutils: Add qemu_strtoul() wrapper Add wrapper for strtoul() function. Include unit tests. Signed-off-by: Carlos L. Torres Message-Id: <9621b4ae8e35fded31c715c2ae2a98f904f07ad0.1437346779.git.carlos.torres@rackspace.com> [Fix tests for 32-bit build. - Paolo] Signed-off-by: Paolo Bonzini --- include/qemu-common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/qemu-common.h') diff --git a/include/qemu-common.h b/include/qemu-common.h index 1c1169f68a..558a14fa5f 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -205,6 +205,8 @@ int fcntl_setfl(int fd, int flag); int qemu_parse_fd(const char *param); int qemu_strtol(const char *nptr, const char **endptr, int base, long *result); +int qemu_strtoul(const char *nptr, const char **endptr, int base, + unsigned long *result); int parse_uint(const char *s, unsigned long long *value, char **endptr, int base); -- cgit v1.2.3 From 8ac4df40cc5de606a8ac9174e2340c21093b4e3b Mon Sep 17 00:00:00 2001 From: "Carlos L. Torres" Date: Sun, 19 Jul 2015 18:02:19 -0500 Subject: cutils: Add qemu_strtoll() wrapper Add wrapper for strtoll() function. Include unit tests. Signed-off-by: Carlos L. Torres Message-Id: <7454a6bb9ec03b629e8beb4f109dd30dc2c9804c.1437346779.git.carlos.torres@rackspace.com> [Use int64_t in prototype, since that's what QEMU uses. - Paolo] Signed-off-by: Paolo Bonzini --- include/qemu-common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/qemu-common.h') diff --git a/include/qemu-common.h b/include/qemu-common.h index 558a14fa5f..29cf0a0765 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -207,6 +207,8 @@ int qemu_strtol(const char *nptr, const char **endptr, int base, long *result); int qemu_strtoul(const char *nptr, const char **endptr, int base, unsigned long *result); +int qemu_strtoll(const char *nptr, const char **endptr, int base, + int64_t *result); int parse_uint(const char *s, unsigned long long *value, char **endptr, int base); -- cgit v1.2.3 From 3904e6bf042391abc749d717465022e96e276fc7 Mon Sep 17 00:00:00 2001 From: "Carlos L. Torres" Date: Sun, 19 Jul 2015 18:02:20 -0500 Subject: cutils: Add qemu_strtoull() wrapper Add wrapper for strtoull() function. Include unit tests. Signed-off-by: Carlos L. Torres Message-Id: [Use uint64_t in prototype. - Paolo] Signed-off-by: Paolo Bonzini --- include/qemu-common.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include/qemu-common.h') diff --git a/include/qemu-common.h b/include/qemu-common.h index 29cf0a0765..2e684fee77 100644 --- a/include/qemu-common.h +++ b/include/qemu-common.h @@ -209,6 +209,8 @@ int qemu_strtoul(const char *nptr, const char **endptr, int base, unsigned long *result); int qemu_strtoll(const char *nptr, const char **endptr, int base, int64_t *result); +int qemu_strtoull(const char *nptr, const char **endptr, int base, + uint64_t *result); int parse_uint(const char *s, unsigned long long *value, char **endptr, int base); -- cgit v1.2.3