aboutsummaryrefslogtreecommitdiff
path: root/gdb/common/common-utils.h
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2015-06-15 17:04:56 +0200
committerJan Kratochvil <jan.kratochvil@redhat.com>2015-06-15 17:04:56 +0200
commit03aef70fecec83e109c65337a59600ad36def6bf (patch)
treeed240e26dc4d64cc4536b2b371523c8b6e9e9919 /gdb/common/common-utils.h
parentd1168cc1a9825b96747440b0bd1f82c4498e6343 (diff)
downloadbinutils-03aef70fecec83e109c65337a59600ad36def6bf.zip
binutils-03aef70fecec83e109c65337a59600ad36def6bf.tar.gz
binutils-03aef70fecec83e109c65337a59600ad36def6bf.tar.bz2
Move utility functions to common/
gdb/ChangeLog 2015-06-15 Aleksandar Ristovski <aristovski@qnx.com Jan Kratochvil <jan.kratochvil@redhat.com> Move utility functions to common/. * cli/cli-utils.c (skip_spaces, skip_spaces_const, skip_to_space_const): Move defs to common/common-utils.c. * cli/cli-utils.h (skip_spaces, skip_spaces_const, skip_to_space) (skip_to_space_const): Move decls to common/common-utils.h. * common/common-defs.h: Move include of common-types.h before common-utils.h. * common/common-utils.c: Include host-defs.h and ctype.h. (HIGH_BYTE_POSN, is_digit_in_base, digit_to_int, strtoulst): Move from utils.c. (skip_spaces, skip_spaces_const, skip_to_space_const): Move from cli/cli-utils.c. * common/common-utils.h (strtoulst): Move decl from utils.h. (skip_spaces, skip_spaces_const, skip_to_space, skip_to_space_const): Move from cli/cli-utils.h. * common/host-defs.h: Include limits.h. (TARGET_CHAR_BIT, HOST_CHAR_BIT): Moved from defs.h. (skip_spaces, skip_spaces_const): Move decls from cli/cli-utils.h. * defs.h (TARGET_CHAR_BIT, HOST_CHAR_BIT): Move to common/common-utils.h. * utils.c (HIGH_BYTE_POSN, is_digit_in_base, digit_to_int) (strtoulst): Move to common/common-utils.c. * utils.h (strtoulst): Moved decl to common/common-utils.h.
Diffstat (limited to 'gdb/common/common-utils.h')
-rw-r--r--gdb/common/common-utils.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h
index cd2665a..eef5e6b 100644
--- a/gdb/common/common-utils.h
+++ b/gdb/common/common-utils.h
@@ -77,4 +77,24 @@ startswith (const char *string, const char *pattern)
return strncmp (string, pattern, strlen (pattern)) == 0;
}
+ULONGEST strtoulst (const char *num, const char **trailer, int base);
+
+/* Skip leading whitespace characters in INP, returning an updated
+ pointer. If INP is NULL, return NULL. */
+
+extern char *skip_spaces (char *inp);
+
+/* A const-correct version of the above. */
+
+extern const char *skip_spaces_const (const char *inp);
+
+/* Skip leading non-whitespace characters in INP, returning an updated
+ pointer. If INP is NULL, return NULL. */
+
+#define skip_to_space(INP) ((char *) skip_to_space_const (INP))
+
+/* A const-correct version of the above. */
+
+extern const char *skip_to_space_const (const char *inp);
+
#endif