From 7bd128f1eecac17e253e3799d59719f3cc4eeb21 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Sun, 29 Aug 2004 21:35:45 +0000 Subject: [PATCH] Prototype hex_dump(). Add various is*() functions. --- src/lib/lib.h | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/src/lib/lib.h b/src/lib/lib.h index 405b9f7..f6ae7c4 100644 --- a/src/lib/lib.h +++ b/src/lib/lib.h @@ -24,10 +24,14 @@ void printk (const char *, ...) PRINTF_FORMAT (1, 2); int vsnprintf (char *, size_t, const char *, va_list); int snprintf (char *, size_t, const char *, ...) PRINTF_FORMAT (3, 4); -static inline int -isdigit (int c) -{ - return c >= '0' && c <= '9'; -} +void hex_dump (const void *, size_t size); + +static inline int isdigit (int c) { return c >= '0' && c <= '9'; } +static inline int isprint (int c) { return c >= 32 && c < 127; } +static inline int isgraph (int c) { return c >= 33 && c < 127; } +static inline int isspace (int c) { return strchr (" \t\n\r\v", c) != NULL; } +static inline int islower (int c) { return c >= 'a' && c <= 'z'; } +static inline int isupper (int c) { return c >= 'A' && c <= 'Z'; } +static inline int isalpha (int c) { return islower (c) || isupper (c); } #endif /* lib.h */ -- 2.30.2