ncurses 5.6 - patch 20080105
[ncurses.git] / ncurses / base / lib_set_term.c
index 922df8a4609964a9990a6ca9b554c16f1c9c5952..8c15de8b05bf88e6bd080e5fabe191995f641a82 100644 (file)
@@ -44,7 +44,7 @@
 #include <term.h>              /* cur_term */
 #include <tic.h>
 
-MODULE_ID("$Id: lib_set_term.c,v 1.99 2007/09/01 21:36:25 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.102 2007/12/29 20:36:32 tom Exp $")
 
 NCURSES_EXPORT(SCREEN *)
 set_term(SCREEN *screenp)
@@ -53,7 +53,7 @@ set_term(SCREEN *screenp)
 
     T((T_CALLED("set_term(%p)"), screenp));
 
-    _nc_lock_mutex(set_SP);
+    _nc_lock_global(set_SP);
 
     oldSP = SP;
     _nc_set_screen(screenp);
@@ -67,7 +67,7 @@ set_term(SCREEN *screenp)
     COLOR_PAIRS = SP->_pair_count;
 #endif
 
-    _nc_unlock_mutex(set_SP);
+    _nc_unlock_global(set_SP);
 
     T((T_RETURN("%p"), oldSP));
     return (oldSP);
@@ -94,7 +94,7 @@ delscreen(SCREEN *sp)
 
     T((T_CALLED("delscreen(%p)"), sp));
 
-    _nc_lock_mutex(set_SP);
+    _nc_lock_global(set_SP);
     while (*scan) {
        if (*scan == sp) {
            *scan = sp->_next_screen;
@@ -168,7 +168,7 @@ delscreen(SCREEN *sp)
 #endif
        _nc_set_screen(0);
     }
-    _nc_unlock_mutex(set_SP);
+    _nc_unlock_global(set_SP);
 
     returnVoid;
 }
@@ -221,9 +221,6 @@ extract_fgbg(char *src, int *result)
 }
 #endif
 
-#define ripoff_sp      _nc_prescreen.rsp
-#define ripoff_stack   _nc_prescreen.rippedoff
-
 /* OS-independent screen initializations */
 NCURSES_EXPORT(int)
 _nc_setupscreen(int slines GCC_UNUSED,
@@ -568,10 +565,12 @@ _nc_setupscreen(int slines GCC_UNUSED,
                        ? SP->_lines_avail - count
                        : 0),
                       0);
-           if (w)
+           if (w) {
+               rop->win = w;
                rop->hook(w, scolumns);
-           else
+           } else {
                returnCode(ERR);
+           }
            if (rop->line < 0)
                bottom_stolen += count;
            else
@@ -622,6 +621,7 @@ _nc_ripoffline(int line, int (*init) (WINDOW *, int))
 NCURSES_EXPORT(int)
 ripoffline(int line, int (*init) (WINDOW *, int))
 {
+    START_TRACE();
     T((T_CALLED("ripoffline(%d,%p)"), line, init));
 
     if (line == 0)