summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-10-29 22:11:56 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2005-10-29 22:11:56 +1000
commit8706dedec7fbd1555df0fd72e0c65457ea039735 (patch)
tree6162166b41f1f864827baae17fb22303f1ce4df5 /src
parent[SYSTEM] Include system.h for stpcpy in nodes.c (diff)
downloaddash-8706dedec7fbd1555df0fd72e0c65457ea039735.tar.gz
dash-8706dedec7fbd1555df0fd72e0c65457ea039735.zip
[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.
Diffstat (limited to 'src')
-rw-r--r--src/system.c90
1 files changed, 90 insertions, 0 deletions
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 <ctype.h>
+#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 <signal.h>
 #include <string.h>
+
 #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