qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH v2 0/5] cutils: Add qemu_strto*() wrappers
@ 2015-07-18 23:52 Carlos L. Torres
  2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 1/5] cutils: Add qemu_strtol() wrapper Carlos L. Torres
                   ` (4 more replies)
  0 siblings, 5 replies; 8+ messages in thread
From: Carlos L. Torres @ 2015-07-18 23:52 UTC (permalink / raw)
  To: qemu-devel; +Cc: pbonzini, stefanha

From: "Carlos L. Torres" <carlos.torres@rackspace.com>

Introduce qemu_ wrappers for strtol/strtoul/strtoll/strtoull
C functions, ensure that errno is checked, and if NULL is
passed as the endptr argument, then whole string has to be
a valid number on the given base, otherwise return appropriate
error.

Different from the C strto*l() functions, these wrappers
return through the 'result' out parameter.

Include unit-tests for each wrapper function.

Signed-off-by: Carlos L. Torres <carlos.torres@rackspace.com>

Carlos L. Torres (5):
  cutils: Add qemu_strtol() wrapper
  cutils: Add qemu_strtoul() wrapper
  cutils: Add qemu_strtoll() wrapper
  cutils: Add qemu_strtoull() wrapper
  qmp: Add example usage of strto*l() qemu wrapper

 include/qemu-common.h |    8 +
 qmp.c                 |   21 +-
 tests/test-cutils.c   | 1280 +++++++++++++++++++++++++++++++++++++++++++++++++
 util/cutils.c         |  136 ++++++
 4 files changed, 1441 insertions(+), 4 deletions(-)

-- 
1.9.1

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2015-07-19 18:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-18 23:52 [Qemu-devel] [PATCH v2 0/5] cutils: Add qemu_strto*() wrappers Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 1/5] cutils: Add qemu_strtol() wrapper Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 2/5] cutils: Add qemu_strtoul() wrapper Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 3/5] cutils: Add qemu_strtoll() wrapper Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 4/5] cutils: Add qemu_strtoull() wrapper Carlos L. Torres
2015-07-18 23:52 ` [Qemu-devel] [PATCH v2 5/5] qmp: Add example usage of strto*l() qemu wrapper Carlos L. Torres
2015-07-19 17:51   ` Paolo Bonzini
2015-07-19 18:27     ` Carlos L. Torres

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).