From 8706dedec7fbd1555df0fd72e0c65457ea039735 Mon Sep 17 00:00:00 2001 From: Herbert Xu Date: Sat, 29 Oct 2005 22:11:56 +1000 Subject: [SYSTEM] Added out-of-line ctypes functions for klibc Unfortunately klibc doesn't provide out-of-line versions of ctypes functions such as isalpha. This is a nasty hack to create them. --- src/system.c | 90 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 90 insertions(+) (limited to 'src') diff --git a/src/system.c b/src/system.c index 4c281ed..c6bc52d 100644 --- a/src/system.c +++ b/src/system.c @@ -26,8 +26,37 @@ * SUCH DAMAGE. */ +#ifndef HAVE_ISALPHA +#define isalnum _isalnum +#define iscntrl _iscntrl +#define islower _islower +#define isspace _isspace +#define isalpha _isalpha +#define isdigit _isdigit +#define isprint _isprint +#define isupper _isupper +#define isblank _isblank +#define isgraph _isgraph +#define ispunct _ispunct +#define isxdigit _isxdigit +#include +#undef isalnum +#undef iscntrl +#undef islower +#undef isspace +#undef isalpha +#undef isdigit +#undef isprint +#undef isupper +#undef isblank +#undef isgraph +#undef ispunct +#undef isxdigit +#endif + #include #include + #include "error.h" #include "output.h" #include "system.h" @@ -97,3 +126,64 @@ long sysconf(int name) sh_error("no sysconf for: %d", name); } #endif + +#ifndef HAVE_ISALPHA +int isalnum(int c) { + return _isalnum(c); +} + + +int iscntrl(int c) { + return _iscntrl(c); +} + + +int islower(int c) { + return _islower(c); +} + + +int isspace(int c) { + return _isspace(c); +} + + +int isalpha(int c) { + return _isalpha(c); +} + + +int isdigit(int c) { + return _isdigit(c); +} + + +int isprint(int c) { + return _isprint(c); +} + + +int isupper(int c) { + return _isupper(c); +} + + +int isblank(int c) { + return _isblank(c); +} + + +int isgraph(int c) { + return _isgraph(c); +} + + +int ispunct(int c) { + return _ispunct(c); +} + + +int isxdigit(int c) { + return _isxdigit(c); +} +#endif -- cgit 1.4.1