[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Portable menu and forms libraries
From: |
Bill Gray |
Subject: |
Re: Portable menu and forms libraries |
Date: |
Sun, 21 Jul 2024 16:29:49 -0400 |
User-agent: |
Mozilla Thunderbird |
Hi Thomas,
On 7/21/24 06:02, Thomas Dickey wrote:
offhand, I see (aside from the trace functions) curses.priv.h included
to provide _nc_screen_of and _nc_wcrtomb, which could be polished and given
a generic name via a #define - and the former is used only for the _sp
functions.
And/or both could be stubbed out easily enough; i.e., if you want
to use those libraries with PDCurses*, you add
SCREEN *_nc_screen_of( WINDOW *unused_pointer)
{
return SP; /* the only screen PDCurses* currently has */
}
size_t _nc_wcrtomb( char *s, wchar_t wc, mbstate_t *ps)
{
return wcrtomb( s, wc, ps);
}
to your code (maybe modifying the second function on some
platforms), and... you're done?
The various trace calls are all macros, which could be stubbed out in
pdcurses to mock up a curses.priv.h
But I haven't tried making a pdcurses-style "curses.priv.h" to see what
else is going to be a problem :-)
Warning taken, but this does look as if it may be much more
straightforward than I'd thought. With the above trickery, it would at
least appear the libraries can be used unaltered... which would be
amazing. I'll give it a try and see what explodes.
Thanks! -- Bill