From kido@vnet.ibm.com Wed Oct 7 07:34:47 1992
Received: from vnet.ibm.com by dkuug.dk via EUnet with SMTP (5.64+/8+bit/IDA-1.2.8)
id AA20364; Wed, 7 Oct 92 07:34:47 +0100
Message-Id: <9210070634.AA20364@dkuug.dk>
Received: from YMTVM8 by vnet.ibm.com (IBM VM SMTP V2R2) with BSMTP id 4877;
Wed, 07 Oct 92 02:37:07 EDT
Date: Wed, 7 Oct 92 15:33:44 JST
From: "Akio Kido"
To: sc22wg20@dkuug.dk, sc22wg15@dkuug.dk, sig-international@osf.org
Subject: mse.trf.6
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- stdlib.mm
#
sed "s/^X//" > stdlib.mm << 'EOF'
X'\".pH "GENERAL UTILITIES"
X.H 2 "General utilities"
X.P
XSeveral functions of general utility are declared in the
Xheader file
X.Cf .
X.H 3 "Wide string conversion functions"
X.H 4 "The \f(CBwcstod\fP function"
X.HU "Synopsis"
X.Cb
X #include
X double wcstod(const wchar_t *nptr, wchar_t **endptr);
X.Ce
X.HU "Description"
X.br
X.P
XThe
X.Cf wcstod
Xfunction converts the initial portion of the wide string pointed to by
X.Cf nptr
Xto
X.Cf double
Xrepresentation.
XFirst it decomposes the input wide string into three parts:
Xan initial, possibly empty, sequence of white-space wide characters
X(as specified by the
X.Cf iswspace
Xfunction),
Xa subject sequence resembling a floating-point constant;
Xand a final wide string of one or more unrecognized wide characters,
Xincluding the terminating null wide character of the input
Xwide string.
XThen it attempts to convert the subject sequence to a floating-point number,
Xand returns the result.
X.P
XThe expected form of the subject sequence is
Xan optional plus or minus sign,
Xthen a nonempty sequence of digits optionally containing a
Xdecimal-point wide character,
Xthen an optional exponent part as defined in \*(AC subclause 6.1.3.1,
Xbut no floating suffix.
XThe subject sequence is defined as the longest initial subsequence of
Xthe input wide string,
Xstarting with the first non-white-space wide character,
Xthat is of the expected form.
XThe subject sequence contains no wide characters if the
Xinput wide string is empty or consists entirely of white space,
Xor if the first non-white-space wide character is
Xother than a sign, a digit, or a decimal-point wide character.
X.P
XIf the subject sequence has the expected form,
Xthe sequence of wide characters starting with the first
Xdigit or the decimal-point wide character
X(whichever occurs first)
Xis interpreted as a floating constant according to the rules of
X\*(AC subclause 6.1.3.1,
Xexcept that the decimal-point wide character is used in
Xplace of a period,
Xand that if neither an exponent part nor a decimal-point
Xwide character appears,
Xa decimal point is assumed to follow the last digit in the
Xwide string.
XIf the subject sequence begins with a minus sign,
Xthe value resulting from the conversion is negated.
XA pointer to the final wide string is
Xstored in the object pointed to by
X.Cf endptr ,
Xprovided that
X.Cf endptr
Xis not a null pointer.
X.P
XIn other than the
X.Cf \&"C"
Xlocale,
Xadditional implementation-defined subject sequence forms may be accepted.
X.P
XIf the subject sequence is empty or does not have the expected form,
Xno conversion is performed;
Xthe value of
X.Cf nptr
Xis stored in the object pointed to by
X.Cf endptr ,
Xprovided that
X.Cf endptr
Xis not a null pointer.
X.HU "Return"
X.br
X.P
XThe
X.Cf wcstod
Xfunction returns the converted value,
Xif any.
XIf no conversion could be performed,
Xzero is returned.
XIf the correct value is outside the range of representable values,
Xplus or minus
X.Cf HUGE_VAL
Xis returned
X(according to the sign of the value),
Xand the value of the macro
X.Cf ERANGE
Xis stored in
X.Cf errno .
XIf the correct value would cause underflow,
Xzero is returned and the value of the macro
X.Cf ERANGE
Xis stored in
X.Cf errno .
X
X.H 4 "The \f(CBwcstol\fP function"
X.HU "Synopsis"
X.Cb
X #include
X long int wcstol(const wchar_t *nptr, wchar_t **endptr,
X int base);
X.Ce
X.HU "Description"
X.br
X.P
XThe
X.Cf wcstol
Xfunction converts the initial portion of the wide string pointed to by
X.Cf nptr
Xto
X.Cf long
X.Cf int
Xrepresentation.
XFirst it decomposes the input wide string into three parts:
Xan initial, possibly empty, sequence of
Xwhite-space wide characters
X(as specified by the
X.Cf iswspace
Xfunction),
Xa subject sequence resembling an
Xinteger represented in some radix determined by the value of
X.Cf base ,
Xand a final wide string of one or more unrecognized wide characters,
Xincluding the terminating null wide character of the input wide string.
XThen it attempts to convert the subject sequence to an integer,
Xand returns the result.
X.P
XIf the value of
X.Cf base
Xis zero,
Xthe expected form of the subject sequence is that of an integer
Xconstant as described in \*(AC subclause 6.1.3.2,
Xoptionally preceded by a plus or minus sign,
Xbut not including an integer suffix.
XIf the value of
X.Cf base
Xis between 2 and 36,
Xthe expected form of the subject sequence
Xis a sequence of letters and digits representing an integer
Xwith the radix specified by
X.Cf base ,
Xoptionally preceded by a plus or minus sign,
Xbut not including an integer suffix.
XThe letters from
X.Cf a
X(or
X.Cf A )
Xthrough
X.Cf z
X(or
X.Cf Z )
Xare ascribed the values 10 to 35;
Xonly letters whose ascribed values are less than that of
X.Cf base
Xare permitted.
XIf the value of
X.Cf base
Xis 16, the wide characters
X.Cf 0x
Xor
X.Cf 0X
Xmay optionally precede the sequence of letters and digits,
Xfollowing the sign if present.
X.P
XThe subject sequence is defined as the longest initial subsequence of
Xthe input wide string,
Xstarting with the first non-white-space wide character,
Xthat is of the expected form.
XThe subject sequence contains no wide characters if the
Xinput wide string is empty or
Xconsists entirely of white space, or if the first
Xnon-white-space wide character is other than a sign or a
Xpermissible letter or digit.
X.P
XIf the subject sequence has the expected form and the value of
X.Cf base
Xis zero,
Xthe sequence of wide characters starting with the first digit
Xis interpreted as an integer constant according to the rules of
X\*(AC subclause 6.1.3.2.
XIf the subject sequence has the expected form and the value of
X.Cf base
Xis between 2 and 36,
Xit is used as the base for conversion,
Xascribing to each letter its value as given above.
XIf the subject sequence begins with a minus sign,
Xthe value resulting from the conversion is negated.
XA pointer to the final wide string is
Xstored in the object pointed to by
X.Cf endptr ,
Xprovided that
X.Cf endptr
Xis not a null pointer.
X.P
XIn other than the
X.Cf \&"C"
Xlocale,
Xadditional implementation-defined subject sequence forms may be accepted.
X.P
XIf the subject sequence is empty or does not have the expected form,
Xno conversion is performed;
Xthe value of
X.Cf nptr
Xis stored in the object pointed to by
X.Cf endptr ,
Xprovided that
X.Cf endptr
Xis not a null pointer.
X.HU "Returns"
X.br
X.P
XThe
X.Cf wcstol
Xfunction returns the converted value,
Xif any.
XIf no conversion could be performed,
Xzero is returned.
XIf the correct value is outside the range of representable values,
X.Cf LONG_MAX
Xor
X.Cf LONG_MIN
Xis returned
X(according to the sign of the value),
Xand the value of the macro
X.Cf ERANGE
Xis stored in
X.Cf errno .
X
X.H 4 "The \f(CBwcstoul\fP function"
X.HU "Synopsis"
X.Cb
X #include
X unsigned long int wcstoul(const wchar_t *nptr,
X wchar_t **endptr, int base);
X.Ce
X.HU "Description"
X.br
X.P
XThe
X.Cf wcstoul
Xfunction converts the initial portion of the wide string pointed to by
X.Cf nptr
Xto
X.Cf unsigned
X.Cf long
X.Cf int
Xrepresentation.
XFirst it decomposes the input wide string into three parts:
Xan initial, possibly empty, sequence of
Xwhite-space wide characters
X(as specified by the
X.Cf iswspace
Xfunction),
Xa subject sequence resembling an unsigned
Xinteger represented in some radix determined by the value of
X.Cf base ,
Xand a final wide string of one or more unrecognized wide characters,
Xincluding the terminating null wide character of the input wide string.
XThen it attempts to convert the subject sequence to an unsigned integer,
Xand returns the result.
X.P
XIf the value of
X.Cf base
Xis zero,
Xthe expected form of the subject sequence is that of an integer
Xconstant as described in \*(AC subclause 6.1.3.2,
Xoptionally preceded by a plus or minus sign,
Xbut not including an integer suffix.
XIf the value of
X.Cf base
Xis between 2 and 36,
Xthe expected form of the subject sequence
Xis a sequence of letters and digits representing an integer
Xwith the radix specified by
X.Cf base ,
Xoptionally preceded by a plus or minus sign,
Xbut not including an integer suffix.
XThe letters from
X.Cf a
X(or
X.Cf A )
Xthrough
X.Cf z
X(or
X.Cf Z )
Xare ascribed the values 10 to 35;
Xonly letters whose ascribed values are less than that of
X.Cf base
Xare permitted.
XIf the value of
X.Cf base
Xis 16, the wide characters
X.Cf 0x
Xor
X.Cf 0X
Xmay optionally precede the sequence of letters and digits,
Xfollowing the sign if present.
X.P
XThe subject sequence is defined as the longest initial subsequence of
Xthe input wide string,
Xstarting with the first non-white-space wide character,
Xthat is of the expected form.
XThe subject sequence contains no wide characters if the
Xinput wide string is empty or
Xconsists entirely of white space, or if the first
Xnon-white-space wide character is other than a sign or a
Xpermissible letter or digit.
X.P
XIf the subject sequence has the expected form and the value of
X.Cf base
Xis zero,
Xthe sequence of wide characters starting with the first digit
Xis interpreted as an integer constant according to the rules of
X\*(AC subclause 6.1.3.2.
XIf the subject sequence has the expected form and the value of
X.Cf base
Xis between 2 and 36,
Xit is used as the base for conversion,
Xascribing to each letter its value as given above.
XIf the subject sequence begins with a minus sign,
Xthe value resulting from the conversion is negated.
XA pointer to the final wide string is
Xstored in the object pointed to by
X.Cf endptr ,
Xprovided that
X.Cf endptr
Xis not a null pointer.
X.P
XIn other than the
X.Cf \&"C"
Xlocale,
Xadditional implementation-defined subject sequence forms may be accepted.
X.P
XIf the subject sequence is empty or does not have the expected form,
Xno conversion is performed;
Xthe value of
X.Cf nptr
Xis stored in the object pointed to by
X.Cf endptr ,
Xprovided that
X.Cf endptr
Xis not a null pointer.
X.HU "Returns"
X.br
X.P
XThe
X.Cf wcstoul
Xfunction returns the converted value,
Xif any.
XIf no conversion could be performed,
Xzero is returned.
XIf the correct value is outside the range of representable values,
X.Cf ULONG_MAX
Xis returned,
Xand the value of the macro
X.Cf ERANGE
Xis stored in
X.Cf errno .
X.br
EOF
chmod 666 stdlib.mm