summaryrefslogtreecommitdiffstats
path: root/lib/libc/locale/nomacros.c
diff options
context:
space:
mode:
authorache <ache@FreeBSD.org>1994-09-24 15:59:33 +0000
committerache <ache@FreeBSD.org>1994-09-24 15:59:33 +0000
commit476696843bae8161ce814be1955558627af27e23 (patch)
treec421c8fdc2c907798a87f84e37c8407eb2618aad /lib/libc/locale/nomacros.c
parentb035e6b80667654a294b7053cf110f28d6dff0cb (diff)
downloadFreeBSD-src-476696843bae8161ce814be1955558627af27e23.zip
FreeBSD-src-476696843bae8161ce814be1955558627af27e23.tar.gz
Make not-so-space-eaten locale version:
split modules to bring only neccessary functions, eliminate sprintf, make reduced startup_locale version.
Diffstat (limited to 'lib/libc/locale/nomacros.c')
-rw-r--r--lib/libc/locale/nomacros.c41
1 files changed, 41 insertions, 0 deletions
diff --git a/lib/libc/locale/nomacros.c b/lib/libc/locale/nomacros.c
new file mode 100644
index 0000000..32ee404
--- /dev/null
+++ b/lib/libc/locale/nomacros.c
@@ -0,0 +1,41 @@
+#include <ctype.h>
+#include <rune.h>
+
+#if !defined(_USE_CTYPE_INLINE_) && !defined(_USE_CTYPE_MACROS_)
+/*
+ * See comments in <machine/ansi.h>
+ */
+int
+__istype(c, f)
+ _BSD_RUNE_T_ c;
+ unsigned long f;
+{
+ return ((((c & _CRMASK) ? ___runetype(c)
+ : _CurrentRuneLocale->runetype[c]) & f) ? 1 : 0);
+}
+
+int
+__isctype(_BSD_RUNE_T_ c, unsigned long f)
+ _BSD_RUNE_T_ c;
+ unsigned long f;
+{
+ return ((((c & _CRMASK) ? 0
+ : _DefaultRuneLocale.runetype[c]) & f) ? 1 : 0);
+}
+
+_BSD_RUNE_T_
+toupper(c)
+ _BSD_RUNE_T_ c;
+{
+ return ((c & _CRMASK) ?
+ ___toupper(c) : _CurrentRuneLocale->mapupper[c]);
+}
+
+_BSD_RUNE_T_
+tolower(c)
+ _BSD_RUNE_T_ c;
+{
+ return ((c & _CRMASK) ?
+ ___tolower(c) : _CurrentRuneLocale->maplower[c]);
+}
+#endif
OpenPOWER on IntegriCloud