From: "Carlos L. Torres" <carlos.tor...@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.tor...@rackspace.com>


Carlos L. Torres (4):
  cutils: Add qemu_strtol() wrapper
  cutils: Add qemu_strtoul() wrapper
  cutils: Add qemu_strtoll() wrapper
  cutils: Add qemu_strtoull() wrapper

 include/qemu-common.h |    8 +
 tests/test-cutils.c   | 1172 +++++++++++++++++++++++++++++++++++++++++++++++++
 util/cutils.c         |  131 ++++++
 3 files changed, 1311 insertions(+)

-- 
1.9.1


Reply via email to