From kido@vnet.ibm.com Wed Oct 7 07:30:32 1992 Received: from vnet.ibm.com by dkuug.dk via EUnet with SMTP (5.64+/8+bit/IDA-1.2.8) id AA20169; Wed, 7 Oct 92 07:30:32 +0100 Message-Id: <9210070630.AA20169@dkuug.dk> Received: from YMTVM8 by vnet.ibm.com (IBM VM SMTP V2R2) with BSMTP id 4802; Wed, 07 Oct 92 02:32:57 EDT Date: Wed, 7 Oct 92 15:30:01 JST From: "Akio Kido" To: sc22wg20@dkuug.dk, sc22wg15@dkuug.dk, sig-international@osf.org Subject: mse.trf.2 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- ctype.mm # sed "s/^X//" > ctype.mm << 'EOF' X'\".pH "WIDE CHARACTER HANDLING" X.H 2 "Wide character handling" X.P XSeveral functions useful for testing and mapping wide Xcharacters (described in 3.2.1 or 3.2.2) are declared in the Xheader X.Cf . XFor wide character testing and mapping functions, Xthe argument is an X.Cf \*(WI , Xthe value of which shall be representable as an X.Cf wchar_t Xor shall equal the value of the macro X.Cf WEOF. XIf the argument has any other value, Xthe behavior is undefined. XThe two functions, X.Cf wctype Xand X.Cf iswctype X(described in 3.2.3), Xare also declared in the X.Cf , Xwhich are useful for testing locale-specific character Xproperties. X.mc | XThe return value of the X.Cf wctype Xfunction is used as the Xsecond argument to the X.Cf iswctype Xfunction. X.mc X.P XThe behavior of these functions is affected by the current locale. X.mc * X.mc X.P XThe term X\f2printing wide character\fP Xrefers to a wide character (code) that corresponds to a Xmember of an implementation-defined set of characters, Xeach of which occupies one or more printing positions on a Xdisplay device; Xthe terms X\f2control wide character\fP Xrefers to a member of an implementation-defined set of wide Xcharacters that are not printing wide characters. X X X.H 3 "Wide character testing functions" X.br X.P XThe functions in this subclause return nonzero X(true) Xif and only if the value of the argument X.Cf c Xconforms to that in the description of the function. X.H 4 "The \f(CBiswalnum\fP function" X.HU "Synopsis" X.\" #include X.Cb X #include X int iswalnum(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswalnum Xfunction tests for any wide character for which X.Cf iswalpha Xor X.Cf iswdigit Xis true. X X.H 4 "The \f(CBiswalpha\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswalpha(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswalpha Xfunction tests for any wide character for which X.Cf iswupper Xor X.Cf iswlower Xis true, or Xany wide character that is one of an implementation-defined set of wide Xcharacters for which none of X.Cf iswcntrl , X.Cf iswdigit , X.Cf iswpunct , Xor X.Cf iswspace Xis true. X.mc | XFor each wide character that corresponds to a character for which X.Cf isalpha Xis true, X.mc X.Cf iswalpha X.mc | Xshall be true. X.mc X X.H 4 "The \f(CBiswcntrl\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswcntrl(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswcntrl Xfunction tests for any control wide character. X X.H 4 "The \f(CBiswdigit\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswdigit(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswdigit Xfunction tests for any wide character that corresponds to Xa decimal-digit character (as defined in \*(AC subclause 5.2.1). X X.H 4 "The \f(CBiswgraph\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswgraph(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswgraph Xfunction tests for any printing wide character for which X.Cf iswspace Xis false. X X.H 4 "The \f(CBiswlower\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswlower(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswlower Xfunction tests for any wide character that corresponds to a lowercase Xletter or is one of an implementation-defined set of wide character for Xwhich none of X.Cf iswcntrl , X.Cf iswdigit , X.Cf iswpunct , Xor X.Cf iswspace X.mc | Xis true. XFor each wide character that corresponds to a character for which X.Cf islower Xis true, X.mc X.Cf iswlower X.mc | Xshall be true. X.mc X X.mc | X X X.mc X.H 4 "The \f(CBiswprint\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswprint(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswprint Xfunction tests for any printing wide character. X X.H 4 "The \f(CBiswpunct\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswpunct(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswpunct Xfunction tests for any printing wide character that is Xone of an implementation-defined set of wide characters for Xwhich neither X.Cf iswspace Xnor X.Cf iswalnum Xis true. X.mc | XFor each wide character that corresponds to a character for which X.Cf ispunct Xis true, X.mc X.Cf iswpunct X.mc | Xshall be true. X.mc X X.mc | X X.mc X.H 4 "The \f(CBiswspace\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswspace(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswspace Xfunction tests for any wide character that corresponds X.mc | Xto an X.mc Ximplementation-defined set of wide characters for which X.Cf iswalnum Xis false. X.mc | XFor each wide character that corresponds to a character for which X.Cf isspace Xis true, X.mc X.Cf iswspace X.mc | Xshall be true. X.mc X X.H 4 "The \f(CBiswupper\fP function" X.HU "Synopsis" X.\" #include X.Cb X #include X int iswupper(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswupper Xfunction tests for any wide character that corresponds to an Xupperacase letter or is one of an implementation-defined set of wide Xcharacters for which none of X.Cf iswcntrl , X.Cf iswdigit , X.Cf iswpunct , Xor X.Cf iswspace X.mc | Xis true. XFor each wide character that corresponds to a character for which X.Cf isupper Xis true, X.mc X.Cf iswupper X.mc | Xshall be true. X.mc X X.H 4 "The \f(CBiswxdigit\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswxdigit(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswxdigit Xfunction tests for any wide character that corresponds to Xa hexadecimal-digit character (as defined in \*(AC subclause 6.1.3.2). X X.H 3 "Wide character case mapping functions" X.H 4 "The \f(CBtowlower\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X \*(WI towlower(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf towlower Xfunction converts an uppercase letter to the Xcorresponding lowercase letter. X.HU "Returns" X.br X.P XIf the argument is a wide character for which X.Cf iswupper Xis true and there is a corresponding wide character Xfor which X.Cf iswlower Xis true, the X.Cf towlower Xfunction returns the corresponding wide character; Xotherwise, the argument is returned unchanged. X X.H 4 "The \f(CBtowupper\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X \*(WI towupper(\*(WI c); X.Ce X.HU "Description" X.br X.P XThe X.Cf towupper Xfunction converts a lowercase letter to the Xcorresponding uppercase letter. X.HU "Returns" X.br X.P XIf the argument is a wide character for which X.Cf iswlower Xis true and there is a corresponding wide character Xfor which X.Cf iswupper Xis true, the X.Cf towupper Xfunction returns the corresponding wide character; Xotherwise, the argument is returned unchanged. X X.H 3 "Wide character classification functions" X.br X.P XThe wide character classification functions X.Cf wctype Xand X.Cf iswctype Xclassify characters in the same style as the Xtraditional ctype functions (for example, X.Cf isspace , X.Cf isalpha , X\&...), according to the rules of the coded character set defined by Xcharacter type information in the program's locale (category X.Cf LC_CTYPE ). X X.H 4 "The \f(CBwctype\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X wctype_t wctype(const char *property); X.Ce X.HU "Description" X.br X.P XThe X.Cf wctype Xfunction Xis defined for valid property names as Xdefined in the current locale. XThe X.Cf property Xis a string identifying a generic character Xclass for which codeset specific type information is Xrequired. The function returns a value of type X.Cf wctype_t, Xwhich can be used as the second argument to Xa call of X.Cf iswctype . XThe X.Cf wctype Xfunction determines values of X.Cf wctype_t Xaccording to the rules of the coded Xcharacter set defined by character type information Xin the program's locale (category X.Cf LC_CTYPE ). XValues returned by X.Cf wctype Xare valid until a call to X.Cf setlocale Xthat modifies the category X.Cf LC_CTYPE . X.HU "Returns" X.br X.P XThe X.Cf wctype X.mc | Xfunction returns zero if the given property name is not valid X.mc Xfor the current locale (category X.mc | X.Cf LC_CTYPE ); Xotherwise, it returns a value of type X.mc X.Cf wctype_t Xthat can be used in calls to X.Cf iswctype . X X.H 4 "The \f(CBiswctype\fP function" X.HU "Synopsis" X'\" #include X.Cb X #include X int iswctype(\*(WI c, wctype_t wc_prop); X.Ce X.HU "Description" X.br X.P XThe X.Cf iswctype Xfunction determines whether the wide character X.Cf c Xhas the property X.Cf wc_prop. XIf the value of X.Cf c Xis neither \*(CwWEOF\fP nor any value of the X.mc | Xwide character which corresponds to a multibyte character, X.mc Xthe behavior is undefined. XIf the value of X.Cf wc_prop Xis invalid (that is, not obtained by a previous call to X.Cf wctype, Xor X.Cf wc_prop Xhas been invalidated by a Xsubsequent call to X.Cf setlocale Xthat has affected category X.Cf LC_CTYPE ), X.mc | Xthe behavior is undefined. X.mc X.HU "Returns" X.br X.P XThe X.Cf iswctype Xfunction returns nonzero (true) Xif and only if the value of the wide character X.Cf c Xhas the property X.Cf wc_prop. X X.H 4 "The standard properties" X.br X.P XThe eleven strings \(em X\*(Cw"alnum"\fP, X\*(Cw"alpha"\fP, X\*(Cw"cntrl"\fP, X\*(Cw"digit"\fP, X\*(Cw"graph"\fP, X\*(Cw"lower"\fP, X\*(Cw"print"\fP, X\*(Cw"punct"\fP, X\*(Cw"space"\fP, X\*(Cw"upper"\fP, and X\*(Cw"xdigit"\fP \(em Xare reserved for the standard character classes. XThe functions in the Xsubclause 3.2.1 are equivalent to X.Cb X iswctype(c, wctype("alnum")); X iswctype(c, wctype("alpha")); X iswctype(c, wctype("cntrl")); X iswctype(c, wctype("digit")); X iswctype(c, wctype("graph")); X iswctype(c, wctype("lower")); X iswctype(c, wctype("print")); X iswctype(c, wctype("punct")); X iswctype(c, wctype("space")); X iswctype(c, wctype("upper")); X iswctype(c, wctype("xdigit")); X.Ce X. EOF chmod 666 ctype.mm