home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-09-07 | 58.3 KB | 1,908 lines |
- Newsgroups: comp.sources.unix
- From: prb@cray.com
- Subject: v27i027: REPOST runes - an implementation of setlocale(3) and all its friends, Part01/03
- Message-Id: <9309071427.AA14351@krystal.cray.com>
- Sender: unix-sources-moderator@gw.home.vix.com
- Approved: vixie@gw.home.vix.com
-
- Submitted-By: prb@cray.com
- Posting-Number: Volume 27, Issue 27
- Archive-Name: runes/part01
-
- Runes are a way of representing a character in any language by a single
- value. Languages such as Japanese may have thousands of characters, hence
- a single 8 bit value will not work. Multiple 8 bit values are commonly
- used (multibyte strings) but are difficult to work with. This package
- contains the routines needed to convert between multibyte representations
- and Runes. The ANSI C type wchar_t is mapped directly to rune_t. The
- work with runes was inspired by Plan 9 from Bell Labs (hence the choice
- of rune_t over wchar_t, which is said to be "butt ugly").
-
- #! /bin/sh
- # This is a shell archive. Remove anything before this line, then unpack
- # it by saving it into a file and typing "sh file". To overwrite existing
- # files, type "sh file -c". You can also feed this as standard input via
- # unshar, or by typing "sh <file", e.g.. If this archive is complete, you
- # will see the following message at the end:
- # "End of archive 1 (of 3)."
- # Contents: MANIFEST README doc/mbrune.3 doc/utf2.4 include/machine
- # include/machine/ansi.changes include/machine/limits.changes
- # include/rune.h include/runetype.h include/stddef.changes
- # include/stdlib.changes libc libc/ansi.c libc/frune.c
- # libc/isctype.c libc/mbrune.c libc/none.c libc/utf2.c mklocale
- # mklocale/Japanese mklocale/Makefile mklocale/POSIX mklocale/ldef.h
- # Wrapped by prb@krystal.cray.com on Sun Sep 5 11:15:56 1993
- # Fixed on Tue Sep 7 09:26:28 CDT 1993
- PATH=/bin:/usr/bin:/usr/ucb ; export PATH
- if test -f 'MANIFEST' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'MANIFEST'\"
- else
- echo shar: Extracting \"'MANIFEST'\" \(1189 characters\)
- sed "s/^X//" >'MANIFEST' <<'END_OF_FILE'
- X File Name Archive # Description
- X-----------------------------------------------------------
- X MANIFEST 1
- X README 1
- X doc 1
- X doc/euc.4 3
- X doc/mbrune.3 1
- X doc/multibyte.3 2
- X doc/rune.3 2
- X doc/setlocale.3 3
- X doc/utf2.4 1
- X include 1
- X include/ctype.h 2
- X include/machine 1
- X include/machine/ansi.changes 1
- X include/machine/limits.changes 1
- X include/rune.h 1
- X include/runetype.h 1
- X include/stddef.changes 1
- X include/stdlib.changes 1
- X libc 1
- X libc/ansi.c 1
- X libc/euc.c 2
- X libc/frune.c 1
- X libc/isctype.c 1
- X libc/mbrune.c 1
- X libc/none.c 1
- X libc/rune.c 3
- X libc/setlocale.c 2
- X libc/table.c 2
- X libc/utf2.c 1
- X mklocale 1
- X mklocale/Japanese 1
- X mklocale/Makefile 1
- X mklocale/POSIX 1
- X mklocale/ldef.h 1
- X mklocale/lex.l 2
- X mklocale/mklocale.1 2
- X mklocale/yacc.y 3
- END_OF_FILE
- if test 1189 -ne `wc -c <'MANIFEST'`; then
- echo shar: \"'MANIFEST'\" unpacked with wrong size!
- fi
- # end of 'MANIFEST'
- fi
- if test -f 'README' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'README'\"
- else
- echo shar: Extracting \"'README'\" \(2967 characters\)
- sed "s/^X//" >'README' <<'END_OF_FILE'
- XThis directory contains the rune code I donated to BSD for the 4.4 release.
- XSince 4.4 is not quite available to the free world yet, I have decided to
- Xmake this much available, which I know is not encumbered by any license.
- XThere are also two manual pages written by Donn Seeley of BSDI which he
- Xdonated to BSD. I am sending the versions with BSD copyright notices and
- Xversion numbers to aid people in the future when they receive BSD 4.4.
- X(And heck, they are better than any notice *I* could right :-)
- X
- XThe tree contains the following files:
- X
- X include Files to go in /usr/include
- X include/machine
- X include/machine/ansi.changes Changes to the ansi.h file
- X include/machine/limits.changes Changes to limits.h file
- X include/runetype.h new file
- X include/rune.h new file
- X include/ctype.h replacement file
- X include/stddef.changes Changes to the stddef.h file
- X include/stdlib.changes Changes to the stddef.h file
- X
- X libc New and replacement code for libc
- X libc/ansi.c This code is in lib/libc/locale
- X libc/euc.c in 4.4BSD
- X libc/frune.c
- X libc/isctype.c
- X libc/mbrune.c
- X libc/none.c
- X libc/rune.c
- X libc/setlocale.c
- X libc/table.c
- X libc/utf2.c
- X
- X doc Manual pages relating to runes
- X doc/mbrune.3
- X doc/rune.3
- X doc/setlocale.3 (Written by Donn Seeley)
- X doc/euc.4
- X doc/utf2.4
- X doc/multibyte.3 (Written by Donn Seeley)
- X
- X mklocale A simple command to build locale files
- X mklocale/Japanese Sample Japanese locale
- X mklocale/Makefile
- X mklocale/POSIX Sample POSIX locale (not needed)
- X mklocale/ldef.h
- X mklocale/lex.l
- X mklocale/mklocale.1
- X mklocale/yacc.y
- X
- XA few comments about this software. First, you will need to integrate it into
- Xyour C library if you really want everything to work correctly, though you
- Xshould be able to also build it by itself and include these .o's in your
- Xprogram before the C library.
- X
- XThe POSIX and C locale's are built into the library, so you do not need to
- Xinstall any locale files in order to run a regular program.
- X
- XCurrently collating sequences are not supported. If anyone has
- Xexperience with this in non trivial languages (i.e. not an 8 bit European
- Xlanguage) I would like to hear from you.
- X
- XUnder BSDI 1.0 I made the following changes in /usr/src/lib/libc
- X
- X gen/Makefile.inc
- X removed ctype_.c and isctype.c from the SRCS
- X
- X locale/Makefile.inc
- X added ansi.c, euc.c, frune.c, mbrune.c, none.c, rune.c, table.c,
- X utf2.c, and isctype.c to the SRCS and copied those files in.
- X Also added:
- X MAN3+= mbrune.3 multibyte.3 rune.3 setlocale.0
- X MAN4+= euc.4 utf2.4
- X
- X stdlib/Makefile.inc
- X removed multibyte.c from the SRCS
- X
- X /usr/include
- X Add the .h files from this archive and change the couple files
- X indicated above.
- X
- XI also rebuilt libX11, libXt, libXmu and libutil.
- X
- XReal bug reports are welcome, but I can not guarantee speedy responses.
- X
- XSept 4th, 1993
- X
- XPaul Borman
- XKrystal Technologies, Inc.
- Xprb@cray.com
- END_OF_FILE
- if test 2967 -ne `wc -c <'README'`; then
- echo shar: \"'README'\" unpacked with wrong size!
- fi
- # end of 'README'
- fi
- if test ! -d 'doc' ; then
- echo shar: Creating directory \"'doc'\"
- mkdir 'doc'
- fi
- if test -f 'doc/mbrune.3' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/mbrune.3'\"
- else
- echo shar: Extracting \"'doc/mbrune.3'\" \(3895 characters\)
- sed "s/^X//" >'doc/mbrune.3' <<'END_OF_FILE'
- X.\" Copyright (c) 1993
- X.\" The Regents of the University of California. All rights reserved.
- X.\"
- X.\" This code is derived from software contributed to Berkeley by
- X.\" Paul Borman at Krystal Technologies.
- X.\"
- X.\" Redistribution and use in source and binary forms, with or without
- X.\" modification, are permitted provided that the following conditions
- X.\" are met:
- X.\" 1. Redistributions of source code must retain the above copyright
- X.\" notice, this list of conditions and the following disclaimer.
- X.\" 2. Redistributions in binary form must reproduce the above copyright
- X.\" notice, this list of conditions and the following disclaimer in the
- X.\" documentation and/or other materials provided with the distribution.
- X.\" 3. All advertising materials mentioning features or use of this software
- X.\" must display the following acknowledgement:
- X.\" This product includes software developed by the University of
- X.\" California, Berkeley and its contributors.
- X.\" 4. Neither the name of the University nor the names of its contributors
- X.\" may be used to endorse or promote products derived from this software
- X.\" without specific prior written permission.
- X.\"
- X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X.\" SUCH DAMAGE.
- X.\"
- X.\" @(#)mbrune.3 8.1 (Berkeley) 6/4/93
- X.\"
- X.Dd "June 4, 1993"
- X.Dt MBRUNE 3
- X.Os
- X.Sh NAME
- X.Nm mbrune ,
- X.Nm mbrrune ,
- X.Nm mbmb
- X.Nd multibyte rune support for C
- X.Sh SYNOPSIS
- X.Fd #include <rune.h>
- X.Ft char *
- X.Fn mbrune "const char *string" "rune_t rune"
- X.Ft char *
- X.Fn mbrrune "const char *string" "rune_t rune"
- X.Ft char *
- X.Fn mbmb "const char *string" "char *pattern"
- X.Sh DESCRIPTION
- XThese routines provide the corresponding functionality of
- X.Fn strchr ,
- X.Fn strrchr
- Xand
- X.Fn strstr
- Xfor multibyte strings.
- X.Pp
- XThe
- X.Fn mbrune
- Xfunction locates the first occurence of
- X.Fn rune
- Xin the string pointed to by
- X.Ar string .
- XThe terminating
- X.Dv NULL
- Xcharacter is considered part of the string.
- XIf
- X.Fa rune
- Xis
- X.Ql \e0 ,
- X.Fn mbrune
- Xlocates the terminating
- X.Ql \e0 .
- X.Pp
- XThe
- X.Fn mbrrune
- Xfunction
- Xlocates the last occurrence of
- X.Fa rune
- Xin the string
- X.Fa string .
- XIf
- X.Fa rune
- Xis
- X.Ql \e0 ,
- X.Fn mbrune
- Xlocates the terminating
- X.Ql \e0 .
- X.Pp
- XThe
- X.Fn mbmb
- Xfunction locates the first occurence of the null-terminated string
- X.Fa pattern
- Xin the null-terminated string
- X.Fa string.
- XIf
- X.Fa pattern
- Xis the empty string,
- X.Fn mbmb
- Xreturns
- X.Fa string ;
- Xif
- X.Fa pattern
- Xoccurs nowhere in
- X.Fa string ,
- X.Fn mbmb
- Xreturns
- X.Dv NULL ;
- Xotherwise
- X.Fn mbmb
- Xreturns a pointer to the first character of the first occurrence of
- X.Fa pattern .
- X.Sh RETURN VALUES
- XThe function
- X.Fn mbrune
- Xreturns a pointer to the located character, or
- X.Dv NULL
- Xif the character does not appear in the string.
- X.Pp
- XThe
- X.Fn mbrrune
- Xfunction
- Xreturns a pointer to the character, or
- X.Dv NULL
- Xif the character does not appear in the string.
- X.Pp
- XThe
- X.Fn mbmb
- Xfunction
- Xreturns a pointer to the
- X.Fa pattern ,
- Xor
- X.Dv NULL
- Xif the
- X.Fa pattern
- Xdoes not appear in the string.
- X.Sh "SEE ALSO
- X.Xr euc 4 ,
- X.Xr mbrune 3 ,
- X.Xr rune 3 ,
- X.Xr setlocale 3 ,
- X.Xr utf2 4
- X.Sh HISTORY
- XThe
- X.Fn mbrune ,
- X.Fn mbrrune ,
- Xand
- X.Fn mbmb
- Xfunctions
- Xfirst appeared in Plan 9 from Bell Labs as
- X.Fn utfrune ,
- X.Fn utfrrune ,
- Xand
- X.Fn utfutf .
- END_OF_FILE
- if test 3895 -ne `wc -c <'doc/mbrune.3'`; then
- echo shar: \"'doc/mbrune.3'\" unpacked with wrong size!
- fi
- # end of 'doc/mbrune.3'
- fi
- if test -f 'doc/utf2.4' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'doc/utf2.4'\"
- else
- echo shar: Extracting \"'doc/utf2.4'\" \(3682 characters\)
- sed "s/^X//" >'doc/utf2.4' <<'END_OF_FILE'
- X.\" Copyright (c) 1993
- X.\" The Regents of the University of California. All rights reserved.
- X.\"
- X.\" This code is derived from software contributed to Berkeley by
- X.\" Paul Borman at Krystal Technologies.
- X.\"
- X.\" Redistribution and use in source and binary forms, with or without
- X.\" modification, are permitted provided that the following conditions
- X.\" are met:
- X.\" 1. Redistributions of source code must retain the above copyright
- X.\" notice, this list of conditions and the following disclaimer.
- X.\" 2. Redistributions in binary form must reproduce the above copyright
- X.\" notice, this list of conditions and the following disclaimer in the
- X.\" documentation and/or other materials provided with the distribution.
- X.\" 3. All advertising materials mentioning features or use of this software
- X.\" must display the following acknowledgement:
- X.\" This product includes software developed by the University of
- X.\" California, Berkeley and its contributors.
- X.\" 4. Neither the name of the University nor the names of its contributors
- X.\" may be used to endorse or promote products derived from this software
- X.\" without specific prior written permission.
- X.\"
- X.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X.\" SUCH DAMAGE.
- X.\"
- X.\" @(#)utf2.4 8.1 (Berkeley) 6/4/93
- X.\"
- X.Dd "June 4, 1993"
- X.Dt UTF2 4
- X.Os
- X.Sh NAME
- X.Nm UTF2
- X.Nd "Universal character set Transformation Format encoding of runes
- X.Sh SYNOPSIS
- X\fBENCODING "UTF2"\fP
- X.Sh DESCRIPTION
- XThe
- X.Nm UTF2
- Xencoding is based on a proposed X-Open multibyte
- X\s-1FSS-UCS-TF\s+1 (File System Safe Universal Character Set Transformation Format) encoding as used in
- X.Nm Plan 9 from Bell Labs.
- XAlthough it is capable of representing more than 16 bits,
- Xthe current implementation is limited to 16 bits as defined by the
- XUnicode Standard.
- X.Pp
- X.Nm UTF2
- Xrepresentation is backwards compatible with ASCII, so 0x00-0x7f refer to the
- XASCII character set. The multibyte encoding of runes between 0x0080 and 0xffff
- Xconsist entirely of bytes whose high order bit is set. The actual
- Xencoding is represented by the following table:
- X.Bd -literal
- X[0x0000 - 0x007f] [00000000.0bbbbbbb] -> 0bbbbbbb
- X[0x0080 - 0x03ff] [00000bbb.bbbbbbbb] -> 110bbbbb, 10bbbbbb
- X[0x0400 - 0xffff] [bbbbbbbb.bbbbbbbb] -> 1110bbbb, 10bbbbbb, 10bbbbbb
- X.Ed
- X.sp
- XIf more than a single representation of a value exists (for example,
- X0x00; 0xC0 0x80; 0xE0 0x80 0x80) the shortest representation is always
- Xused (but the longer ones will be correctly decoded).
- X.Pp
- XThe final three encodings provided by X-Open:
- X.Bd -literal
- X[00000000.000bbbbb.bbbbbbbb.bbbbbbbb] ->
- X 11110bbb, 10bbbbbb, 10bbbbbb, 10bbbbbb
- X
- X[000000bb.bbbbbbbb.bbbbbbbb.bbbbbbbb] ->
- X 111110bb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb
- X
- X[0bbbbbbb.bbbbbbbb.bbbbbbbb.bbbbbbbb] ->
- X 1111110b, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb, 10bbbbbb
- X.Ed
- X.sp
- Xwhich provides for the entire proposed ISO-10646 31 bit standard are currently
- Xnot implemented.
- X.Sh "SEE ALSO"
- X.Xr mklocale 1 ,
- X.Xr setlocale 3
- END_OF_FILE
- if test 3682 -ne `wc -c <'doc/utf2.4'`; then
- echo shar: \"'doc/utf2.4'\" unpacked with wrong size!
- fi
- # end of 'doc/utf2.4'
- fi
- if test ! -d 'include' ; then
- echo shar: Creating directory \"'include'\"
- mkdir 'include'
- fi
- if test ! -d 'include/machine' ; then
- echo shar: Creating directory \"'include/machine'\"
- mkdir 'include/machine'
- fi
- if test -f 'include/machine/ansi.changes' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'include/machine/ansi.changes'\"
- else
- echo shar: Extracting \"'include/machine/ansi.changes'\" \(1009 characters\)
- sed "s/^X//" >'include/machine/ansi.changes' <<'END_OF_FILE'
- X< #define _WCHAR_T_ unsigned long /* wchar_t */
- X
- X> /*
- X> * Runes (wchar_t) is declared to be an ``int'' instead of the more natural
- X> * ``unsigned long'' or ``long''. Two things are happening here. It is not
- X> * unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
- X> * it looks like 10646 will be a 31 bit standard. This means that if your
- X> * ints cannot hold 32 bits, you will be in trouble. The reason an int was
- X> * chosen over a long is that the is*() and to*() routines take ints (says
- X> * ANSI C), but they use _RUNE_T_ instead of int. By changing it here, you
- X> * lose a bit of ANSI conformance, but your programs will still work.
- X> *
- X> * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type. When wchar_t
- X> * and rune_t are typedef'd, _WCHAR_T_ will be undef'd, but _RUNE_T remains
- X> * defined for ctype.h.
- X> */
- X> #define _BSD_WCHAR_T_ int /* wchar_t */
- X> #define _BSD_RUNE_T_ int /* rune_t */
- END_OF_FILE
- if test 1009 -ne `wc -c <'include/machine/ansi.changes'`; then
- echo shar: \"'include/machine/ansi.changes'\" unpacked with wrong size!
- fi
- # end of 'include/machine/ansi.changes'
- fi
- if test -f 'include/machine/limits.changes' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'include/machine/limits.changes'\"
- else
- echo shar: Extracting \"'include/machine/limits.changes'\" \(139 characters\)
- sed "s/^X//" >'include/machine/limits.changes' <<'END_OF_FILE'
- X< #define MB_LEN_MAX 1 /* no multibyte characters */
- X
- X> #define MB_LEN_MAX 6 /* Allow 31 bit UTF2 */
- END_OF_FILE
- if test 139 -ne `wc -c <'include/machine/limits.changes'`; then
- echo shar: \"'include/machine/limits.changes'\" unpacked with wrong size!
- fi
- # end of 'include/machine/limits.changes'
- fi
- if test -f 'include/rune.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'include/rune.h'\"
- else
- echo shar: Extracting \"'include/rune.h'\" \(2738 characters\)
- sed "s/^X//" >'include/rune.h' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993
- X * The Regents of the University of California. All rights reserved.
- X *
- X * This code is derived from software contributed to Berkeley by
- X * Paul Borman at Krystal Technologies.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X *
- X * @(#)rune.h 8.1 (Berkeley) 6/27/93
- X */
- X
- X#ifndef _RUNE_H_
- X#define _RUNE_H_
- X
- X#include <runetype.h>
- X#include <stdio.h>
- X
- X#define _PATH_LOCALE "/usr/share/locale"
- X
- X#define _INVALID_RUNE _CurrentRuneLocale->invalid_rune
- X
- X#define __sgetrune _CurrentRuneLocale->sgetrune
- X#define __sputrune _CurrentRuneLocale->sputrune
- X
- X#define sgetrune(s, n, r) (*__sgetrune)((s), (n), (r))
- X#define sputrune(c, s, n, r) (*__sputrune)((c), (s), (n), (r))
- X
- X__BEGIN_DECLS
- Xchar *mbrune __P((const char *, rune_t));
- Xchar *mbrrune __P((const char *, rune_t));
- Xchar *mbmb __P((const char *, char *));
- Xlong fgetrune __P((FILE *));
- Xint fputrune __P((rune_t, FILE *));
- Xint fungetrune __P((rune_t, FILE *));
- Xint setrunelocale __P((char *));
- Xvoid setinvalidrune __P((rune_t));
- X__END_DECLS
- X
- X#endif /*! _RUNE_H_ */
- END_OF_FILE
- if test 2738 -ne `wc -c <'include/rune.h'`; then
- echo shar: \"'include/rune.h'\" unpacked with wrong size!
- fi
- # end of 'include/rune.h'
- fi
- if test -f 'include/runetype.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'include/runetype.h'\"
- else
- echo shar: Extracting \"'include/runetype.h'\" \(3707 characters\)
- sed "s/^X//" >'include/runetype.h' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993
- X * The Regents of the University of California. All rights reserved.
- X *
- X * This code is derived from software contributed to Berkeley by
- X * Paul Borman at Krystal Technologies.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X *
- X * @(#)runetype.h 8.1 (Berkeley) 6/2/93
- X */
- X
- X#ifndef _RUNETYPE_H_
- X#define _RUNETYPE_H_
- X
- X#include <machine/ansi.h>
- X#include <sys/cdefs.h>
- X
- X#ifdef _BSD_WCHAR_T_
- Xtypedef _BSD_WCHAR_T_ rune_t;
- Xtypedef _BSD_WCHAR_T_ wchar_t;
- X#undef _BSD_WCHAR_T_
- X#endif
- X
- X#define _CACHED_RUNES (1 <<8 ) /* Must be a power of 2 */
- X#define _CRMASK (~(_CACHED_RUNES - 1))
- X
- X/*
- X * The lower 8 bits of runetype[] contain the digit value of the rune.
- X */
- Xtypedef struct {
- X rune_t min; /* First rune of the range */
- X rune_t max; /* Last rune (inclusive) of the range */
- X rune_t map; /* What first maps to in maps */
- X unsigned long *types; /* Array of types in range */
- X} _RuneEntry;
- X
- Xtypedef struct {
- X int nranges; /* Number of ranges stored */
- X _RuneEntry *ranges; /* Pointer to the ranges */
- X} _RuneRange;
- X
- Xtypedef struct {
- X char magic[8]; /* Magic saying what version we are */
- X char encoding[32]; /* ASCII name of this encoding */
- X
- X rune_t (*sgetrune)
- X __P((const char *, unsigned int, char const **));
- X int (*sputrune)
- X __P((rune_t, char *, unsigned int, char **));
- X rune_t invalid_rune;
- X
- X unsigned long runetype[_CACHED_RUNES];
- X rune_t maplower[_CACHED_RUNES];
- X rune_t mapupper[_CACHED_RUNES];
- X
- X /*
- X * The following are to deal with Runes larger than _CACHED_RUNES - 1.
- X * Their data is actually contiguous with this structure so as to make
- X * it easier to read/write from/to disk.
- X */
- X _RuneRange runetype_ext;
- X _RuneRange maplower_ext;
- X _RuneRange mapupper_ext;
- X
- X void *variable; /* Data which depends on the encoding */
- X int variable_len; /* how long that data is */
- X} _RuneLocale;
- X
- X#define _RUNE_MAGIC_1 "RuneMagi" /* Indicates version 0 of RuneLocale */
- X
- Xextern _RuneLocale _DefaultRuneLocale;
- Xextern _RuneLocale *_CurrentRuneLocale;
- X
- X#endif /* !_RUNETYPE_H_ */
- END_OF_FILE
- if test 3707 -ne `wc -c <'include/runetype.h'`; then
- echo shar: \"'include/runetype.h'\" unpacked with wrong size!
- fi
- # end of 'include/runetype.h'
- fi
- if test -f 'include/stddef.changes' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'include/stddef.changes'\"
- else
- echo shar: Extracting \"'include/stddef.changes'\" \(241 characters\)
- sed "s/^X//" >'include/stddef.changes' <<'END_OF_FILE'
- X< #ifdef _WCHAR_T_
- X< typedef _WCHAR_T_ wchar_t;
- X< #undef _WCHAR_T_
- X< #endif
- X
- X> #ifdef _BSD_WCHAR_T_
- X> #ifndef _ANSI_SOURCE
- X> typedef _BSD_WCHAR_T_ rune_t;
- X> #endif
- X> typedef _BSD_WCHAR_T_ wchar_t;
- X> #undef _BSD_WCHAR_T_
- X> #endif
- END_OF_FILE
- if test 241 -ne `wc -c <'include/stddef.changes'`; then
- echo shar: \"'include/stddef.changes'\" unpacked with wrong size!
- fi
- # end of 'include/stddef.changes'
- fi
- if test -f 'include/stdlib.changes' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'include/stdlib.changes'\"
- else
- echo shar: Extracting \"'include/stdlib.changes'\" \(355 characters\)
- sed "s/^X//" >'include/stdlib.changes' <<'END_OF_FILE'
- X< #ifdef _WCHAR_T_
- X< typedef _WCHAR_T_ wchar_t;
- X< #undef _WCHAR_T_
- X< #endif
- X
- X> #ifdef _BSD_WCHAR_T_
- X> #ifndef _ANSI_SOURCE
- X> typedef _BSD_WCHAR_T_ rune_t;
- X> #endif
- X> typedef _BSD_WCHAR_T_ wchar_t;
- X> #undef _BSD_WCHAR_T_
- X> #endif
- X
- X< #define MB_CUR_MAX 1 /* XXX */
- X
- X> extern int __mb_cur_max;
- X> #define MB_CUR_MAX __mb_cur_max
- END_OF_FILE
- if test 355 -ne `wc -c <'include/stdlib.changes'`; then
- echo shar: \"'include/stdlib.changes'\" unpacked with wrong size!
- fi
- # end of 'include/stdlib.changes'
- fi
- if test ! -d 'libc' ; then
- echo shar: Creating directory \"'libc'\"
- mkdir 'libc'
- fi
- if test -f 'libc/ansi.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libc/ansi.c'\"
- else
- echo shar: Extracting \"'libc/ansi.c'\" \(3602 characters\)
- sed "s/^X//" >'libc/ansi.c' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993
- X * The Regents of the University of California. All rights reserved.
- X *
- X * This code is derived from software contributed to Berkeley by
- X * Paul Borman at Krystal Technologies.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#if defined(LIBC_SCCS) && !defined(lint)
- Xstatic char sccsid[] = "@(#)ansi.c 8.1 (Berkeley) 6/27/93";
- X#endif /* LIBC_SCCS and not lint */
- X
- X#include <stdlib.h>
- X#include <limits.h>
- X#include <stddef.h>
- X#include <rune.h>
- X
- Xint
- Xmblen(s, n)
- X const char *s;
- X size_t n;
- X{
- X char const *e;
- X
- X if (s == 0 || *s == 0)
- X return (0); /* No support for state dependent encodings. */
- X
- X if (sgetrune(s, (int)n, &e) == _INVALID_RUNE)
- X return (s - e);
- X return (e - s);
- X}
- X
- Xint
- Xmbtowc(pwc, s, n)
- X wchar_t *pwc;
- X const char *s;
- X size_t n;
- X{
- X char const *e;
- X rune_t r;
- X
- X if (s == 0 || *s == 0)
- X return (0); /* No support for state dependent encodings. */
- X
- X if ((r = sgetrune(s, (int)n, &e)) == _INVALID_RUNE)
- X return (s - e);
- X if (pwc)
- X *pwc = r;
- X return (e - s);
- X}
- X
- Xint
- Xwctomb(s, wchar)
- X char *s;
- X wchar_t wchar;
- X{
- X char *e;
- X
- X if (s == 0)
- X return (0); /* No support for state dependent encodings. */
- X
- X if (wchar == 0) {
- X *s = 0;
- X return (1);
- X }
- X
- X sputrune(wchar, s, MB_CUR_MAX, &e);
- X return (e ? e - s : -1);
- X}
- X
- Xsize_t
- Xmbstowcs(pwcs, s, n)
- X wchar_t *pwcs;
- X const char *s;
- X size_t n;
- X{
- X char const *e;
- X int cnt = 0;
- X
- X if (!pwcs || !s)
- X return (-1);
- X
- X while (n-- > 0) {
- X *pwcs = sgetrune(s, MB_LEN_MAX, &e);
- X if (*pwcs == _INVALID_RUNE)
- X return (-1);
- X if (*pwcs++ == 0)
- X break;
- X s = e;
- X ++cnt;
- X }
- X return (cnt);
- X}
- X
- Xsize_t
- Xwcstombs(s, pwcs, n)
- X char *s;
- X const wchar_t *pwcs;
- X size_t n;
- X{
- X char *e;
- X int cnt = 0;
- X
- X if (!pwcs || !s)
- X return (-1);
- X
- X while (n > 0) {
- X if (*pwcs == 0) {
- X *s = 0;
- X break;
- X }
- X if (!sputrune(*pwcs++, s, (int)n, &e))
- X return (-1); /* encoding error */
- X if (!e) /* too long */
- X return (cnt);
- X cnt += e - s;
- X s = e;
- X }
- X return (cnt);
- X}
- END_OF_FILE
- if test 3602 -ne `wc -c <'libc/ansi.c'`; then
- echo shar: \"'libc/ansi.c'\" unpacked with wrong size!
- fi
- # end of 'libc/ansi.c'
- fi
- if test -f 'libc/frune.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libc/frune.c'\"
- else
- echo shar: Extracting \"'libc/frune.c'\" \(2973 characters\)
- sed "s/^X//" >'libc/frune.c' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993
- X * The Regents of the University of California. All rights reserved.
- X *
- X * This code is derived from software contributed to Berkeley by
- X * Paul Borman at Krystal Technologies.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#if defined(LIBC_SCCS) && !defined(lint)
- Xstatic char sccsid[] = "@(#)frune.c 8.1 (Berkeley) 6/4/93";
- X#endif /* LIBC_SCCS and not lint */
- X
- X#include <limits.h>
- X#include <rune.h>
- X#include <stddef.h>
- X#include <stdio.h>
- X
- Xlong
- Xfgetrune(fp)
- X FILE *fp;
- X{
- X rune_t r;
- X int c, len;
- X char buf[MB_LEN_MAX];
- X char const *result;
- X
- X len = 0;
- X do {
- X if ((c = getc(fp)) == EOF) {
- X if (len)
- X break;
- X return (EOF);
- X }
- X buf[len++] = c;
- X
- X if ((r = sgetrune(buf, len, &result)) != _INVALID_RUNE)
- X return (r);
- X } while (result == buf && len < MB_LEN_MAX);
- X
- X while (--len > 0)
- X ungetc(buf[len], fp);
- X return (_INVALID_RUNE);
- X}
- X
- Xint
- Xfungetrune(r, fp)
- X rune_t r;
- X FILE* fp;
- X{
- X int len;
- X char buf[MB_LEN_MAX];
- X
- X len = sputrune(r, buf, MB_LEN_MAX, 0);
- X while (len-- > 0)
- X if (ungetc(buf[len], fp) == EOF)
- X return (EOF);
- X return (0);
- X}
- X
- Xint
- Xfputrune(r, fp)
- X rune_t r;
- X FILE *fp;
- X{
- X int i, len;
- X char buf[MB_LEN_MAX];
- X
- X len = sputrune(r, buf, MB_LEN_MAX, 0);
- X
- X for (i = 0; i < len; ++i)
- X if (putc(buf[i], fp) == EOF)
- X return (EOF);
- X
- X return (0);
- X}
- END_OF_FILE
- if test 2973 -ne `wc -c <'libc/frune.c'`; then
- echo shar: \"'libc/frune.c'\" unpacked with wrong size!
- fi
- # end of 'libc/frune.c'
- fi
- if test -f 'libc/isctype.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libc/isctype.c'\"
- else
- echo shar: Extracting \"'libc/isctype.c'\" \(3374 characters\)
- sed "s/^X//" >'libc/isctype.c' <<'END_OF_FILE'
- X/*
- X * Copyright (c) 1989, 1993
- X * The Regents of the University of California. All rights reserved.
- X *
- X * This code is derived from software contributed to Berkeley by
- X * Paul Borman at Krystal Technologies.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#if defined(LIBC_SCCS) && !defined(lint)
- Xstatic char sccsid[] = "@(#)isctype.c 8.1 (Berkeley) 6/4/93";
- X#endif /* LIBC_SCCS and not lint */
- X
- X#define _ANSI_LIBRARY
- X#include <ctype.h>
- X
- X#undef isalnum
- Xint
- Xisalnum(c)
- X int c;
- X{
- X return(__istype((c), (_A|_D)));
- X}
- X
- X#undef isalpha
- Xint
- Xisalpha(c)
- X int c;
- X{
- X return (__istype((c), _A));
- X}
- X
- X#undef isascii
- Xint
- Xisascii(c)
- X int c;
- X{
- X return((c & ~0x7F) == 0);
- X}
- X
- X#undef isblank
- Xint
- Xisblank(c)
- X int c;
- X{
- X return (__istype((c), _B));
- X}
- X
- X#undef iscntrl
- Xint
- Xiscntrl(c)
- X int c;
- X{
- X return (__istype((c), _C));
- X}
- X
- X#undef isdigit
- Xint
- Xisdigit(c)
- X int c;
- X{
- X return (__isctype((c), _D));
- X}
- X
- X#undef isgraph
- Xint
- Xisgraph(c)
- X int c;
- X{
- X return (__istype((c), _G));
- X}
- X
- X#undef islower
- Xint
- Xislower(c)
- X int c;
- X{
- X return (__istype((c), _L));
- X}
- X
- X#undef isprint
- Xint
- Xisprint(c)
- X int c;
- X{
- X return (__istype((c), _R));
- X}
- X
- X#undef ispunct
- Xint
- Xispunct(c)
- X int c;
- X{
- X return (__istype((c), _P));
- X}
- X
- X#undef isspace
- Xint
- Xisspace(c)
- X int c;
- X{
- X return (__istype((c), _S));
- X}
- X
- X#undef isupper
- Xint
- Xisupper(c)
- X int c;
- X{
- X return (__istype((c), _U));
- X}
- X
- X#undef isxdigit
- Xint
- Xisxdigit(c)
- X int c;
- X{
- X return (__isctype((c), _X));
- X}
- X
- X#undef toascii
- Xint
- Xtoascii(c)
- X int c;
- X{
- X return (c & 0177);
- X}
- X
- X#undef tolower
- Xint
- Xtolower(c)
- X int c;
- X{
- X return((c & _CRMASK) ? ___toupper(c) : _CurrentRuneLocale->mapupper[c]);
- X}
- X
- X#undef toupper
- Xint
- Xtoupper(c)
- X int c;
- X{
- X return((c & _CRMASK) ? ___tolower(c) : _CurrentRuneLocale->maplower[c]);
- X}
- END_OF_FILE
- if test 3374 -ne `wc -c <'libc/isctype.c'`; then
- echo shar: \"'libc/isctype.c'\" unpacked with wrong size!
- fi
- # end of 'libc/isctype.c'
- fi
- if test -f 'libc/mbrune.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libc/mbrune.c'\"
- else
- echo shar: Extracting \"'libc/mbrune.c'\" \(3351 characters\)
- sed "s/^X//" >'libc/mbrune.c' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993
- X * The Regents of the University of California. All rights reserved.
- X *
- X * This code is derived from software contributed to Berkeley by
- X * Paul Borman at Krystal Technologies.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#if defined(LIBC_SCCS) && !defined(lint)
- Xstatic char sccsid[] = "@(#)mbrune.c 8.1 (Berkeley) 6/27/93";
- X#endif /* LIBC_SCCS and not lint */
- X
- X#include <limits.h>
- X#include <rune.h>
- X#include <stddef.h>
- X#include <string.h>
- X
- Xchar *
- Xmbrune(string, c)
- X const char *string;
- X rune_t c;
- X{
- X char const *result;
- X rune_t r;
- X
- X while ((r = sgetrune(string, MB_LEN_MAX, &result))) {
- X if (r == c)
- X return ((char *)string);
- X string = result == string ? string + 1 : result;
- X }
- X
- X return (c == *string ? (char *)string : NULL);
- X}
- X
- Xchar *
- Xmbrrune(string, c)
- X const char *string;
- X rune_t c;
- X{
- X const char *last = 0;
- X char const *result;
- X rune_t r;
- X
- X while ((r = sgetrune(string, MB_LEN_MAX, &result))) {
- X if (r == c)
- X last = string;
- X string = result == string ? string + 1 : result;
- X }
- X return (c == *string ? (char *)string : (char *)last);
- X}
- X
- Xchar *
- Xmbmb(string, pattern)
- X const char *string;
- X char *pattern;
- X{
- X rune_t first, r;
- X size_t plen, slen;
- X char const *result;
- X
- X plen = strlen(pattern);
- X slen = strlen(string);
- X if (plen > slen)
- X return (0);
- X
- X first = sgetrune(pattern, plen, &result);
- X if (result == string)
- X return (0);
- X
- X while (slen >= plen && (r = sgetrune(string, slen, &result))) {
- X if (r == first) {
- X if (strncmp(string, pattern, slen) == 0)
- X return ((char *) string);
- X }
- X if (result == string) {
- X --slen;
- X ++string;
- X } else {
- X slen -= result - string;
- X string = result;
- X }
- X }
- X return (0);
- X}
- END_OF_FILE
- if test 3351 -ne `wc -c <'libc/mbrune.c'`; then
- echo shar: \"'libc/mbrune.c'\" unpacked with wrong size!
- fi
- # end of 'libc/mbrune.c'
- fi
- if test -f 'libc/none.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libc/none.c'\"
- else
- echo shar: Extracting \"'libc/none.c'\" \(2937 characters\)
- sed "s/^X//" >'libc/none.c' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993
- X * The Regents of the University of California. All rights reserved.
- X *
- X * This code is derived from software contributed to Berkeley by
- X * Paul Borman at Krystal Technologies.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#if defined(LIBC_SCCS) && !defined(lint)
- Xstatic char sccsid[] = "@(#)none.c 8.1 (Berkeley) 6/4/93";
- X#endif /* LIBC_SCCS and not lint */
- X
- X#include <stddef.h>
- X#include <stdio.h>
- X#include <rune.h>
- X#include <errno.h>
- X#include <stdlib.h>
- X
- Xrune_t _none_sgetrune __P((const char *, size_t, char const **));
- Xint _none_sputrune __P((rune_t, char *, size_t, char **));
- X
- Xint
- X_none_init(rl)
- X _RuneLocale *rl;
- X{
- X rl->sgetrune = _none_sgetrune;
- X rl->sputrune = _none_sputrune;
- X _CurrentRuneLocale = rl;
- X __mb_cur_max = 1;
- X return(0);
- X}
- X
- Xrune_t
- X_none_sgetrune(string, n, result)
- X const char *string;
- X size_t n;
- X char const **result;
- X{
- X int c;
- X
- X if (n < 1) {
- X if (result)
- X *result = string;
- X return(_INVALID_RUNE);
- X }
- X if (result)
- X *result = string + 1;
- X return(*string & 0xff);
- X}
- X
- Xint
- X_none_sputrune(c, string, n, result)
- X rune_t c;
- X char *string, **result;
- X size_t n;
- X{
- X if (n >= 1) {
- X if (string)
- X *string = c;
- X if (result)
- X *result = string + 1;
- X } else if (result)
- X *result = (char *)0;
- X return(1);
- X}
- END_OF_FILE
- if test 2937 -ne `wc -c <'libc/none.c'`; then
- echo shar: \"'libc/none.c'\" unpacked with wrong size!
- fi
- # end of 'libc/none.c'
- fi
- if test -f 'libc/utf2.c' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'libc/utf2.c'\"
- else
- echo shar: Extracting \"'libc/utf2.c'\" \(4147 characters\)
- sed "s/^X//" >'libc/utf2.c' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993
- X * The Regents of the University of California. All rights reserved.
- X *
- X * This code is derived from software contributed to Berkeley by
- X * Paul Borman at Krystal Technologies.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X */
- X
- X#if defined(LIBC_SCCS) && !defined(lint)
- Xstatic char sccsid[] = "@(#)utf2.c 8.1 (Berkeley) 6/4/93";
- X#endif /* LIBC_SCCS and not lint */
- X
- X#include <errno.h>
- X#include <rune.h>
- X#include <stddef.h>
- X#include <stdio.h>
- X#include <stdlib.h>
- X
- Xrune_t _UTF2_sgetrune __P((const char *, size_t, char const **));
- Xint _UTF2_sputrune __P((rune_t, char *, size_t, char **));
- X
- Xstatic _utf_count[16] = {
- X 1, 1, 1, 1, 1, 1, 1, 1,
- X 0, 0, 0, 0, 2, 2, 3, 0,
- X};
- X
- Xint
- X_UTF2_init(rl)
- X _RuneLocale *rl;
- X{
- X rl->sgetrune = _UTF2_sgetrune;
- X rl->sputrune = _UTF2_sputrune;
- X _CurrentRuneLocale = rl;
- X __mb_cur_max = 3;
- X return (0);
- X}
- X
- Xrune_t
- X_UTF2_sgetrune(string, n, result)
- X const char *string;
- X size_t n;
- X char const **result;
- X{
- X int c;
- X
- X if (n < 1 || (c = _utf_count[(*string >> 4) & 0xf]) > n) {
- X if (result)
- X *result = string;
- X return (_INVALID_RUNE);
- X }
- X switch (c) {
- X case 1:
- X if (result)
- X *result = string + 1;
- X return (*string & 0xff);
- X case 2:
- X if ((string[1] & 0xC0) != 0x80)
- X goto encoding_error;
- X if (result)
- X *result = string + 2;
- X return (((string[0] & 0x1F) << 6) | (string[1] & 0x3F));
- X case 3:
- X if ((string[1] & 0xC0) != 0x80 || (string[2] & 0xC0) != 0x80)
- X goto encoding_error;
- X if (result)
- X *result = string + 3;
- X return (((string[0] & 0x1F) << 12) | ((string[1] & 0x3F) << 6)
- X | (string[2] & 0x3F));
- X default:
- Xencoding_error: if (result)
- X *result = string + 1;
- X return (_INVALID_RUNE);
- X }
- X}
- X
- Xint
- X_UTF2_sputrune(c, string, n, result)
- X rune_t c;
- X char *string, **result;
- X size_t n;
- X{
- X if (c & 0xF800) {
- X if (n >= 3) {
- X if (string) {
- X string[0] = 0xE0 | ((c >> 12) & 0x0F);
- X string[1] = 0x80 | ((c >> 6) & 0x3F);
- X string[2] = 0x80 | ((c) & 0x3F);
- X }
- X if (result)
- X *result = string + 3;
- X } else
- X if (result)
- X *result = NULL;
- X
- X return (3);
- X } else
- X if (c & 0x0780) {
- X if (n >= 2) {
- X if (string) {
- X string[0] = 0xC0 | ((c >> 6) & 0x1F);
- X string[1] = 0x80 | ((c) & 0x3F);
- X }
- X if (result)
- X *result = string + 2;
- X } else
- X if (result)
- X *result = NULL;
- X return (2);
- X } else {
- X if (n >= 1) {
- X if (string)
- X string[0] = c;
- X if (result)
- X *result = string + 1;
- X } else
- X if (result)
- X *result = NULL;
- X return (1);
- X }
- X}
- END_OF_FILE
- if test 4147 -ne `wc -c <'libc/utf2.c'`; then
- echo shar: \"'libc/utf2.c'\" unpacked with wrong size!
- fi
- # end of 'libc/utf2.c'
- fi
- if test ! -d 'mklocale' ; then
- echo shar: Creating directory \"'mklocale'\"
- mkdir 'mklocale'
- fi
- if test -f 'mklocale/Japanese' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mklocale/Japanese'\"
- else
- echo shar: Extracting \"'mklocale/Japanese'\" \(3873 characters\)
- sed "s/^X//" >'mklocale/Japanese' <<'END_OF_FILE'
- X# @(#)Japanese 8.1 (Berkeley) 6/6/93
- X
- X/*
- X * Japanese LOCALE_CTYPE definitions using EUC of JIS character sets
- X */
- X
- XENCODING "EUC"
- X
- X/* JIS JIS JIS */
- X/* X201 X208 X201 */
- X/* 00-7f 84-fe */
- X
- XVARIABLE 1 0x0000 2 0x8080 2 0x0080 3 0x8000 0x8080
- X
- X/*
- X * Code Set 1
- X */
- XALPHA 'A' - 'Z' 'a' - 'z'
- XCONTROL 0x00 - 0x1f 0x7f
- XDIGIT '0' - '9'
- XGRAPH 0x21 - 0x7e
- XLOWER 'a' - 'z'
- XPUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e
- XSPACE 0x09 - 0x0d 0x20
- XUPPER 'A' - 'Z'
- XXDIGIT 'a' - 'f' 'A' - 'F'
- XBLANK ' ' '\t'
- XPRINT 0x20 - 0x7e
- X
- XMAPLOWER < 'A' - 'Z' : 'a' >
- XMAPLOWER < 'a' - 'z' : 'a' >
- XMAPUPPER < 'A' - 'Z' : 'A' >
- XMAPUPPER < 'a' - 'z' : 'A' >
- XTODIGIT < '0' - '9' : 0 >
- XTODIGIT < 'A' - 'F' : 10 >
- XTODIGIT < 'a' - 'f' : 10 >
- X
- X/*
- X * Code Set 2
- X */
- X
- XSPACE 0xa1a1
- XPHONOGRAM 0xa1bc
- XSPECIAL 0xa1a2 - 0xa1fe
- XPUNCT 0xa1a2 - 0xa1f8 /* A few too many in here... */
- X
- XSPECIAL 0xa2a1 - 0xa2ae 0xa2ba - 0xa2c1 0xa2ca - 0xa2d0 0xa2dc - 0xa2ea
- XSPECIAL 0xa2f2 - 0xa2f9 0xa2fe
- X
- XDIGIT 0xa3b0 - 0xa3b9
- XUPPER 0xa3c1 - 0xa3da /* Romaji */
- XLOWER 0xa3e1 - 0xa3fa /* Romaji */
- XMAPLOWER < 0xa3c1 - 0xa3da : 0xa3e1 > /* English */
- XMAPLOWER < 0xa3e1 - 0xa3fa : 0xa3e1 > /* English */
- XMAPUPPER < 0xa3c1 - 0xa3da : 0xa3c1 >
- XMAPUPPER < 0xa3e1 - 0xa3fa : 0xa3c1 >
- X
- XXDIGIT 0xa3c1 - 0xa3c6 0xa3e1 - 0xa3e6
- X
- XTODIGIT < 0xa3b0 - 0xa3b9 : 0 >
- XTODIGIT < 0xa3c1 - 0xa3c6 : 10 >
- XTODIGIT < 0xa3e1 - 0xa3e6 : 10 >
- X
- XPHONOGRAM 0xa4a1 - 0xa4f3
- XPHONOGRAM 0xa5a1 - 0xa5f6
- X
- XUPPER 0xa6a1 - 0xa6b8 /* Greek */
- XLOWER 0xa6c1 - 0xa6d8 /* Greek */
- XMAPLOWER < 0xa6a1 - 0xa6b8 : 0xa6c1 >
- XMAPLOWER < 0xa6c1 - 0xa6d8 : 0xa6c1 >
- XMAPUPPER < 0xa6a1 - 0xa6b8 : 0xa6a1 >
- XMAPUPPER < 0xa6c1 - 0xa6d8 : 0xa6a1 >
- X
- XUPPER 0xa7a1 - 0xa7c1 /* Cyrillic */
- XLOWER 0xa7d1 - 0xa7f1 /* Cyrillic */
- XMAPLOWER < 0xa7a1 - 0xa7c1 : 0xa7d1 >
- XMAPLOWER < 0xa7d1 - 0xa7f1 : 0xa7d1 >
- XMAPUPPER < 0xa7a1 - 0xa7c1 : 0xa7a1 >
- XMAPUPPER < 0xa7d1 - 0xa7f1 : 0xa7a1 >
- X
- XSPECIAL 0xa8a1 - 0xa8c0
- X
- XIDEOGRAM 0xb0a1 - 0xb0fe
- XIDEOGRAM 0xb1a1 - 0xb1fe
- XIDEOGRAM 0xb2a1 - 0xb2fe
- XIDEOGRAM 0xb3a1 - 0xb3fe
- XIDEOGRAM 0xb4a1 - 0xb4fe
- XIDEOGRAM 0xb5a1 - 0xb5fe
- XIDEOGRAM 0xb6a1 - 0xb6fe
- XIDEOGRAM 0xb7a1 - 0xb7fe
- XIDEOGRAM 0xb8a1 - 0xb8fe
- XIDEOGRAM 0xb9a1 - 0xb9fe
- XIDEOGRAM 0xbaa1 - 0xbafe
- XIDEOGRAM 0xbba1 - 0xbbfe
- XIDEOGRAM 0xbca1 - 0xbcfe
- XIDEOGRAM 0xbda1 - 0xbdfe
- XIDEOGRAM 0xbea1 - 0xbefe
- XIDEOGRAM 0xbfa1 - 0xbffe
- XIDEOGRAM 0xc0a1 - 0xc0fe
- XIDEOGRAM 0xc1a1 - 0xc1fe
- XIDEOGRAM 0xc2a1 - 0xc2fe
- XIDEOGRAM 0xc3a1 - 0xc3fe
- XIDEOGRAM 0xc4a1 - 0xc4fe
- XIDEOGRAM 0xc5a1 - 0xc5fe
- XIDEOGRAM 0xc6a1 - 0xc6fe
- XIDEOGRAM 0xc7a1 - 0xc7fe
- XIDEOGRAM 0xc8a1 - 0xc8fe
- XIDEOGRAM 0xc9a1 - 0xc9fe
- XIDEOGRAM 0xcaa1 - 0xcafe
- XIDEOGRAM 0xcba1 - 0xcbfe
- XIDEOGRAM 0xcca1 - 0xccfe
- XIDEOGRAM 0xcda1 - 0xcdfe
- XIDEOGRAM 0xcea1 - 0xcefe
- XIDEOGRAM 0xcfa1 - 0xcfd3
- XIDEOGRAM 0xd0a1 - 0xd0fe
- XIDEOGRAM 0xd1a1 - 0xd1fe
- XIDEOGRAM 0xd2a1 - 0xd2fe
- XIDEOGRAM 0xd3a1 - 0xd3fe
- XIDEOGRAM 0xd4a1 - 0xd4fe
- XIDEOGRAM 0xd5a1 - 0xd5fe
- XIDEOGRAM 0xd6a1 - 0xd6fe
- XIDEOGRAM 0xd7a1 - 0xd7fe
- XIDEOGRAM 0xd8a1 - 0xd8fe
- XIDEOGRAM 0xd9a1 - 0xd9fe
- XIDEOGRAM 0xdaa1 - 0xdafe
- XIDEOGRAM 0xdba1 - 0xdbfe
- XIDEOGRAM 0xdca1 - 0xdcfe
- XIDEOGRAM 0xdda1 - 0xddfe
- XIDEOGRAM 0xdea1 - 0xdefe
- XIDEOGRAM 0xdfa1 - 0xdffe
- XIDEOGRAM 0xe0a1 - 0xe0fe
- XIDEOGRAM 0xe1a1 - 0xe1fe
- XIDEOGRAM 0xe2a1 - 0xe2fe
- XIDEOGRAM 0xe3a1 - 0xe3fe
- XIDEOGRAM 0xe4a1 - 0xe4fe
- XIDEOGRAM 0xe5a1 - 0xe5fe
- XIDEOGRAM 0xe6a1 - 0xe6fe
- XIDEOGRAM 0xe7a1 - 0xe7fe
- XIDEOGRAM 0xe8a1 - 0xe8fe
- XIDEOGRAM 0xe9a1 - 0xe9fe
- XIDEOGRAM 0xeaa1 - 0xeafe
- XIDEOGRAM 0xeba1 - 0xebfe
- XIDEOGRAM 0xeca1 - 0xecfe
- XIDEOGRAM 0xeda1 - 0xedfe
- XIDEOGRAM 0xeea1 - 0xeefe
- XIDEOGRAM 0xefa1 - 0xeffe
- XIDEOGRAM 0xf0a1 - 0xf0fe
- XIDEOGRAM 0xf1a1 - 0xf1fe
- XIDEOGRAM 0xf2a1 - 0xf2fe
- XIDEOGRAM 0xf3a1 - 0xf3fe
- XIDEOGRAM 0xf4a1 - 0xf4a4
- X
- X/*
- X * This is for Code Set 3, half-width kana
- X */
- XSPECIAL 0xa1 - 0xdf
- XPHONOGRAM 0xa1 - 0xdf
- XCONTROL 0x84 - 0x97 0x9b - 0x9f 0xe0 - 0xfe
- END_OF_FILE
- if test 3873 -ne `wc -c <'mklocale/Japanese'`; then
- echo shar: \"'mklocale/Japanese'\" unpacked with wrong size!
- fi
- # end of 'mklocale/Japanese'
- fi
- if test -f 'mklocale/Makefile' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mklocale/Makefile'\"
- else
- echo shar: Extracting \"'mklocale/Makefile'\" \(141 characters\)
- sed "s/^X//" >'mklocale/Makefile' <<'END_OF_FILE'
- X# @(#)Makefile 8.1 (Berkeley) 6/7/93
- X
- XPROG= mklocale
- XSRCS= yacc.c lex.c
- XCFLAGS+=-I.
- XCLEANFILES+=y.tab.h yacc.c lex.c
- X
- X.include <bsd.prog.mk>
- END_OF_FILE
- if test 141 -ne `wc -c <'mklocale/Makefile'`; then
- echo shar: \"'mklocale/Makefile'\" unpacked with wrong size!
- fi
- # end of 'mklocale/Makefile'
- fi
- if test -f 'mklocale/POSIX' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mklocale/POSIX'\"
- else
- echo shar: Extracting \"'mklocale/POSIX'\" \(728 characters\)
- sed "s/^X//" >'mklocale/POSIX' <<'END_OF_FILE'
- X# @(#)POSIX 8.1 (Berkeley) 6/6/93
- X
- X/*
- X * Standard LOCALE_CTYPE for the C Locale
- X */
- XENCODING "UTF2"
- XVARIABLE A comment line or data line. Only 1 allowed. Copied verbatim.
- X
- X#
- X# This is a comment
- X#
- XALPHA 'A' - 'Z' 'a' - 'z'
- XCONTROL 0x00 - 0x1f 0x7f
- XDIGIT '0' - '9'
- XGRAPH 0x21 - 0x7e
- XLOWER 'a' - 'z'
- XPUNCT 0x21 - 0x2f 0x3a - 0x40 0x5b - 0x60 0x7b - 0x7e
- XSPACE 0x09 - 0x0d 0x20
- XUPPER 'A' - 'Z'
- XXDIGIT 'a' - 'f' 'A' - 'F'
- XBLANK ' ' '\t'
- XPRINT 0x20 - 0x7e
- X# IDEOGRAM
- X# SPECIAL
- X# PHONEGRAM
- X
- XMAPLOWER <'A' - 'Z' : 'a'>
- XMAPLOWER <'a' - 'z' : 'a'>
- XMAPUPPER <'A' - 'Z' : 'A'>
- XMAPUPPER <'a' - 'z' : 'A'>
- XTODIGIT <'0' - '9' : 0>
- XTODIGIT <'A' - 'F' : 10>
- XTODIGIT <'a' - 'f' : 10>
- END_OF_FILE
- if test 728 -ne `wc -c <'mklocale/POSIX'`; then
- echo shar: \"'mklocale/POSIX'\" unpacked with wrong size!
- fi
- # end of 'mklocale/POSIX'
- fi
- if test -f 'mklocale/ldef.h' -a "${1}" != "-c" ; then
- echo shar: Will not clobber existing file \"'mklocale/ldef.h'\"
- else
- echo shar: Extracting \"'mklocale/ldef.h'\" \(2259 characters\)
- sed "s/^X//" >'mklocale/ldef.h' <<'END_OF_FILE'
- X/*-
- X * Copyright (c) 1993
- X * The Regents of the University of California. All rights reserved.
- X *
- X * This code is derived from software contributed to Berkeley by
- X * Paul Borman at Krystal Technologies.
- X *
- X * Redistribution and use in source and binary forms, with or without
- X * modification, are permitted provided that the following conditions
- X * are met:
- X * 1. Redistributions of source code must retain the above copyright
- X * notice, this list of conditions and the following disclaimer.
- X * 2. Redistributions in binary form must reproduce the above copyright
- X * notice, this list of conditions and the following disclaimer in the
- X * documentation and/or other materials provided with the distribution.
- X * 3. All advertising materials mentioning features or use of this software
- X * must display the following acknowledgement:
- X * This product includes software developed by the University of
- X * California, Berkeley and its contributors.
- X * 4. Neither the name of the University nor the names of its contributors
- X * may be used to endorse or promote products derived from this software
- X * without specific prior written permission.
- X *
- X * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- X * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- X * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- X * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- X * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- X * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- X * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- X * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- X * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- X * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- X * SUCH DAMAGE.
- X *
- X * @(#)ldef.h 8.1 (Berkeley) 6/6/93
- X */
- X
- X/*
- X * This should look a LOT like a _RuneEntry
- X */
- Xtypedef struct rune_list {
- X rune_t min;
- X rune_t max;
- X rune_t map;
- X u_long *types;
- X struct rune_list *next;
- X} rune_list;
- X
- Xtypedef struct rune_map {
- X u_long map[_CACHED_RUNES];
- X rune_list *root;
- X} rune_map;
- END_OF_FILE
- if test 2259 -ne `wc -c <'mklocale/ldef.h'`; then
- echo shar: \"'mklocale/ldef.h'\" unpacked with wrong size!
- fi
- # end of 'mklocale/ldef.h'
- fi
- echo shar: End of archive 1 \(of 3\).
- cp /dev/null ark1isdone
- MISSING=""
- for I in 1 2 3 ; do
- if test ! -f ark${I}isdone ; then
- MISSING="${MISSING} ${I}"
- fi
- done
- if test "${MISSING}" = "" ; then
- echo You have unpacked all 3 archives.
- rm -f ark[1-9]isdone
- else
- echo You still need to unpack the following archives:
- echo " " ${MISSING}
- fi
- ## End of shell archive.
- exit 0
-