X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=ncurses%2Ftinfo%2Ftinfo_driver.c;h=22c31594901b2baeb5a974fe72e282626a3fb095;hb=49e6baa94900e73cfc440dcb54c4f2eeda462ad8;hp=990b1773fb44556d9ede965fae62aa4578712f84;hpb=3f5a74a97cf8d86a8a8a78c7b268f49ccdc4101c;p=ncurses.git diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index 990b1773..22c31594 100644 --- a/ncurses/tinfo/tinfo_driver.c +++ b/ncurses/tinfo/tinfo_driver.c @@ -42,7 +42,15 @@ #endif #endif -MODULE_ID("$Id: tinfo_driver.c,v 1.2 2009/08/16 14:17:08 tom Exp $") +#if HAVE_SIZECHANGE +# if !defined(sun) || !TERMIOS +# if HAVE_SYS_IOCTL_H +# include +# endif +# endif +#endif + +MODULE_ID("$Id: tinfo_driver.c,v 1.5 2009/10/31 20:32:01 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -176,35 +184,6 @@ drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) return TINFO_DOUPDATE(TCB->csp); } -/* -** do_prototype() -** -** Take the real command character out of the CC environment variable -** and substitute it in for the prototype given in 'command_character'. -*/ -static void -do_prototype(TERMINAL * termp) -{ - unsigned i; - char CC; - char proto; - char *tmp; - TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; - - if ((tmp = getenv("CC")) != 0) { - if ((CC = *tmp) != 0) { - proto = *command_character; - - for_each_string(i, &(termp->type)) { - for (tmp = termp->type.Strings[i]; *tmp; tmp++) { - if (*tmp == proto) - *tmp = CC; - } - } - } - } -} - #define ret_error(code, fmt, arg) if (errret) {\ *errret = code;\ return(FALSE); \ @@ -296,8 +275,8 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) ttytype[NAMESIZE - 1] = '\0'; #endif - if (command_character && getenv("CC")) - do_prototype(termp); + if (command_character) + _nc_tinfo_cmdch(termp, *command_character); if (generic_type) { ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname);