[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: terminfo and terminfow libraries

From: Stanislav Ievlev
Subject: Re: terminfo and terminfow libraries
Date: Fri, 30 Jan 2004 12:15:36 +0300

On Wed, Jan 28, 2004 at 08:16:20AM -0500, Thomas Dickey wrote:
> On Wed, 28 Jan 2004, Stanislav Ievlev wrote:
> > Hello, friends!
> >
> > Why ncurses needs two version of lowlevel terminfo library:
> > with widechar support and without widechar support?
> >
> > It's better for vendors to have single terminfo library, when this
> > library is used as a replacement of old termcap library.
> I suppose so (hadn't considered it).  Will add to to-do list for 5.5
We (ALT) have made little research for this problem, 'cause we use tinfo
instead of termcap and can't wait for 5.5.
We try to use libtinfow as a single library both for libncurses and for 
We compare libtinfo and libtinfow for API/ABI (checking both compiled object 
files, preprocessor results and assembler code). There are following results 

1.(not a problem) libtinfow added new symbol key_name
2.(not a problem) libtinfow added new functions _nc_unicode_locale() and 
Added code are little and will work both in wide-char and non-wide-char 

   if (_nc_unicode_locale() && _nc_locale_breaks_acs()) {
         acs_chars = NULL;
          ena_acs = NULL;

3. (problem). _nc_outch() functions use screen structure. This structure
is differ in unicode and non-unicode versions (different offsets for the common 
        /* recent versions of 'screen' have partially-working support for
         * UTF-8, but do not permit ACS at the same time (see
         * tty_update.c).
        bool            _posix_locale;
        bool            _screen_acs_fix;

        bool            _cleanup;       /* cleanup after int/quit signal
        int             (*_outch)(int); /* output handler if not putc */

As a result we have different code , when some code work with _cleanup and 
_outchar fields, because they have different offset in unicode and non-unicode 

As I see this "#if", was added _only_ in 5.4 version. So we have a chance to
fix this problem, by replacing added elements to the end of structure.

If _posix_locale and _screen_acs_fix live at the end of struct, following
code in _nc_outch will same in unicode and non-unicode versions.

if (SP != 0
        && SP->_cleanup) {

Patch, we made for our distribution you can find in attach.

Results: after fixing of the problem #3 you can easy made single version
of the libtinfo both for unicode and non-unicode ncurses.

With best regards
Stanislav Ievlev

Attachment: ncurses-5.3-alt-utf8-fix.patch
Description: Text document

reply via email to

[Prev in Thread] Current Thread [Next in Thread]