* Copyright (c) 1982 Regents of the University of California.
* This code is derived from software contributed to Berkeley by
* Edward Wang at The University of California, Berkeley.
* %sccs.include.redist.c%
static char sccsid
[] = "@(#)wwterminfo.c 3.1 (Berkeley) %G%";
* Written by Brian Buhrow
* Subsequently modified by Edward Wang
* Initialize the working terminfo directory
(void) sprintf(wwterminfopath
, "%swwinXXXXXX", _PATH_TMP
);
if (mkdir(wwterminfopath
, 0755) < 0 ||
chmod(wwterminfopath
, 00755) < 0) {
(void) setenv("TERMINFO", wwterminfopath
, 1);
/* make a termcap entry and turn it into terminfo */
(void) sprintf(buf
, "%s/cap", wwterminfopath
);
if ((fp
= fopen(buf
, "w")) == NULL
) {
(void) fprintf(fp
, "%sco#%d:li#%d:%s\n",
WWT_TERMCAP
, wwncol
, wwnrow
, wwwintermcap
);
"cd %s; %s cap >info 2>/dev/null; %s info >/dev/null 2>&1",
wwterminfopath
, _PATH_CAPTOINFO
, _PATH_TIC
);
* Delete the working terminfo directory at shutdown
/* can't really do (or say) anything about errors */
execl(_PATH_RM
, _PATH_RM
, "-rf", wwterminfopath
, 0);