|
From: | Igor Todorovski |
Subject: | Providing an alternative TERMINFO environment variable |
Date: | Tue, 28 Nov 2023 17:14:26 +0000 |
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? /* * 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; } |
[Prev in Thread] | Current Thread | [Next in Thread] |