Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 27 Dec 1997 10:05:05 +1030
From:      Greg Lehey <grog@lemis.com>
To:        FreeBSD Hackers <hackers@FreeBSD.ORG>
Cc:        Brian Clapper <bmc@WillsCreek.COM>
Subject:   Re: <wctype.h>
Message-ID:  <19971227100505.15399@lemis.com>

next in thread | raw e-mail | index | archive | help
A few days ago, somebody asked a question about wctype.h, and the
consensus was that it was some kind of Microsoft thing.  This appears
not to be the case; I answered a question on -questions a day or two
ago, and got a number of replies.  This is probably the most detailed
one.

Greg

-----Forwarded message from Brian Clapper <bmc@WillsCreek.COM>-----

Date: Fri, 26 Dec 1997 14:48:17 -0500 (EST)
From: Brian Clapper <bmc@WillsCreek.COM>
To: Greg Lehey <grog@lemis.com>
Cc: Donn Miller <dmm125@bellatlantic.net>,
        FreeBSD Questions <questions@FreeBSD.ORG>
Subject: Re: <wctype.h>

On 25 December, 1997, at 10:20 (+1030)
Greg Lehey wrote:
> On Wed, Dec 24, 1997 at 02:46:06PM -0800, Doug White wrote:
>> On Tue, 23 Dec 1997, Donn Miller wrote:
>>
>>> Just wondering about the <wctype.h> include file.  FreeBSD doesn't seem to
>>> have it.  Does fbsd support this library?
>>
>> What's the name of the library or package?  It may not come with the core
>> system but may be available as a package.
>
> This question came up on -hackers in the last day or so in connection
> with wine.  The replies indicate that it's some kind of Microsoft
> header file, and that it shouldn't be used under UNIX: there should be
> some kind of #ifdef.  You might like to check if that fits in with
> what your package wants.

Sorry, it's not (just) some kind of Microsoft header file; it's a new ANSI
header file that provides support routines and definitions for wide
characters.  In addition to being provided by the MS Visual C++ development
environment, it's available on Solaris 2.5.  The functions/macros it
provides are also available on other commercial Unices--such as Digital's
version of OSF/1, HP/UX 10, and AIX 4.2--even though they don't provide the
<wctype.h> header file.  (You include either <wchar.h> or <ctype.h> to get
them, depending on the OS flavor.)

I find I miss the functionality on FreeBSD, in fact, when I try to port
certain software (namely stuff I'm doing at work) onto my boxes at home.

P.J. Plauger's DinkumWare site (`http://www.dinkumware.com/') has this to
say on the subject:

`http://www.dinkumware.com/htm_cl/wctype.html#<wctype.h>':

        Include the standard header <wctype.h> to declare several functions
        that are useful for classifying and mapping codes from the target
        wide-character set.

        Every function that has a parameter of type wint_t can accept the
        value of the macro WEOF or any valid wide-character code (of type
        wchar_t). Thus, the argument can be the value returned by any of
        the functions: btowc, fgetwc, fputwc, getwc, getwchar, putwc,
        putwchar, towctrans, towlower, towupper, or ungetwc. You must not
        call these functions with other wide-character argument values.

        The wide-character classification functions are strongly related to
        the (byte) character classification functions. Each function isXXX
        has a corresponding wide-character classification function
        iswXXX.

Thus, <wctype.h> is analogous to <ctype.h>: It provides macros such as
islower(), iswupper(), towlower(), towupper(), iswpunct(), etc.  Complete
info is available at the above URL.  (The topic index page is helpful; it's
located here: `http://www.dinkumware.com/htm_cl/_index.html'.)

According to `http://www.dinkumware.com/htm_cl/lib_over.html#Amendment',
"The headers <iso646.h>, <wchar.h>, and <wctype.h> are added with Amendment
1, an addition to the C Standard published in 1995."

See `http://www.dinkumware.com/refc.html' for a "complete HTML description
of the Standard C Library, corresponding to ISO/IEC 9899 (1990) as amended
in 1995."
-----
Brian Clapper, bmc@WillsCreek.COM, http://WWW.WillsCreek.COM/
Real Programs don't use shared text.  Otherwise, how can they use
functions for scratch space after they are finished calling them?

-----End of forwarded message-----



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19971227100505.15399>