summaryrefslogtreecommitdiff
path: root/libc/misc/ctype
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2000-10-11 22:08:28 +0000
committerEric Andersen <andersen@codepoet.org>2000-10-11 22:08:28 +0000
commit1eb3e9989a8241c1654788fc7589e1f679e73dff (patch)
tree00f181e6187be0a35f9b1bf438e1fb81c2255ef2 /libc/misc/ctype
parent22ed2fc2317bd267d32949bd4c3409f4cbdd0fe6 (diff)
New misc tree that actually has misc stuff in it.
Diffstat (limited to 'libc/misc/ctype')
-rw-r--r--libc/misc/ctype/.indent.pro33
-rw-r--r--libc/misc/ctype/Makefile42
-rw-r--r--libc/misc/ctype/ctype.c67
3 files changed, 142 insertions, 0 deletions
diff --git a/libc/misc/ctype/.indent.pro b/libc/misc/ctype/.indent.pro
new file mode 100644
index 000000000..492ecf1c7
--- /dev/null
+++ b/libc/misc/ctype/.indent.pro
@@ -0,0 +1,33 @@
+--blank-lines-after-declarations
+--blank-lines-after-procedures
+--break-before-boolean-operator
+--no-blank-lines-after-commas
+--braces-on-if-line
+--braces-on-struct-decl-line
+--comment-indentation25
+--declaration-comment-column25
+--no-comment-delimiters-on-blank-lines
+--cuddle-else
+--continuation-indentation4
+--case-indentation0
+--else-endif-column33
+--space-after-cast
+--line-comments-indentation0
+--declaration-indentation1
+--dont-format-first-column-comments
+--dont-format-comments
+--honour-newlines
+--indent-level4
+/* changed from 0 to 4 */
+--parameter-indentation4
+--line-length78 /* changed from 75 */
+--continue-at-parentheses
+--no-space-after-function-call-names
+--dont-break-procedure-type
+--dont-star-comments
+--leave-optional-blank-lines
+--dont-space-special-semicolon
+--tab-size4
+/* additions by Mark */
+--case-brace-indentation0
+--leave-preprocessor-space
diff --git a/libc/misc/ctype/Makefile b/libc/misc/ctype/Makefile
new file mode 100644
index 000000000..7c5d5fae6
--- /dev/null
+++ b/libc/misc/ctype/Makefile
@@ -0,0 +1,42 @@
+# Makefile for uCLibc
+#
+# Copyright (C) 2000 by Lineo, inc.
+#
+# This program is free software; you can redistribute it and/or modify it under
+# the terms of the GNU Library General Public License as published by the Free
+# Software Foundation; either version 2 of the License, or (at your option) any
+# later version.
+#
+# This program is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+# details.
+#
+# You should have received a copy of the GNU General Public License along with
+# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+# Place, Suite 330, Boston, MA 02111-1307 USA
+#
+# Derived in part from the Linux-8086 C library, the GNU C Library, and several
+# other sundry sources. Files within this library are copyright by their
+# respective copyright holders.
+
+TOPDIR=../../
+include $(TOPDIR)Rules.make
+LIBC=$(TOPDIR)libc.a
+
+CSRC=ctype.c
+COBJS=$(patsubst %.c,%.o, $(CSRC))
+OBJS=$(COBJS)
+
+all: $(OBJS) $(LIBC)
+
+$(LIBC): ar-target
+
+ar-target: $(OBJS)
+ $(AR) $(ARFLAGS) $(LIBC) $(OBJS)
+
+$(OBJS): Makefile
+
+clean:
+ rm -f *.[oa] *~ core
+
diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c
new file mode 100644
index 000000000..689ea50aa
--- /dev/null
+++ b/libc/misc/ctype/ctype.c
@@ -0,0 +1,67 @@
+/* Copyright (C) 1995,1996 Robert de Bath <rdebath@cix.compulink.co.uk>
+ * This file is part of the Linux-8086 C library and is distributed
+ * under the GNU Library General Public License.
+ */
+
+/*
+ * CTYPE.C Character classification and conversion
+ */
+
+#include <ctype.h>
+
+#undef toupper
+#undef tolower
+
+unsigned char __ctype[128] = {
+ __CT_c, __CT_c, __CT_c, __CT_c, /* 0x00..0x03 */
+ __CT_c, __CT_c, __CT_c, __CT_c, /* 0x04..0x07 */
+ __CT_c, __CT_c | __CT_s, __CT_c | __CT_s, __CT_c | __CT_s, /* 0x08..0x0B */
+ __CT_c | __CT_s, __CT_c | __CT_s, __CT_c, __CT_c, /* 0x0C..0x0F */
+
+ __CT_c, __CT_c, __CT_c, __CT_c, /* 0x10..0x13 */
+ __CT_c, __CT_c, __CT_c, __CT_c, /* 0x14..0x17 */
+ __CT_c, __CT_c, __CT_c, __CT_c, /* 0x18..0x1B */
+ __CT_c, __CT_c, __CT_c, __CT_c, /* 0x1C..0x1F */
+
+ __CT_s, __CT_p, __CT_p, __CT_p, /* 0x20..0x23 */
+ __CT_p, __CT_p, __CT_p, __CT_p, /* 0x24..0x27 */
+ __CT_p, __CT_p, __CT_p, __CT_p, /* 0x28..0x2B */
+ __CT_p, __CT_p, __CT_p, __CT_p, /* 0x2C..0x2F */
+
+ __CT_d | __CT_x, __CT_d | __CT_x, __CT_d | __CT_x, __CT_d | __CT_x, /* 0x30..0x33 */
+ __CT_d | __CT_x, __CT_d | __CT_x, __CT_d | __CT_x, __CT_d | __CT_x, /* 0x34..0x37 */
+ __CT_d | __CT_x, __CT_d | __CT_x, __CT_p, __CT_p, /* 0x38..0x3B */
+ __CT_p, __CT_p, __CT_p, __CT_p, /* 0x3C..0x3F */
+
+ __CT_p, __CT_u | __CT_x, __CT_u | __CT_x, __CT_u | __CT_x, /* 0x40..0x43 */
+ __CT_u | __CT_x, __CT_u | __CT_x, __CT_u | __CT_x, __CT_u, /* 0x44..0x47 */
+ __CT_u, __CT_u, __CT_u, __CT_u, /* 0x48..0x4B */
+ __CT_u, __CT_u, __CT_u, __CT_u, /* 0x4C..0x4F */
+
+ __CT_u, __CT_u, __CT_u, __CT_u, /* 0x50..0x53 */
+ __CT_u, __CT_u, __CT_u, __CT_u, /* 0x54..0x57 */
+ __CT_u, __CT_u, __CT_u, __CT_p, /* 0x58..0x5B */
+ __CT_p, __CT_p, __CT_p, __CT_p, /* 0x5C..0x5F */
+
+ __CT_p, __CT_l | __CT_x, __CT_l | __CT_x, __CT_l | __CT_x, /* 0x60..0x63 */
+ __CT_l | __CT_x, __CT_l | __CT_x, __CT_l | __CT_x, __CT_l, /* 0x64..0x67 */
+ __CT_l, __CT_l, __CT_l, __CT_l, /* 0x68..0x6B */
+ __CT_l, __CT_l, __CT_l, __CT_l, /* 0x6C..0x6F */
+
+ __CT_l, __CT_l, __CT_l, __CT_l, /* 0x70..0x73 */
+ __CT_l, __CT_l, __CT_l, __CT_l, /* 0x74..0x77 */
+ __CT_l, __CT_l, __CT_l, __CT_p, /* 0x78..0x7B */
+ __CT_p, __CT_p, __CT_p, __CT_c /* 0x7C..0x7F */
+};
+
+int toupper(c)
+int c;
+{
+ return (islower(c) ? (c ^ 0x20) : (c));
+}
+
+int tolower(c)
+int c;
+{
+ return (isupper(c) ? (c ^ 0x20) : (c));
+}