|
From: | Igor Todorovski |
Subject: | RE: Providing an alternative TERMINFO environment variable |
Date: | Tue, 28 Nov 2023 22:34:31 +0000 |
Thanks, NCURSES_TERMINFO makes sense. Unfortunately, we can’t use the compiled-in location because on z/OS we don’t normally have root access and as such, the packages we provide need to be relocatable. That’s another reason why we use the environment variable. Thanks, Igor On 2023-11-28, 4:43 PM, "Thomas Dickey" <dickey@his.com> wrote: On Tue, Nov 28, 2023 at 05:14:26PM +0000, Igor Todorovski wrote: > Hi, > > I’m an IBM z/OS mainframe developer. On z/OS, we have an existing TERMINFO db that is in EBCDIC format and z/OS already check for TERMINFO, but I would like to provide a way to override that with a different environment variable so as
to instruct ncurses where to check for the ascii terminfo. > > I have added the below code to enable setting ASCII_TERMINFO. I’m not sure if the environment variable name is reasonable or not, but the z/OS system default checks for TERMINFO so I needed a way to tell ncurses where to pick up tis terminfo
db. > > Is there a better alternative? I suppose you could call it NCURSES_TERMINFO However, this is used when writing terminfo data, and that normally would be as root (or $HOME/.terminfo), and root's environment shouldn't be cluttered with things like $TERMINFO -- generally speaking the compiled-in value for $TERMINFO satisfies almost all uses. > /* > * Record the "official" location of the terminfo directory, according to > * the place where we're writing to, or the normal default, if not. > */ > NCURSES_EXPORT(const char *) > _nc_tic_dir(const char *path) > { > T(("_nc_tic_dir %s", NonNull(path))); > if (!KeepTicDirectory) { > if (path != NULL) { > if (path != TicDirectory) > update_tic_dir(strdup(path)); > HaveTicDirectory = TRUE; > } else if (HaveTicDirectory == 0) { > if (use_terminfo_vars()) { > const char *envp; > + #ifdef __MVS__ > + if ((envp = getenv("ASCII_TERMINFO")) != 0) > + return _nc_tic_dir(envp); > + if ((envp = getenv("TERMINFO")) != 0) > + #else > if ((envp = getenv("TERMINFO")) != 0) > + #endif > return _nc_tic_dir(envp); > } > } > } > return TicDirectory ? TicDirectory : TERMINFO; > } -- Thomas E. Dickey <dickey@invisible-island.net> |
[Prev in Thread] | Current Thread | [Next in Thread] |