From kido@vnet.ibm.com Wed Oct 7 07:42:32 1992 Received: from vnet.ibm.com by dkuug.dk via EUnet with SMTP (5.64+/8+bit/IDA-1.2.8) id AA20755; Wed, 7 Oct 92 07:42:32 +0100 Message-Id: <9210070642.AA20755@dkuug.dk> Received: from YMTVM8 by vnet.ibm.com (IBM VM SMTP V2R2) with BSMTP id 4991; Wed, 07 Oct 92 02:44:58 EDT Date: Wed, 7 Oct 92 15:39:32 JST From: "Akio Kido" To: sc22wg20@dkuug.dk, sc22wg15@dkuug.dk, sig-international@osf.org Subject: mse.trf.1 X-Charset: ASCII X-Char-Esc: 29 #! /bin/sh # # This is shell archive. # Remove anything before this line, then unpack this # file by saveing it into a $file and typing # "sh $file". # # Contents: # -rw-rw-rw- chap0.mm # -rw-rw-rw- chap1.mm # -rw-rw-rw- chap2.mm # -rw-rw-rw- chap3.mm # -rw-rw-rw- chap9.mm # -rw-rw-rw- makefile # -rw-rw-rw- annexa.mm # sed "s/^X//" > chap0.mm << 'EOF' X.de nm X.. X'\" .de mc X'\" .. X.de rm X.. X.rm nm \" NO LINENUMBERS X'\" .rm mc \" NO MARGIN CHARACTERS X.S 10 14 X.PH "" X.OH "'\s10SC22/WG14/N205R 1992-10-06''[to be \s-1ISO/IEC\s+1 9899 : 1990/Amendment 3 : 1993 (E)]\s0'" X.EH "'\s10[to be \s-1ISO/IEC\s+1 9899 : 1990/Amendment 3 : 1993 (E)]''SC22/WG14/N205R 1992-10-06'\s0" X.ds HF 3 3 3 3 3 X.ds HP 12 12 11 10 10 X.nr Cl 3 X.nr Ej 0 X.nr Hb 5 X.nr Hs 5 X.nr Hu 5 X.nr Pt 0 X.nr nU \w'00000'u X.ig \" NO LINENUMBERS X! .ev 1 X! .ll +\n(nUu X! .lt +\n(nUu X! .ev X! .ev 2 X! .ll +\n(nUu X! .lt +\n(nUu X! .ev X.. X.ig X% .de sH X% .ds hS \\$1 X% '\".PH "'Proposed C Extension'%'\\$1'" X% .PH "" X% .OH "'''[\s-1ISO\s+1 9899 : 1990/Add.3 : 1991 (E)]'" X% .EH "'[\s-1ISO\s+1 9899 : 1990/Add.3 : 1991 (E)]'''" X% .nr H1 \\$2-1 X% X% .H 1 "\\$1" X% .ds f1 \\*(f2 \" ignore any previous carryover X% .nr Ej 1 \" Don't paginate the immediately following .pH X% .. X.. X.ig X% .de pH X% \& \" Force new page if .Cb precedes X% '\".PH "'\\*(hS'%'\\$1'" X% .PH "" X% .OH "'''[\s-1ISO\s+1 9899 : 1990/Add.3 : 1991 (E)]'" X% .EH "'[\s-1ISO\s+1 9899 : 1990/Add.3 : 1991 (E)]'''" X% X% .H 2 "\\$1" X% .if \\n(Ej=2 .ds f1 \\*(f2 \" ignore any previous carryover X% .nr Ej 2 \" Paginate following .pH's X% .. X.. X.de rF X.nr Hb 4 X.nr Hs 4 X.HU "\f3Forward References:\fP" X.nr Hb 5 X.nr Hs 5 X.. X.de HX X.if \\n(Hs>4 .nr ;3 (6-\\$1)*3v \" Force header to new page if not enough space X.nr f0 \\n% \" note current page number for footer correction X.nm X.. X.de HY X.nm +0 X.. X.de HZ \" note header changes for page footers X.if \\$1=\\$2 .ds f2 \(sc\\*(}0 X.if \\n(f0<\\n% .ds f1 \\*(f2 \" .HX forced new page; reset f1 X.. X'\".OF "'\\\\*(f1'\\\\*(DT'\\\\*(f2'" X'\".EF "'\\\\*(f1'\\\\*(DT'\\\\*(f2'" X.OF "'SC22/WG14/N205R : 1992-10-06''%'" X.EF "'%''SC22/WG14/N205R : 1992-10-06'" X.rn FS fS \" change FS to fS X.de FS \" new front-end for FS X.fS \\$1 X.ll \nWu+\n(nUu X.ps 9 X.. X.FD 8 \" Footnotes: no hyphenate, adjust, indent, label right X.SA 1 X'\" print-device specific tweaks X.ds | | X.ds ~ ~ X.ds ' ' X.if t .ds Cw \&\fB X.if n .ds Cw \fB X.if t .if '\*(.T'JROpost' \{\ X. fp 5 CB X. ds Cw \&\f(CB X. ds BU \s+1\(bu\s-1 \} X.if t .if '\*(.T'ps' \{\ X. fp 5 CW X. ds Cw \&\f(CW X. ds BU \s+1\(bu\s-1 \} X.if t .if '\*(.T'post' \{\ X. fp 1 H X. fp 2 HI X. fp 3 HB X. fp 5 CW X. ds Cw \&\f(CW X. ds BU \s+1\(bu\s-1 \} X.if t .if '\*(.T'i300' \{\ X. ds ~ \s-4\v'-.25m'\z\(ap\h'1u'\z\(ap\h'1u'\z\(ap\v'+.25m'\s+4\ \h'-2u' X. ds ' \fB\|\(fm\|\fP \} X.if n .tr \(scS X.if t .ds ex expression X.if n .ds ex expr X.if t .ds id identifier X.if n .ds id ident X.if t .ds op \\d\\s-1opt\\s+1\\u X.if n .ds op -opt X.if t .ds pi \(*p X.if n .ds pi \fIpi\fR X.de Cb \" Begin constant width font display X.if t .ta .5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i X.if n .ta 8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n X.DS \\$1 \\$2 \\$3 X.if t .ta .5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i X.if n .ta 8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n X\*(Cw\\c X.. X.de Ce \" End constant width font display X.ft R X.if t .ta .5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i X.if n .ta 8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n X.DE X.if t .ta .5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i X.if n .ta 8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n X.. X.de Fb \" Begin constant width font display in footnote X.if t .ta .5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i X.if n .ta 8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n X.sp .2v X\*(Cw\\c X.nf X.. X.de Fe \" End constant width font display in footnote X.if t .ta .5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i +.5i X.if n .ta 8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n +8n X.ft R X.sp .5v X.fi X.. X.de Cf \" Place every other arg in Cw font, beginning with first X.if \\n(.$=1 \&\*(Cw\\$1\fP X.if \\n(.$=2 \&\*(Cw\\$1\fP\\$2 X.if \\n(.$=3 \&\*(Cw\\$1\fP\\$2\*(Cw\\$3\fP X.if \\n(.$=4 \&\*(Cw\\$1\fP\\$2\*(Cw\\$3\fP\\$4 X.if \\n(.$=5 \&\*(Cw\\$1\fP\\$2\*(Cw\\$3\fP\\$4\*(Cw\\$5\fP X.if \\n(.$=6 \&\*(Cw\\$1\fP\\$2\*(Cw\\$3\fP\\$4\*(Cw\\$5\fP\\$6 X.if \\n(.$=7 \&\*(Cw\\$1\fP\\$2\*(Cw\\$3\fP\\$4\*(Cw\\$5\fP\\$6\*(Cw\\$7\fP X.if \\n(.$=8 \&\*(Cw\\$1\fP\\$2\*(Cw\\$3\fP\\$4\*(Cw\\$5\fP\\$6\*(Cw\\$7\fP\\$8 X.if \\n(.$=9 \&\*(Cw\\$1\fP\\$2\*(Cw\\$3\fP\\$4\*(Cw\\$5\fP\\$6\*(Cw\\$7\fP\\$8\*(Cw X.. X.de Cs \" Place every other arg in Cw font, beginning with second X.if \\n(.$=1 \&\\$1 X.if \\n(.$=2 \&\\$1\*(Cw\\$2\fP X.if \\n(.$=3 \&\\$1\*(Cw\\$2\fP\\$3 X.if \\n(.$=4 \&\\$1\*(Cw\\$2\fP\\$3\*(Cw\\$4\fP X.if \\n(.$=5 \&\\$1\*(Cw\\$2\fP\\$3\*(Cw\\$4\fP\\$5 X.if \\n(.$=6 \&\\$1\*(Cw\\$2\fP\\$3\*(Cw\\$4\fP\\$5\*(Cw\\$6\fP X.if \\n(.$=7 \&\\$1\*(Cw\\$2\fP\\$3\*(Cw\\$4\fP\\$5\*(Cw\\$6\fP\\$7 X.if \\n(.$=8 \&\\$1\*(Cw\\$2\fP\\$3\*(Cw\\$4\fP\\$5\*(Cw\\$6\fP\\$7\*(Cw\\$8\fP X.if \\n(.$=9 \&\\$1\*(Cw\\$2\fP\\$3\*(Cw\\$4\fP\\$5\*(Cw\\$6\fP\\$7\*(Cw\\$8\fP\\$9 X.. X.ig X.ds lE \(sc3.1 X.ds cO \(sc3.2 X.ds eX \(sc3.3 X.ds cE \(sc3.4 X.ds dE \(sc3.5 X.ds sT \(sc3.6 X.ds eD \(sc3.7 X.ds pR \(sc3.8 X.ds fU \(sc3.9 X.. X.ds AC "\s-1ANSI C\s+1 X.ds AC "\s-1ISO/IEC\s+1\^\^9899\^:\^1990 X.ds XJ \s-1X\s+1\&3\s-1J\s+1\&11 X.ds WG \s-1JTC\s+1\&1\s-1/SC\s+1\&22\s-1/WG\s+1\&14 X.ds WC \*(Cwwchar_t\fP X.ds Mv "\fR(This part will be removed or moved to rationale of this draft.)\fP X.ds Ra "Rationale \*(Mv X.ds WI wcret_t X.ds WI wint_t X.PF "''printed : 1992-10-06''" X.ND "October 6, 1992" X.DS X.ft 3 X.S 16 18 XInformation Processing \(em Programming Language C \(em X.SP X.ft XAMENDMENT 3 XMultibyte Support Extensions X.DE X.S X.ig X~~.TL X~~Draft Proposed Multibyte Support Extensions of \*(AC X~~.AF "" 1 X~~.AU X~~.AS 1 X~~.S 10 X~~.P X~~(This abstract is not a part of the Multibyte Support Extension for \*(AC.) X~~.P X~~This proposal specifies a conservative extension for X~~'\"\*(AC (American National Standard for Information Systems \(em X~~'\"Programming Language C) to support multibyte character processing. X~~\*(AC (Information Processing \(em X~~Programming Language C \(em) to support multibyte character processing. X~~Its purpose is to promote portability of \*(AC X~~language programs which process not only single byte characters but also X~~multibyte characters. X~~It is remarkable that the \*(AC language programs which use the interface X~~defined in this extension could be portable among both in the single byte X~~character environments and the multibyte character environments. X~~.P X~~Sections are included that detail the concept of multibyte characters, X~~\*(WC type object, their relationship, and the contents of the X~~C language execution library. X~~.P X~~While it is an extension of \*(AC, X~~this document is designed to be self-contained. X~~.AE X~~.MT 4 X.. X.de TP X'sp 3 X'tl \\*(}t X.if e 'tl \\*(}e X.if o 'tl \\*(}o X'sp 2 X.nm 1 5 2 X.. X.de PX X.ds f1 \\*(f2 X.. X.nm 1 5 2 X.de aH X.bp X.ds hS \\$1 X.nr H1 \\$2 X.ce 2 X\\fB\\s14Annex \\n(H1\\s0\\fP X\fR\\s14(informative)\\s0 X.sp -.85 X.nr H1 \\$2-1 X.nr Ej 0 X.nr Cl 0 X.nr Hu 1 X.nr Hc 1 X.HU "\\$1" X.nr Hc 0 X.nr Hu 5 X.nr Cl 2 X.ds f1 \\*(f2 X.ds }0 \\n(H1\ \ X.)E 1 "\\$1" \" add it to table of contents as if by .H 1 "\\$1" X.sp 1 X.. EOF chmod 666 chap0.mm sed "s/^X//" > chap1.mm << 'EOF' X'\".sH "INTRODUCTION" 1 X'\".H 2 "PURPOSE" X'\".H 1 "PURPOSE" X.H 1 "Scope" X.P X.mc | XThis amendment defines the multibyte support extension of \*(AC X.mc X'\" (\*(XJ/88-159) Xthat provide programmers a complete set of Xwell defined multibyte handling functions, Xso that both the implementors and the programmers of the \s-1C\s+1 Xprogramming language can promote the Xinternational portability of their programs among various systems. X'\".H 2 "Scope" X.P XThis addendum specifies: X.LB 4 0 0 2 a X.LI Xextensions to the \s-1ENVIRONMENT\s+1 clause of \*(AC. X.LI Xextensions to the \s-1LANGUAGE\s+1 clause of \*(AC. X.LI Xextensions to the \s-1LIBRARY\s+1 clause of \*(AC X.ML \(en X.LI Xwide character testing functions - X\f2iswalnum\fP, and so forth. X.LI Xwide character case mapping functions - X\f2towupper\fP, and so forth. X.LI Xwide character classification functions - X\f2wctype\fP, \f2iswctype\fP. X.LI Xwide character input/output functions - X\f2getwc/putwc\fP\| family X.LI Xformatted wide character input/output functions - X\f2fwprintf\fP, and so forth. X.LI Xextensions to the formatted input/output functions - X\f2printf/scanf\fP\| family X.br X.LI Xwide string conversion functions - X\f2wcstod\fP, and so forth. X.br X.LI Xwide string copy functions - X\f2wcscpy\fP, and so forth. X.LI Xwide string comparison functions - X\f2wcscmp\fP, and so forth. X.LI Xwide string search functions - X\f2wcschr\fP, and so forth. X.LI Xprinting position functions - X\f2wcswidth\fP, \f2wcwidth\fP. X.mc * X.mc X.LI Xwide string time conversion function - X\f2wcsftime\fP. X.mc | X.LI Xrestartable multibyte character functions - X\f2mbrtowc\fP, and so forth. X.LI Xrestartable multibyte string functions - X\f2mbsrtowcs\fP, and so forth. X.mc X.br X.LE X.mc * X.mc X X'\".H 2 "BACKGROUND" X.SP X\f3Background\fP X.P XMost traditional computer systems and computer languages including Xthe traditional C, have an (undocumented, sometimes) assumption that Xa ``\f2character\fP'' can be handled as an atomic quantity associated Xwith a single memory storage unit \(em a ``\f2byte\fP'' or similar. XHowever, this is not true in general. For example, a character used in XJapanese, in Chinese or in Korean requires two or three bytes to represent; Xit is a multibyte character. XEven in the Latin world, a multibyte coded Xcharacter set may appear in the near future. XThis is what is called a \f2byte and character problem\fP. X.P XAnother related concern in this area is how to handle three different Xquantifiers of character string ``\f2length\fP'' \(em (1) number of bytes, X(2) number of characters, and (3) display width. X.P XTo cope with these problems, many technical experts, for example in Japan, Xhave developed their own extensions to multibyte character handling functions Xin their product specifications, Xsometimes independently and sometimes cooperatively, Xfor different implementations on different systems. XHowever, the developed extensions are actually quite similar. XIt can be said that in the process they have found common features Xfor multibyte character support. Moreover, there are a lot of good Xexisting implementations of such multibyte character support Xin the industry. X.P X'\"On the other hand, the \*(AC itself introduced XThe \*(AC introduces Xseveral important features for multibyte character support. XThe first of these is the multibyte character allowance for a comment, Xstring literal, character constant, or header name. XThe standard says that both the source character set and the execution character Xset may contain multibyte characters. Furthermore both character sets need not Xhave the same encoding. XThe second is a new data type X.Cf wchar_t Xfor \f2wide\fP characters. XHowever, these functions are too restrictive and too primitive for the Xapplication programmers to develop internationally portable programs Xin terms of ``character'' handling. XConsider a simple program that counts a number of ``characters'', not X``bytes'', of a given input file. XThe typical program: X.Cb X #include X X main() X { int c, n = 0 ; X X while ( (c = getchar()) != EOF ) X n++ ; X printf("Counts = %d\en", n) ; X return 0 ; X } X.Ce X.P 0 Xdoes not work as expected if the input contains multibyte characters. XIt just counts the number of \f2bytes\fP, not the number of \f2characters\fP. X.P XHow can we rewrite this program using the \*(AC multibyte Xfunctions? Actually it is possible, however we may lose the simplicity Xand the elegance of the C programming style, which is the heart of the XC programming language. X.P XMany concerned implementors may add an adequate set of character functions Xon top of the five functions. X.mc | XIt was recognized by the \s-1ISO/IEC\s+1 \*(WG committee that choosing appropriate X.mc Xmultibyte functions among the various existing (proprietary) implementations X.mc | Xwas premature until the C community has considerably more experience X.mc Xmanipulating \f2wide\fP characters. X.P X.mc | XThis amendment of \*(AC has been X.mc Xdeveloped after careful study of various existing multibyte Xfunction specifications and traces of \*(AC discussions on Xmultibyte character support. EOF chmod 666 chap1.mm sed "s/^X//" > chap2.mm << 'EOF' X'\".sH "ENVIRONMENT AND LANGUAGE" 2 X.H 1 "Environment and language" X.mc | X.H 2 "Clarification" X.mc X.P X.mc | XThis clause provides some interpretations to \*(AC which Xare related to wide characters and multibyte characters. X.mc X.P XA wide character is a code value (a bit pattern) of a X.Cf wchar_t X.mc | Xobject which corresponds to a member of the extended character set. XIf some of a X.Cf wchar_t Xvalue other than wide characters is fed to a code conversion Xfunctions, Xit causes an encoding error. X.mc X.P X.mc | XA null wide character (which is a code with value zero) Xis used to terminate a wide string. X.mc X.P X.mc | XIn a state-dependent encoding, none of the shift sequesnces Xshall have corresponding wide characters because they are not Xmembers of the extended character set. X.mc X.br X.mc * X.mc X X.mc * X.mc X.H 2 "Streams and files" X.P XThe wide character input/output functions described in clause 3.3 Xprovide input and output operations of wide character sequence, X.mc | Xsimilar to the operations that the existing library functions offer. X.mc X.P XWide character input/output can be performed on the \f2streams\fP Xdescribed in \*(AC subclause 7.9.2. During wide character Xinput/output operations, code-conversion between wide character Xrepresentation and multibyte character representation may occur. The Xentities in the file are assumed to be byte sequence representation of Xcharacters, while the interface is defined for wide character Xsequence. X X.H 3 "Streams" X.br X.P XFor the purpose of the description about streams, the following terms Xare used. X.tr X.BL X.LI XWide character input functions \(em Xthe input functions described in clause 3 X(\*(Cwfgetwc\fP, \*(Cwfgetws\fP, \*(Cwgetwc\fP, X\*(Cwgetwchar\fP, \*(Cwfwscanf\fP and \*(Cwwscanf\fP) Xare collectively called \f2wide character input functions\fP. X.LI XWide character output functions \(em Xthe output functions described in clause 3 X(\*(Cwfputwc\fP, \*(Cwfputws\fP, \*(Cwputwc\fP, X\*(Cwputwchar\fP, \*(Cwfwprintf\fP, X\*(Cwwprintf\fP and \*(Cwvfwprintf\fP) Xare collectively called \f2wide character output functions\fP. X.LI XWide character input/output functions \(em Xthe wide character input functions, Xthe wide character output functions Xand the \*(Cwungetwc\fP function are collectively Xcalled \f2wide character input/output functions\fP. X.LI XByte input/output functions \(em Xthe input/output functions and the \*(Cwungetc\fP function described in \*(AC X(\*(Cwfscanf\fP, \*(Cwscanf\fP, X\*(Cwfgetc\fP, \*(Cwfgets\fP, \*(Cwgetc\fP, \*(Cwgetchar\fP, \*(Cwgets\fP, X\*(Cwfread\fP, \*(Cwfprintf\fP, \*(Cwprintf\fP, X\*(Cwvfprintf\fP, \*(Cwvprintf\fP, X\*(Cwfputc\fP, \*(Cwfputs\fP, \*(Cwputc\fP, \*(Cwputchar\fP, \*(Cwputs\fP, X\*(Cwfwrite\fP, \*(Cwungetc\fP) Xare collectively called \f2byte input/output functions\fP. X.LI XInitial stream \(em Xafter a stream is associated with an open file and X.mc | Xbefore any operation other than the \*(Cwsetbuf\fP or X.mc X\*(Cwsetvbuf\fP function is Xperformed on it, the stream is called \f2initial\fP. XThe subsequent operations Xon the stream shall change the state in the way described in 2.3.2. X.LI XWide-oriented stream \(em Xa stream on which any wide character input/output Xfunctions are guaranteed to operate properly is called X\f2wide-oriented\fP. X.LI XNarrow-oriented stream \(em Xa stream which is classified into neither initial Xnor wide-oriented is called \f2narrow-oriented\fP. Any byte input/output Xfunctions are guaranteed to operate properly on this stream. X.LE X X.H 3 "States of a stream" X.br X.P XThe \*(Cwsetbuf\fP and \*(Cwsetvbuf\fP function Xmay be used only on an initial stream and its stream X.mc | Xshall remain in the initial state after the operation. The call to X.mc X\*(Cwclearerr\fP, \*(Cwfeof\fP, \*(Cwferror\fP, X\*(Cwfflush\fP, \*(Cwfgetpos\fP, or \*(Cwftell\fP functions Xon a stream shall not change the state of the stream. X.P XWhen one of the byte input/output functions is performed on an initial Xstream, the stream shall become narrow-oriented. XWhen one of the wide character input/output functions is performed on Xan initial stream, the stream shall become wide-oriented. XIf any of the byte input/output functions is performed on a wide-oriented Xstream or any of the wide input/output functions is performed on Xa narrow-oriented stream, the behavior is undefined. X.mc | XEven if it is a binary stream, Xthe stream shall become initial after a call to the X\*(Cwfreopen\fP function. X.mc X.P X.mc | XFor binary wide-oriented streams, in addition to the Xexisting file positioning function restrictions, Xthe text stream file positioning function restrictions may Xbe also applied (\*(AC subclauses 7.9.9.2 and 7.9.9.4). X X.mc X.P XIf any of the wide character output functions is performed on a Xstream opened with update mode after a successful operation of X.mc | Xa file positioning function Xthat moves the file position indicator to a position other than the end X.mc Xof file, a partial element of a multibyte character may be overwritten Xand the contents of the file is not guaranteed to be read in successfully Xvia the wide character input functions. X.mc * X.mc X.br X X.H 3 "Files" X.br X.P XThe input functions defined in \*(AC clause 7.9 can handle Xthe stream associated with an external file which is created by the Xwide character output functions described in clause 3. X.P XThe external file which is created by the wide character output Xfunctions described in clause 3 begins in the initial shift state. XThe shift state of the end of file is unspecified. EOF chmod 666 chap2.mm sed "s/^X//" > chap3.mm << 'EOF' X'\".sH "LIBRARY" 3 X.H 1 "Library" X.so header.mm X X.so ctype.mm X X.so io.mm X X.so format.mm X X.so stdlib.mm X X.so string.mm X X.so time.mm X X.mc | X.so exmbfunc.mm X X.mc X.so future.mm EOF chmod 666 chap3.mm sed "s/^X//" > chap9.mm << 'EOF' X.fl X.nm X.rm nm \" Don't number appendices X.nr W +\n(nUu X.ll \nWu X.nr Oc 0 X.SK X.deTX X.nf X.ft 3 XInformation procesing \(em Programming Language C \(em X.ft X.sp X.mc | XAMENDMENT 3 X.mc XMultibyte Support Extensions X.sp X.fi X.. X.ig X% .TC 1 1 2 0 "\fB\s+2ADDENDUM 3 - Multibyte Support Extension \s-2\fP" "" "CONTENTS" X.. X.TC X.ll -0.8i EOF chmod 666 chap9.mm sed "s/^X//" > makefile << 'EOF' XN= 1 X# PRE= -p # pre-pro. "pic" X# MMT= mmt XMMT= troff -mm XDST= post XOPT= X# PRINTER= apple XPRINTER= ps X# LP= /usr/bin/lp -d${PRINTER} -otroff -on${N} XLP= (dpost | lpr -h -P $(PRINTER)) < XXPROOF= xproof XSPELL= ispell X XFILES= chap0.mm chap1.mm chap2.mm chap3.mm annexa.mm chap9.mm XCHAP3= ctype.mm io.mm format.mm stdlib.mm string.mm time.mm future.mm X X X.SUFFIXES: .mm .out .x .p X Xall: all.x X X.mm.out: X $(MMT) -T$(DST) $(PRE) $(OPT) $*.mm > $*.out X X.out.x: X $(XPROOF) $*.out X X.out.p: X $(LP) $*.out X Xall.out: $(FILES) X $(MMT) -T$(DST) $(PRE) $(OPT) $(FILES) > all.out X Xprint: all.p X Xclean: X -rm -f cover.out all.out Changes.out X Xclobber: clean X -rm -f core X Xspell: $(FILES) X $(SPELL) -S -w -p .ispell_words $(FILES) X X# dependency X Xcover.out: cover.mm Xchap3.out: chap3.mm $(CHAP3) Xall.out: $(FILES) $(CHAP3) XChanges.out: Changes.mm EOF chmod 666 makefile sed "s/^X//" > annexa.mm << 'EOF' X.nm X.rm nm \" Don't number annexes X.nr W +\n(nUu X.ds aX Annex X.rn TP tP X.de TP X.ev 0 X.ll \nWu X.lt \nWu X.ev X.ev 1 X.ll \nWu X.lt \nWu X.ev X.ev 2 X.ll \nWu X.lt \nWu X.ev X.tP X.. X.fl X.mc | X.OH "'\s10Annex''[to be \s-1ISO/IEC\s+1 9899 : 1990/Amendment 3 : 1993 (E)]\s0'" X.EH "'\s10[to be \s-1ISO/IEC\s+1 9899 : 1990/Amendment 3 : 1993 (E)]''Annex'\s0" X.mc X.de HX X.if \\$1=1 .nr ;3 (0 X.. X.de HZ X.if \\$1=1 .sp 2 X.. X.nr Cl 2 \" Don't put too much from annexes in table of contents X.HM A X.mc | X.aH "Library Summary" 1 X.mc X.ix "library@summary X.mc | X.H 2 "Errors \*(Cw\fP" X.mc X.Cb X.mc | X EILSEQ X.Ce X X.H 2 "Multibyte support extensions \*(Cw\fP" X.H 3 "Types and macros" X.Cb X.mc X NULL X.mc | X mbstate_t X.mc X size_t X struct tm X wchar_t X wctype_t X WEOF X wint_t X.Ce X.mc | X.H 3 "Wide character handling" X.mc X.Cb X int iswalnum(wint_t c); X int iswalpha(wint_t c); X int iswcntrl(wint_t c); X int iswdigit(wint_t c); X int iswgraph(wint_t c); X int iswlower(wint_t c); X int iswprint(wint_t c); X int iswpunct(wint_t c); X int iswspace(wint_t c); X int iswupper(wint_t c); X int iswxdigit(wint_t c); X wint_t towlower(wint_t c); X wint_t towupper(wint_t c); X wctype_t wctype(const char *property); X int iswctype(wint_t c, wctype_t wc_prop); X.Ce X.SK X.mc | X.H 3 "Input/output" X.mc X.Cb X wint_t fgetwc(FILE *stream); X wchar_t *fgetws(wchar_t *s, int n, FILE *stream); X wint_t fputwc(wint_t c, FILE *stream); X int fputws(const wchar_t *s, FILE *stream); X wint_t getwc(FILE *stream); X wint_t getwchar(void); X wint_t putwc(wint_t c, FILE *stream); X wint_t putwchar(wint_t c); X wint_t ungetwc(wint_t c, FILE *stream); X int fwprintf(FILE *stream, const wchar_t *format, ...); X int fwscanf(FILE *stream, const wchar_t *format, ...); X int wprintf(const wchar_t *format, ...); X int wscanf(const wchar_t *format, ...); X int swprintf(wchar_t *s, size_t n, const wchar_t *format, ...); X int swscanf(const wchar_t *s, const wchar_t *format, ...); X int vfwprintf(FILE *stream, const wchar_t *format, va_list arg); X int vwprintf(const wchar_t *format, va_list arg); X.mc | X int vswprintf(wchar_t *s, size_t n, const wchar_t *format, X va_list arg); X.mc X.Ce X.mc | X.H 3 "General utilities" X.mc X.Cb X double wcstod(const wchar_t *nptr, wchar_t **endptr); X long int wcstol(const wchar_t *nptr, wchar_t **endptr, X int base); X unsigned long int wcstoul(const wchar_t *nptr, X wchar_t **endptr, int base); X.Ce X.mc | X.H 3 "Wide string handling" X.mc X.Cb X wchar_t *wcscpy(wchar_t *s1, const wchar_t *s2); X wchar_t *wcsncpy(wchar_t *s1, const wchar_t *s2, size_t n); X wchar_t *wcscat(wchar_t *s1, const wchar_t *s2); X wchar_t *wcsncat(wchar_t *s1, const wchar_t *s2, size_t n); X int wcscoll(const wchar_t *s1, const wchar_t *s2); X int wcscmp(const wchar_t *s1, const wchar_t *s2); X int wcsncmp(const wchar_t *s1, const wchar_t *s2, size_t n); X size_t wcsxfrm(wchar_t *s1, const wchar_t *s2, size_t n); X wchar_t *wcschr(const wchar_t *s, wint_t c); X size_t wcscspn(const wchar_t *s1, const wchar_t *s2); X wchar_t *wcspbrk(const wchar_t *s1, const wchar_t *s2); X wchar_t *wcsrchr(const wchar_t *s, wint_t c); X size_t wcsspn(const wchar_t *s1, const wchar_t *s2); X.mc | X wchar_t *wcsstr(const wchar_t *s1, const wchar_t *s2); X wchar_t *wcstok(wchar_t *s1, const wchar_t *s2, wchar_t **ptr); X.mc X size_t wcslen(const wchar_t *s); X int wcswidth(const wchar_t *s, size_t n); X int wcwidth(wint_t c); X.Ce X.mc | X.H 3 "Date and time" X.mc X.Cb X size_t wcsftime(wchar_t *s, size_t maxsize, X const wchar_t *format, const struct tm *timeptr); X.mc | X.Ce X.H 3 "Extended multibyte functions" X.Cb X int sisinit(mbstate_t *ps); X int mbrlen(const char *s, size_t n, mbstate_t *ps); X int mbrtowc(wchar_t *pwc, const char *s, size_t n, mbstate_t *ps); X int wcrtomb(char *s, wchar_t wc, mbstate_t *ps); X size_t mbsrtowcs(wchar_t *dst, const char *src, size_t len, X char **ptr, mbstate_t *ps); X size_t wcsrtombs(char *dst, const wchar_t *src, size_t len, X wchar_t **ptr, mbstate_t *ps); X.mc X.Ce EOF chmod 666 annexa.mm