From kido@vnet.ibm.com Wed Oct 7 07:36:29 1992 Received: from vnet.ibm.com by dkuug.dk via EUnet with SMTP (5.64+/8+bit/IDA-1.2.8) id AA20424; Wed, 7 Oct 92 07:36:29 +0100 Message-Id: <9210070636.AA20424@dkuug.dk> Received: from YMTVM8 by vnet.ibm.com (IBM VM SMTP V2R2) with BSMTP id 4910; Wed, 07 Oct 92 02:38:53 EDT Date: Wed, 7 Oct 92 15:35:42 JST From: "Akio Kido" To: sc22wg20@dkuug.dk, sc22wg15@dkuug.dk, sig-international@osf.org Subject: mse.trf.5 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- future.mm # -rw-rw-rw- header.mm # -rw-rw-rw- io.mm # sed "s/^X//" > future.mm << 'EOF' X.\".pH "FUTURE LIBRARY DIRECTIONS" X.H 2 "Future library directions" X.ig X# .P X# The following names are grouped under individual headers for convenience. X# All external names described below are reserved no matter what headers are X# included by the program. X# .H 3 "Character handling \*(Cw\fP" X# .br X# .P X# Function names that begin with either X# .Cf isw X# or X# .Cf tow , X# and a lower-case letter (followed by any combination of digits, letters, X# and underscore) may be added to the declaration in the X# .Cf X# header. X# X# .H 3 "String handling \*(Cw\fP" X# .br X# .P X# Function names that being with X# .Cf wcs X# and a lower-case letter (followed by any combinatio of digits, letters, X# and underscore) may be added to the declaration in the X# .Cf X# header. X.. X.\" +New : noda-001 X.ig X# .P X.. XThe following names are grouped under a header for Xconvenience. All external names described bellow are Xreserved even if the following header is not included by the program. X.H 3 "Multibyte support extensions \*(Cw\fP" X.br X.P XFunction names that begin with X.mc | X.Cf is, X.Cf to, X.mc Xor X.Cf wcs, X.mc | Xand a lower-case letter (followed by any combination of digits, Xletters, and underscore) may be added to the declarations in X.mc Xthe X.Cf Xheader. X.br X.\" -New : noda-001 X EOF chmod 666 future.mm sed "s/^X//" > header.mm << 'EOF' X'\".pH "HEADER " X.H 2 "Header \f(CB\fP" X.P XThe header X.Cf X.mc | Xdeclares five data types, one tag, one macro and several functions. X.mc X.P XThe types declared are X\*(WC Xand X\*(Cwsize_t\fP X(both described in \*(AC subclause 7.1.6), X.Cb X.mc | X mbstate_t X.Ce Xwhich is a nonarray object type that can hold the X.I "conversion state information" Xneeded to convert between sequences of multibyte characters Xand wide characters, X.Cb X.mc X wctype_t X.Ce Xwhich is a scalar type of a data object that can hold Xvalues which represent locale-specific character Xclassification, and X.Cb X \*(WI X.Ce Xwhich is an integral type of a data object that can hold any X.mc | Xwide character and an \f2end-of-file\fP value. X.mc X.P XThe tag X\*(Cwtm\fP Xis declared as naming an incomplete structure type, X.mc | Xthe contents of which are described in X.mc X\*(AC subclause 7.12.1. X.P XThe functions declared are as follows. X.BL X.LI Xseveral functions for testing wide characters X.LI Xmany functions for performing input and output multibyte Xcharacters and/or wide characters X.LI Xseveral functions of general utility, such as converting wide Xstring to numerical representation X.LI Xseveral functions for manipulating wide X.mc | Xstrings (that is, arrays of \*(WC) X.mc X.LE X.P XThe macro defined is X.Cf WEOF Xwhich expands to a constant Xexpression of X.Cf \*(WI Xtype that is returned by several Xfunctions to indicate \f2end-of-file\fP, that is, no more input X.mc | Xfrom a stream. The value of the macro X.mc X.Cf WEOF X.mc | Xmay differ from that of \*(CwEOF\fP. X.H 2 "Errors \f(CB\fP" X.HU "Extension" X.br X.P XAdd the following one macro to \*(AC subclause 7.1.4 within Xthe definition of macros. X.Cb X EILSEQ X.Ce X.P X.Cf EILSEQ Xexpands to integral constant expression with distinct Xnonzero value, suitable for use in X.Cf #if Xpreprocessing directives. X.mc EOF chmod 666 header.mm sed "s/^X//" > io.mm << 'EOF' X'\".pH "INPUT/OUTPUT" X.H 2 "Input/output" X.P XIn the header X.Cf X, a macro X.Cf WEOF Xis defined and many functions useful for performing input Xand output of multibyte characters and/or wide characters are Xdeclared. X.P X.mc | XIf the argument to X.Cf fputwc Xdoes not correspond to a valid multibyte character, Xor if the character sequence presented to X.Cf fgetwc Xdoes not form a valid multibyte character, Xan \*(Cwencoding error\fP occurs, Xand the value of the macro X.Cf EILSEQ Xis stored in X.Cf errno. X.br X.mc X X.H 3 "Wide character input/output functions" X.br X.P XWide character input functions read multibyte characters Xfrom input streams, and X.mc | Xconvert them to wide characters Xas if they were read by successive calls to the X.Cf fgetwc Xfunction. XEach multibyte character is converted as if by a call to the X'\" .Cf mbtowc X.Cf mbrtowc Xfunction, Xwith the last argument pointing to the conversion state Xinformation of the stream. X.mc X.P X.mc | XWide character output functions write wide characters Xto output streams, and Xconvert them to multibyte characters Xas if they were written by successive calls to the X.Cf fputwc Xfunction. XEach wide character is converted as if by a call to the X'\" .Cf wctomb X.Cf wcrtomb Xfunction, Xwith the last argument pointing to the conversion state Xinformation of the stream. X.rF Xthe X.Cf mbrtowc Xfunction (3.8.2.2), Xthe X.mc X.Cf wctomb X.mc | Xfunction (3.8.2.3). X.mc X.br X.mc * X.mc X X.H 4 "The \f(CBfgetwc\fP function" X.HU "Synopsis" X.Cb X #include X #include X \*(WI fgetwc(FILE *stream); X.Ce X.HU "Description" X.br X.P XThe X.Cf fgetwc Xfunction obtains the next wide character (if present) Xfrom the input stream pointed to by X.Cf stream , Xand advances the associated file position indicator for Xthe stream (if defined). X.HU "Returns" X.br X.P XThe X.Cf fgetwc X.mc | Xfunction returns the next wide character that corresponds X.mc Xto the Xmultibyte character from the input stream pointed to by X.Cf stream . XIf the stream is at end-of-file, the end-of-file indicator for the stream Xis set and X.mc | X.Cf WEOF Xis returned. X.mc XIf a read error occurs, the error indicator for the stream is set and X.mc | X.Cf WEOF Xis returned. X.mc X X.mc | XIf an encoding error occurs, the value of the macro X.Cf EILSEQ Xis stored in X.Cf errno Xand X.Cf WEOF Xis returned. X X X.mc X.H 4 "The \f(CBfgetws\fP function" X.HU "Synopsis" X.Cb X #include X #include X wchar_t *fgetws(wchar_t *s, int n, FILE *stream); X.Ce X.br X.P XThe X.Cf fgetws Xfunction reads at most one less than the number of Xwide characters specified by X.Cf n Xfrom the stream pointed to by X.Cf stream Xinto the array pointed to by X.Cf s . XNo additional wide characters are Xread after a new-line wide character (which is retained) or after Xend-of-file. A null wide character is written immediately after the last Xwide character read into the array. X.HU "Returns" X.br X.P XThe X.Cf fgetws Xfunction returns X.Cf s Xif successful. If end-of-file is encountered and no wide Xcharacters have been read into the array, the contents of the array Xremain unchanged and a null pointer is returned. If a read error X.mc | Xor an encoding error X.mc Xoccurs during the operation, the array contents are indeterminate and Xa null pointer is returned. X X.H 4 "The \f(CBfputwc\fP function" X.HU "Synopsis" X.Cb X #include X #include X \*(WI fputwc(\*(WI c, FILE *stream); X.Ce X.HU "Description" X.br X.P XThe X.Cf fputwc Xfunction writes the wide character specified by X.Cf c X.mc * X.mc Xto the output stream pointed to by X.Cf stream , Xas a multibyte character Xat the position indicated by the associated file Xposition indicator for the stream (if defined), and advances the Xindicator appropriately. If the file cannot support positioning Xrequests, or if the stream was opened with append mode, the character Xis appended to the output stream. X.HU "Returns" X.br X.P XThe X.Cf fputwc Xfunction returns the wide character written. If a write Xerror occurs, the error indicator for the stream is set and X.mc | X.Cf WEOF Xis returned. X.mc X X.mc | XIf an encoding error occurs, the value of the macro X.Cf EILSEQ Xis stored in X.Cf errno Xand X.Cf WEOF Xis returned. X X.mc X.H 4 "The \f(CBfputws\fP function" X.HU "Synopsis" X.Cb X #include X #include X int fputws(const wchar_t *s, FILE *stream); X.Ce X.HU "Description" X.br X.P XThe X.Cf fputws Xfunction writes the wide string pointed to by X.Cf s Xto the stream pointed to by X.Cf stream Xas a multibyte character string. XThe terminating null wide character is not written. X.HU "Returns" X.br X.P XThe X.Cf fputws Xfunction returns X.Cf -1 X.mc | Xif a write error or an encoding error occurs; otherwise, it returns a X.mc Xnonnegative value. X X.H 4 "The \f(CBgetwc\fP function" X.HU "Synopsis" X.Cb X #include X #include X \*(WI getwc(FILE *stream); X.Ce X.HU "Description" X.br X.P XThe X.Cf getwc Xfunction is equivalent to X.Cf fgetwc , Xexcept that if it is implemented as a macro, it may Xevaluate X.Cf stream Xmore than once, so the argument should never be an Xexpression with side effects. X.HU "Returns" X.br X.P XThe X.Cf getwc X.mc | Xfunction returns either the next wide character from the X.mc Xinput stream pointed to by X.mc | X.Cf stream Xor X.mc X.Cf WEOF . X.mc * X.mc X X.H 4 "The \f(CBgetwchar\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X \*(WI getwchar(void); X.Ce X.HU "Description" X.br X.P XThe X.Cf getwchar Xfunction is equivalent to X.Cf getwc Xwith the argument X.Cf stdin . X.HU "Returns" X.br X.P XThe X.Cf getwchar X.mc | Xfunction returns either the next wide character from the input X.mc Xstream pointed to by X.mc | X.Cf stdin Xor X.mc X.Cf WEOF . X.mc * X.mc X X.H 4 "The \f(CBputwc\fP function" X.HU "Synopsis" X.Cb X #include X #include X \*(WI putwc(\*(WI c, FILE *stream); X.Ce X.HU "Description" X.br X.P XThe X.Cf putwc Xfunction is equivalent to X.Cf fputwc , Xexcept that if it is implemented as a macro, it may Xevaluate X.Cf stream Xmore than once, so the argument should never be an Xexpression with side effect. X.HU "Returns" X.br X.P XThe X.Cf putwc X.mc | Xfunction returns either the character written Xor X.mc X.Cf WEOF . X X.H 4 "The \f(CBputwchar\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X \*(WI putwchar(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf putwchar Xfunction is equivalent to X.Cf putwc Xwith the second argument X.Cf stdout . X.HU "Returns" X.br X.P XThe X.Cf putwchar X.mc | Xfunction returns either the character written Xor X.mc X.Cf WEOF . X X.H 4 "The \f(CBungetwc\fP function" X.HU "Synopsis" X.Cb X #include X #include X \*(WI ungetwc(\*(WI c, FILE *stream); X.Ce X.HU "Description" X.br X.P XThe X.Cf ungetwc Xfunction pushes the wide character specified by X\*(Cwc\fP back onto the input stream pointed to by X.Cf stream . XThe pushed-back wide characters will be returned Xby subsequent reads on that stream in the reverse order of their pushing. XA successful intervening call (with the stream pointed to by X.Cf stream ) Xto a file positioning function X.Cs ( fseek , X.Cf fsetpos , Xor X.Cf rewind ) Xdiscards any pushed-back wide characters for the stream. XThe external storage corresponding to the stream is unchanged. X.P XOne wide character of push-back is guaranteed, even if a Xcall to the \*(Cwungetwc\fP function follows just after Xa call to a formatted wide character input function (\*(Cwfwscanf\fP or X\*(Cwwscanf\fP). If the X.Cf ungetwc Xfunction is called too many times Xon the same stream without an intervening read or file Xpositioning operation on that stream, the operation may fail. X.P XIf the value of X.Cf c Xequals that of the macro X.Cf WEOF , Xthe operation fails and the input stream is unchanged. X.P XA successful call to the X.Cf ungetwc Xfunction clears the end-of-file indicator for the stream. XThe value of the file position indicator for the stream after reading Xor discarding all pushed-back wide characters shall be the same as it was Xbefore the wide characters were pushed back. XFor a text stream, the value of its file position indicator after Xa successful call to the X.Cf ungetwc Xfunction is unspecified until all pushed-back wide characters are read or Xdiscarded. XFor a binary stream, the value of its file position indicator is unspecified; Xif its value was zero before a call, it is indeterminate after the call. X.HU "Returns" X.br X.P XThe X.Cf ungetwc Xfunction returns the wide character pushed back, or X.Cf WEOF Xif the operation fails. EOF chmod 666 io.mm