diff options
author | Simon Glass <sjg@chromium.org> | 2011-07-05 12:02:49 -0700 |
---|---|---|
committer | Jon Loeliger <jdl@jdl.com> | 2011-07-17 07:42:26 -0500 |
commit | 492f9d5de7db74aeb3a905246c4efd7cb29227a8 (patch) | |
tree | b745e6929817e98d47f1e53e4260040570fa3670 /util.h | |
parent | d5b3165023b1cc3914e9943b91964ec9ad4be8b2 (diff) | |
download | dtc-492f9d5de7db74aeb3a905246c4efd7cb29227a8.tar.gz |
Split out is_printable_string() into util.c
This useful function is split out so it will be available to programs
other than ftdump.
Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: David Gibson <david@gibson.dropbear.id.au>
Diffstat (limited to 'util.h')
-rw-r--r-- | util.h | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -1,6 +1,8 @@ #ifndef _UTIL_H #define _UTIL_H +#include <stdarg.h> + /* * Copyright 2008 Jon Loeliger, Freescale Semiconductor, Inc. * @@ -53,4 +55,13 @@ static inline void *xrealloc(void *p, size_t len) extern char *xstrdup(const char *s); extern char *join_path(const char *path, const char *name); +/** + * Check a string of a given length to see if it is all printable and + * has a valid terminator. + * + * @param data The string to check + * @param len The string length including terminator + * @return 1 if a valid printable string, 0 if not */ +int util_is_printable_string(const void *data, int len); + #endif /* _UTIL_H */ |