Howdy,

Jonathan McDowell wrote on Thu, Feb 17, 2000 at 10:42:42PM +0000:
[..]
> > towupper() and iswspace() may be substituted by toupper() and
> > isspace(), as they may be able to handle wide-chars as well (as far as
> > I could tell).
> Ah. If they can handle wide-chars then that would solve one of the
> problems I'm having.
Currently, I'm not sure, I'm having a more detailed look at the
source and find, that these function don't use char but 'int',
which seems to conform to ANSI C. Internal they use the _BSD_CT_RUNE_T_
which is in turn an int again. Since int holds 32 bit, it is large
enough to hold wide-chars, as well.... then again, it seems the bits
are used to represent attributes of a 'rune' like beeing uppercase,
lowercase, word, whitespace, etc...
To clearify things, I try to contact a developer...

> What wcs are you using? I'm building under FreeBSD 3.2 and it doesn't
> have one as standard.
I assume this is a wide-char library ? In fact I use none. I run
3.4-STABLE.

[..]
> I've put a bit up at http://www.earth.li/~noodles/programming.html about
> how far I've got. This has also got links to my patch against Xerces
> 1.0.1 and the modified version of David Cross' libwcs that I'm using.
A few comments to your patch:

- Thread handling: in Makefile.incl you specify
  EXTRA_LINK_OPTIONS=-lc -lc_r -lstdc++ -pthread

This is overkill and probably a problem, as well.

libc is the standard non-threaded c-library.
libc_r is the threaded and thread-safe version of libc
only _either_ one should be linked against.

The -pthread switch is special to FreeBSD's gcc and does
nothing else, but linking against -lc_r instead of -lc.

This does not work, you use gcc-2.95.2 from the ports-collection
(as I do, since I need a current c++ compiler, and a libstdc++).

In my approach I just link against -lc_r, and maybe this could
be checked in the autoconf makros, as well.

With FreeBSD 4.0 (which is coming soon) the linuxthreads-port
will build, that provides a libpthread, to map threads on
kernel-schedulable entities. This may then be used as an alternative
to libc_r. Just to keep it in mind. 

Most of your patch is very similar to my work, so far. 

In the Platform-Utils, I ran across timeb.h and ftime()
as well, but I guess it's a bad idea to put effort into something
thats obsolete and replaced by (maybe better but ) surely more
common ways. So for getCurrentMillis() is used it that way:

#include <sys/time.h>

unsigned long XMLPlatformUtils::getCurrentMillis()
{
    struct timeval aTime;
    struct timezone noZone;
    gettimeofday(&aTime, &noZone);
    return (unsigned long)(aTime.tv_sec*1000 + aTime.tv_usec);
}

Note, that the timezone struct is unsused, by I provide it anyway
to avoid any memory corruption. Although it may not be necessary
and passing NULL would be ok. I'm not excperienced enough, to 
make such a guess :-}.

> Current problems are with iswspace/towupper and what I think is a linker
> issue with the sample programs; any light anyone can shed on these would
> be most welcome.
Ok, altough my main problem seems to be mbstowcs(). I keep you
up to date.

Regards,
 Daniel
-- 
IRCnet: Mr-Spock     - Cool people don't move, they just hang around. -  
RL: Daniel Lang * [EMAIL PROTECTED] * +49 89 8540017 * http://www.leo.org/~dl/

Reply via email to