summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorManuel Novoa III <mjn3@codepoet.org>2001-03-18 22:19:32 +0000
committerManuel Novoa III <mjn3@codepoet.org>2001-03-18 22:19:32 +0000
commita12156f0c4d93e521429a72d3eb0a109655fb219 (patch)
tree8e1a1626bf4cc2236e9d19c769e427c0b7ef4069 /include
parenta91d0a538d52c77fd56a3f44974f96654125d9db (diff)
Part of the ctype locale support.
Diffstat (limited to 'include')
-rw-r--r--include/ctype.h12
-rw-r--r--include/locale.h29
2 files changed, 38 insertions, 3 deletions
diff --git a/include/ctype.h b/include/ctype.h
index a4fab9bca..cf6c7fb85 100644
--- a/include/ctype.h
+++ b/include/ctype.h
@@ -4,11 +4,17 @@
#ifndef __CTYPE_H
#define __CTYPE_H
+#include <features.h>
+
/* For now, just always use the functions instead of the macros...*/
-#define USE_CTYPE_C_FUNCTIONS
+#define __USE_CTYPE_C_FUNCTIONS
+/* Locale-compatible macros/inlines have yet to be implemented. */
+#if __UCLIBC_HAS_LOCALE__ && !defined(__USE_CTYPE_C_FUNCTIONS)
+#define __USE_CTYPE_C_FUNCTIONS
+#endif
-#ifdef USE_CTYPE_C_FUNCTIONS
+#ifdef __USE_CTYPE_C_FUNCTIONS
/* function prototpes */
extern int isalnum(int c);
extern int isalpha(int c);
@@ -34,7 +40,7 @@ extern int toupper(int c);
#define isalnum(c) (isalpha(c) || isdigit(c))
#define isalpha(c) (isupper(c) || islower(c))
#define isascii(c) (c > 0 && c <= 0x7f)
-#define iscntrl(c) ((c > 0) && ((c <= 0x1F) || (c == 0x7f)))
+#define iscntrl(c) ((c >= 0) && ((c <= 0x1F) || (c == 0x7f)))
#define isdigit(c) (c >= '0' && c <= '9')
#define isgraph(c) (c != ' ' && isprint(c))
#define islower(c) (c >= 'a' && c <= 'z')
diff --git a/include/locale.h b/include/locale.h
new file mode 100644
index 000000000..f0c6f2e63
--- /dev/null
+++ b/include/locale.h
@@ -0,0 +1,29 @@
+/* locale.h
+ * Support international type specific characters.
+ */
+#ifndef _LOCALE_H
+#define _LOCALE_H 1
+
+#include <features.h>
+
+#ifndef NULL
+#ifdef __cplusplus
+#define NULL 0
+#else
+#define NULL ((void *) 0)
+#endif
+#endif
+
+/* These are the possibilities for the first argument to setlocale.
+ The code assumes that LC_ALL is the highest value, and zero the lowest. */
+#define LC_CTYPE 0
+#define LC_NUMERIC 1
+#define LC_TIME 2
+#define LC_COLLATE 3
+#define LC_MONETARY 4
+#define LC_MESSAGES 5
+#define LC_ALL 6
+
+extern char *setlocale(int __category, __const char *__locale);
+
+#endif /* locale.h */