]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/tinfo_driver.c
ncurses 5.7 - patch 20091121
[ncurses.git] / ncurses / tinfo / tinfo_driver.c
index d2df9911803a8c2718b678a38bc1b98d72dde42b..22c31594901b2baeb5a974fe72e282626a3fb095 100644 (file)
 #endif
 #endif
 
-MODULE_ID("$Id: tinfo_driver.c,v 1.1 2009/05/23 22:40:30 juergen Exp $")
+#if HAVE_SIZECHANGE
+# if !defined(sun) || !TERMIOS
+#  if HAVE_SYS_IOCTL_H
+#   include <sys/ioctl.h>
+#  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,
@@ -173,36 +181,7 @@ static int
 drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB)
 {
     AssertTCB();
-    return _nc_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;
-               }
-           }
-       }
-    }
+    return TINFO_DOUPDATE(TCB->csp);
 }
 
 #define ret_error(code, fmt, arg)      if (errret) {\
@@ -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);
@@ -945,7 +924,7 @@ drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, int yold, int xold, int ynew, int xnew)
 {
     SCREEN *sp = TCB->csp;
     AssertTCB();
-    return _nc_tinfo_mvcur(sp, yold, xold, ynew, xnew);
+    return TINFO_MVCUR(sp, yold, xold, ynew, xnew);
 }
 
 static void
@@ -1383,7 +1362,7 @@ drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int key)
 
     AssertTCB();
     if (TCB->csp)
-       res = _nc_tinfo_has_key(TCB->csp, key) == 0 ? FALSE : TRUE;
+       res = TINFO_HAS_KEY(TCB->csp, key) == 0 ? FALSE : TRUE;
 
     return res;
 }