From 2f35d6e30777b48f7e0b8f456d8b19d2ea76ed60 Mon Sep 17 00:00:00 2001 From: jani Date: Fri, 25 Jul 2003 13:06:37 +0000 Subject: [PATCH] Add isascii and friends macros in inet.c so there's no dependency on ctype.h --- src/core/inet.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/core/inet.c b/src/core/inet.c index 4feab48f..452557c4 100644 --- a/src/core/inet.c +++ b/src/core/inet.c @@ -169,6 +169,16 @@ inet_chksum_pbuf(struct pbuf *p) return ~(acc & 0xffffUL); } +/* Here for now until needed in other places in lwIP */ +#ifndef isascii +#define in_range(c, lo, up) ((u8_t)c >= lo && (u8_t)c <= up) +#define isascii(c) in_range(c, 0x20, 0x7f) +#define isdigit(c) in_range(c, '0', '9') +#define isxdigit(c) (isdigit(c) || in_range(c, 'a', 'f') || in_range(c, 'A', 'F')) +#define islower(c) in_range(c, 'a', 'z') +#define isspace(c) (c == ' ' || c == '\f' || c == '\n' || c == '\r' || c == '\t' || c == '\v') +#endif + /*-----------------------------------------------------------------------------------*/ /* * Ascii internet address interpretation routine.