]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tinfo/tinfo_driver.c
ncurses 5.9 - patch 20130824
[ncurses.git] / ncurses / tinfo / tinfo_driver.c
index 5f2051b5b2eec7c119496745fe91e0c4b281d2bb..84611c83b46be3440dae795af3a178a2b8e8fc7f 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2008-2011,2012 Free Software Foundation, Inc.              *
+ * Copyright (c) 2008-2012,2013 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -50,7 +50,7 @@
 # endif
 #endif
 
-MODULE_ID("$Id: tinfo_driver.c,v 1.25 2012/12/22 21:44:10 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.30 2013/05/25 20:16:46 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -119,7 +119,7 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret)
     sp = TCB->csp;
     TCB->magic = TCBMAGIC;
 
-#if (USE_DATABASE || USE_TERMCAP)
+#if (NCURSES_USE_DATABASE || NCURSES_USE_TERMCAP)
     status = _nc_setup_tinfo(tname, &termp->type);
 #else
     status = TGETENT_NO;
@@ -184,22 +184,18 @@ drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, int beepFlag)
     /* FIXME: should make sure that we are not in altchar mode */
     if (beepFlag) {
        if (bell) {
-           res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell);
+           res = NCURSES_PUTP2("bell", bell);
            NCURSES_SP_NAME(_nc_flush) (sp);
        } else if (flash_screen) {
-           res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
-                                            "flash_screen",
-                                            flash_screen);
+           res = NCURSES_PUTP2("flash_screen", flash_screen);
            NCURSES_SP_NAME(_nc_flush) (sp);
        }
     } else {
        if (flash_screen) {
-           res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
-                                            "flash_screen",
-                                            flash_screen);
+           res = NCURSES_PUTP2("flash_screen", flash_screen);
            NCURSES_SP_NAME(_nc_flush) (sp);
        } else if (bell) {
-           res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell);
+           res = NCURSES_PUTP2("bell", bell);
            NCURSES_SP_NAME(_nc_flush) (sp);
        }
     }
@@ -315,7 +311,7 @@ drv_rescol(TERMINAL_CONTROL_BLOCK * TCB)
     SetSP();
 
     if (orig_pair != 0) {
-       NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_pair", orig_pair);
+       NCURSES_PUTP2("orig_pair", orig_pair);
        result = TRUE;
     }
     return result;
@@ -331,7 +327,7 @@ drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB)
     SetSP();
 
     if (orig_colors != 0) {
-       NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_colors", orig_colors);
+       NCURSES_PUTP2("orig_colors", orig_colors);
        result = TRUE;
     }
     return result;
@@ -693,12 +689,11 @@ drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, int pair, int f, int b)
            tp[f].red, tp[f].green, tp[f].blue,
            tp[b].red, tp[b].green, tp[b].blue));
 
-       NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
-                                  "initialize_pair",
-                                  TPARM_7(initialize_pair,
-                                          pair,
-                                          tp[f].red, tp[f].green, tp[f].blue,
-                                          tp[b].red, tp[b].green, tp[b].blue));
+       NCURSES_PUTP2("initialize_pair",
+                     TPARM_7(initialize_pair,
+                             pair,
+                             tp[f].red, tp[f].green, tp[f].blue,
+                             tp[b].red, tp[b].green, tp[b].blue));
     }
 }
 
@@ -730,9 +725,8 @@ drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB,
 
     AssertTCB();
     if (initialize_color != NULL) {
-       NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
-                                  "initialize_color",
-                                  TPARM_4(initialize_color, color, r, g, b));
+       NCURSES_PUTP2("initialize_color",
+                     TPARM_4(initialize_color, color, r, g, b));
     }
 }
 
@@ -896,7 +890,7 @@ drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, int yold, int xold, int ynew, int xnew)
 {
     SCREEN *sp = TCB->csp;
     AssertTCB();
-    return TINFO_MVCUR(sp, yold, xold, ynew, xnew);
+    return NCURSES_SP_NAME(_nc_mvcur) (sp, yold, xold, ynew, xnew);
 }
 
 static void
@@ -906,9 +900,8 @@ drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, int labnum, char *text)
 
     AssertTCB();
     if (labnum > 0 && labnum <= num_labels) {
-       NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx
-                                  "plab_norm",
-                                  TPARM_2(plab_norm, labnum, text));
+       NCURSES_PUTP2("plab_norm",
+                     TPARM_2(plab_norm, labnum, text));
     }
 }
 
@@ -919,9 +912,9 @@ drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, int OnFlag)
 
     AssertTCB();
     if (OnFlag) {
-       NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_on", label_on);
+       NCURSES_PUTP2("label_on", label_on);
     } else {
-       NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_off", label_off);
+       NCURSES_PUTP2("label_off", label_off);
     }
 }
 
@@ -986,7 +979,7 @@ drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, chtype *real_map, chtype *fake_map)
     AssertTCB();
     assert(sp != 0);
     if (ena_acs != NULL) {
-       NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "ena_acs", ena_acs);
+       NCURSES_PUTP2("ena_acs", ena_acs);
     }
 #if NCURSES_EXT_FUNCS
     /*
@@ -1150,8 +1143,7 @@ _nc_cookie_init(SCREEN *sp)
 
     /* initialize normal acs before wide, since we use mapping in the latter */
 #if !USE_WIDEC_SUPPORT
-    sp->_screen_unicode = _nc_unicode_locale();
-    if (sp->screen_unicode && _nc_locale_breaks_acs(sp->_term)) {
+    if (_nc_unicode_locale() && _nc_locale_breaks_acs(sp->_term)) {
        acs_chars = NULL;
        ena_acs = NULL;
        enter_alt_charset_mode = NULL;
@@ -1224,7 +1216,7 @@ __nc_putp(SCREEN *sp, const char *name GCC_UNUSED, const char *value)
     int rc = ERR;
 
     if (value) {
-       rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value);
+       rc = NCURSES_PUTP2(name, value);
     }
     return rc;
 }