[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Groff] Using C with glib instead of C++ for groff
From: |
Bernd Warken |
Subject: |
[Groff] Using C with glib instead of C++ for groff |
Date: |
Thu, 28 Nov 2002 01:28:02 +0100 |
User-agent: |
Mutt/1.2.5i tests=SPAM_PHRASE_00_01,USER_AGENT,USER_AGENT_MUTT version=2.41 |
The actual source of groff uses a simplified C++ which could be critical
on some non-Linux systems or some future C++ changings. For example,
it is planned to replace `static' by `namespace' concepts; groff does
not use namespaces because of difficulties with some compilers.
An alternative for groff version 2 will be to use the `glib' library;
glib completely works in C, but provides several C++-like
quasi-objective elements. The glib library exists on almost all
operating systems, including all Unix-like systems, Microsoft, and
Mac. So it would make sense to use it for implementing the unicode
structures for groff.
For example, the file groff-current/src/libs/libdriver/input.cc has
some problems with the integer length of some variables. Although 32
bits are necessary for some constructs, the file only uses `int' as
type. `int' is on GNU PC's wide enough with 32 bits, and `long' is
too large with 64 bits. But in ANSI C, `int' has 16 bits and `long'
has 32 bits. This inconsistency could be fixed with the type `gint32'
correctly defined for all systems in `glib'. Without `glib', the
`#ifdef' routines of my original version of the file must be readded.
Actually, I'm about to write `groffer' in C. I experienced some
troubles with the g++ compiler such that I decided to change some
parts into concepts that are similar to glib. Using the original
`glib' could be a better alternative sometimes.
Are there any troubles to request the availabilty of `glib' for
a proper compilation of the `groff' package (so far just for groffer)?
Bernd Warken
- [Groff] Using C with glib instead of C++ for groff,
Bernd Warken <=
Re: [Groff] Using C with glib instead of C++ for groff, Werner LEMBERG, 2002/11/28