summaryrefslogtreecommitdiffstats
path: root/include/strutils.h
diff options
context:
space:
mode:
authorKarel Zak2017-01-28 12:39:30 +0100
committerKarel Zak2017-01-28 12:39:30 +0100
commit61cbc8a3f5aa1b4acb4e5a6b7b251b8c5b8f05b5 (patch)
treec0d1ce4f8391dd496d760417c1174e7d27ac2100 /include/strutils.h
parentlibfdisk: (gpt) add check for entries array size (diff)
downloadkernel-qcow2-util-linux-61cbc8a3f5aa1b4acb4e5a6b7b251b8c5b8f05b5.tar.gz
kernel-qcow2-util-linux-61cbc8a3f5aa1b4acb4e5a6b7b251b8c5b8f05b5.tar.xz
kernel-qcow2-util-linux-61cbc8a3f5aa1b4acb4e5a6b7b251b8c5b8f05b5.zip
lib/strutils: return end pointer by isdigit_string()
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/strutils.h')
-rw-r--r--include/strutils.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/strutils.h b/include/strutils.h
index aa31fc984..28c1b5e5d 100644
--- a/include/strutils.h
+++ b/include/strutils.h
@@ -39,8 +39,12 @@ extern unsigned long strtoul_or_err(const char *str, const char *errmesg);
extern void strtotimeval_or_err(const char *str, struct timeval *tv,
const char *errmesg);
-extern int isdigit_string(const char *str);
-extern int isxdigit_string(const char *str);
+extern int isdigit_strend(const char *str, const char **end);
+#define isdigit_string(_s) isdigit_strend(_s, NULL)
+
+extern int isxdigit_strend(const char *str, const char **end);
+#define isxdigit_string(_s) isxdigit_strend(_s, NULL)
+
extern int parse_switch(const char *arg, const char *errmesg, ...);