From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGxbH-00008W-1l for qemu-devel@nongnu.org; Sun, 19 Jul 2015 19:02:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZGxbD-0008FM-NJ for qemu-devel@nongnu.org; Sun, 19 Jul 2015 19:02:26 -0400 Received: from mail-ob0-x22a.google.com ([2607:f8b0:4003:c01::22a]:36199) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZGxbD-0008FH-Jb for qemu-devel@nongnu.org; Sun, 19 Jul 2015 19:02:23 -0400 Received: by obnw1 with SMTP id w1so92639940obn.3 for ; Sun, 19 Jul 2015 16:02:23 -0700 (PDT) From: "Carlos L. Torres" Date: Sun, 19 Jul 2015 18:02:16 -0500 Message-Id: Subject: [Qemu-devel] [PATCH v3 0/5] cutils: Add qemu_strto*l() wrappers List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: pbonzini@redhat.com, stefanha@redhat.com From: "Carlos L. Torres" 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 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 | 14 +- tests/test-cutils.c | 1280 +++++++++++++++++++++++++++++++++++++++++++++++++ util/cutils.c | 136 ++++++ 4 files changed, 1434 insertions(+), 4 deletions(-) -- 1.9.1