[sword-devel] RawVerse::gettext etc

Daniel Glassey sword-devel@crosswire.org
Fri, 25 Jan 2002 16:38:22 -0000

On 18 Jan 2002 at 16:44, Jerry Kreps sent forth the message:

> On Friday 18 January 2002 08:53, you wrote:
> > According to this bug on sourceforge
> > http://sourceforge.net/tracker/index.php?func=detail&aid=505134&gro
> >up_i d=9516&atid=109516
> >
> > gettext is already defined as a macro in Redhat 7.2 gcc (see
> > src/utilfuns/regex.c for what it probably is). Looks like it would
> > be best to rename the gettext functions in rawverse, rawstr,
> > rawstr4.
> Why design to a specific distro, or against one?

Why have it compile on MSVC, or C++ builder either then? 
Because at least some people use those and it should compile out of the box for them. Same 
principle for Redhat 7.2

> > It already has a different name in zverse (swgettext), but I'm not
> > convinced this is the most intuitive name it could be.
> >
> > getText is another option though that would be very prone to typos.
> > Or alternatively we could #undef gettext in defs.h.
> These approaches can lead to confusion...
> Why not use the C++ namespace capability, that is what it was 
> icnluded for.   Call it 'swordspace' or something like that...

Good idea. Don't know anything about c++ namespaces yet myself. anyone?

> Also, I notice that in 11 source files and 6 headers  'extern "C" ' 
> wraps are being used so g++ won't mangle the C code being wrapped.  
> Why not rewrite the C code so it is C++ compliant?

roman.h and roman.c could easily move to cpp afaict
the zlib stuff is a C lib external to sword to it should stay extern "C"
the flatapi stuff needs to be accessed from Kylix so I assume that should stay as it is.
As for stricmp in utilstr.cpp, dunno.
The regex stuff is an optional replacement if the system doesn't have regex.h so I assume that 
should stay as is.
I think that is all there is.

> > Maybe readtext describes what it does better, reading the text into
> > a provided buffer rather than returning it?
> >
> > (fwiw I'd go for readtext)


P.S. I'd still like to change it to readtext, but that can wait. ;)

Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com