[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Help wanted with bkgd() rookie mistake
From: |
Thomas Dickey |
Subject: |
Re: Help wanted with bkgd() rookie mistake |
Date: |
Sun, 5 Jan 2025 13:33:02 -0500 |
On Sun, Jan 05, 2025 at 12:17:15PM -0600, G. Branden Robinson wrote:
> Hi Bill,
>
> At 2025-01-05T13:06:31-0500, Bill Gray wrote:
> > On 1/5/25 11:23, G. Branden Robinson wrote:
> > > Hi folks,
> > >
> > > I come once again to confess my confusion with basic curses operations.
> > >
> > > Please find attached two C programs; I call them "bkgd" and "bkgrnd",
> > > because they correspond to curses functions of the same name.
> > >
> > > bkgrnd, the wide-character program, works fine.
> > >
> > > bkgd, which you'd think would be simpler, doesn't.
> > >
> > > In both, I expect the background character to be set to an underlined @
> > > sign.
> >
> > I see the background as underlined @ signs with both programs. I'm using
> > (default, system-installed, now getting to be elderly) ncurses
> > 6.2.20200212. So perhaps a behavior change between then and now?
>
> Hmm. That may be. I'm on the bleeding edge with 6.5.20250104.
Both programs look fine to me, but I don't replace the system (n)curses,
but rather use the test-packages whose build-scripts are in the
"packages" directory.
For those, I was testing with the wide-character library either way
bkgd:
linux-vdso.so.1 (0x00007ffc5b99a000)
libncursesw6.so.6 => /lib/x86_64-linux-gnu/libncursesw6.so.6
(0x00007f43130c7000)
libtinfow6.so.6 => /lib/x86_64-linux-gnu/libtinfow6.so.6
(0x00007f431308c000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4312eab000)
/lib64/ld-linux-x86-64.so.2 (0x00007f431313b000)
bkgrnd:
linux-vdso.so.1 (0x00007fffd31d9000)
libncursesw6.so.6 => /lib/x86_64-linux-gnu/libncursesw6.so.6
(0x00007ff0cf47f000)
libtinfow6.so.6 => /lib/x86_64-linux-gnu/libtinfow6.so.6
(0x00007ff0cf444000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff0cf263000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff0cf4f3000)
and defining NCURSES_WIDECHAR when compiling.
(I have non-wide "ABI 5" libraries to verify things, but don't package those)
> I'll have to uninstall my ncurses and use my similarly geriatric system
> version...
>
> ...nope, it still reproduces even after uninstalling, deleting "bkgd",
> and re-make(1)ing.
>
> $ ldd ./bkgd
> linux-vdso.so.1 (0x00007ffd6f0f9000)
> libncurses.so.6 => /lib/x86_64-linux-gnu/libncurses.so.6
> (0x00007f4be605d000)
> libtinfo.so.6 => /lib/x86_64-linux-gnu/libtinfo.so.6
> (0x00007f4be602e000)
> libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f4be5e5a000)
> libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f4be5e54000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f4be60b1000)
> $ dpkg -S /lib/x86_64-linux-gnu/libncurses.so.6
> libncurses6:amd64: /lib/x86_64-linux-gnu/libncurses.so.6
> $ dpkg -s libncurses6:amd64 | grep -i version
> Version: 6.2+20201114-2+deb11u2
>
> The wide-character exhibit, "bkgrnd", continues to work fine, displaying
> both the "@" and an underline in every character cell.
>
> > However, both PDCurses and PDCursesMod show @ with no underscore. I
> > agree that this seems wrong.
> >
> > (BTW, why do you have tests for NCURSES_VERSION and NCURSES_OPAQUE? It
> > looks to me as if you aren't using anything ncurses-specific and that your
> > code doesn't rely on opaqueness. FWIW, PDCursesMod has opaque window and
> > screen structures; PDCurses doesn't.)
>
> Sorry for the red herrings. You're right; those preprocessor tests are
> irrelevant to this program. It's boilerplate that I've copied among a
> bunch of little C programs I write to teach myself the library (and help
> myself to tell the truth in the man pages).
I have seen comments that ncurses-examples aren't simple...
--
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net
signature.asc
Description: PGP signature
- Help wanted with bkgd() rookie mistake, G. Branden Robinson, 2025/01/05
- Re: Help wanted with bkgd() rookie mistake, Bill Gray, 2025/01/05
- Re: Help wanted with bkgd() rookie mistake, G. Branden Robinson, 2025/01/05
- Re: Help wanted with bkgd() rookie mistake,
Thomas Dickey <=
- Re: Help wanted with bkgd() rookie mistake, G. Branden Robinson, 2025/01/05
- Re: Help wanted with bkgd() rookie mistake, Thomas Dickey, 2025/01/05
- Re: Help wanted with bkgd() rookie mistake, G. Branden Robinson, 2025/01/05
- SOLVED: Help wanted with bkgd() rookie mistake, G. Branden Robinson, 2025/01/05
- Re: Help wanted with bkgd() rookie mistake, Thomas Dickey, 2025/01/05