home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / bsd / 11034 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  20.1 KB

  1. Path: sparky!uunet!mcsun!fuug!kiae!demos!newsserv
  2. From: "Andrew A. Chernov, Black Mage" <ache@astral.msk.su>
  3. Newsgroups: comp.unix.bsd
  4. Subject: [386bsd] Patch for curses library, make it clean 8-bit
  5. Date: Fri, 08 Jan 93 18:06:29 +0300
  6. Distribution: world
  7. Organization: Ha-oh-lahm Yetzirah
  8. Message-ID: <WHrXPJh8b6@astral.msk.su>
  9. Sender: news-service@newcom.kiae.su
  10. Reply-To: ache@astral.msk.su
  11. Lines: 864
  12.  
  13. Standard curses library use eight bit for standout mode, so
  14. 8-bit characters displays like highlighted 7-bit characters.
  15.  
  16. This patch produce library which is fully compatible with all curses
  17. programs and add 8-bit chars to all input/display functions.
  18.  
  19. *** addbytes.c.was    Sun Apr 21 00:13:50 1991
  20. --- addbytes.c    Fri Jan  8 15:46:02 1993
  21. ***************
  22. *** 37,49 ****
  23.   
  24.   # include    "curses.ext"
  25.   
  26.   /*
  27.    *    This routine adds the character to the current position
  28.    *
  29.    */
  30. ! waddbytes(win, bytes, count)
  31.   reg WINDOW    *win;
  32. ! reg char    *bytes;
  33.   reg int        count;
  34.   {
  35.   #define    SYNCH_OUT()    {win->_cury = y; win->_curx = x;}
  36. --- 37,65 ----
  37.   
  38.   # include    "curses.ext"
  39.   
  40. + waddbytes(win, bytes, count)
  41. + reg WINDOW    *win;
  42. + reg char        *bytes;
  43. + int         count;
  44. + {
  45. +     chtype c;
  46. +     reg int i;
  47. +     for (i = 0; i < count; i++) {
  48. +         c = (unsigned char) *bytes++;
  49. +         if (_waddbytes(win, &c, 1) == ERR)
  50. +             return ERR;
  51. +     }
  52. +     return OK;
  53. + }
  54.   /*
  55.    *    This routine adds the character to the current position
  56.    *
  57.    */
  58. ! _waddbytes(win, bytes, count)
  59.   reg WINDOW    *win;
  60. ! reg chtype      *bytes;
  61.   reg int        count;
  62.   {
  63.   #define    SYNCH_OUT()    {win->_cury = y; win->_curx = x;}
  64. ***************
  65. *** 52,69 ****
  66.       reg int        newx;
  67.   
  68.       SYNCH_IN();
  69. - # ifdef FULLDEBUG
  70. -     fprintf(outf, "ADDBYTES('%c') at (%d, %d)\n", c, y, x);
  71. - # endif
  72.       while (count--) {
  73. !         register int c;
  74. !         static char blanks[] = "        ";
  75.   
  76.           c = *bytes++;
  77.           switch (c) {
  78.             case '\t':
  79.               SYNCH_IN();
  80. !             if (waddbytes(win, blanks, 8-(x%8)) == ERR) {
  81.               return ERR;
  82.               }
  83.               SYNCH_OUT();
  84. --- 68,82 ----
  85.       reg int        newx;
  86.   
  87.       SYNCH_IN();
  88.       while (count--) {
  89. !         register chtype c;
  90. !         static chtype blanks[] = {' ',' ',' ',' ',' ',' ',' ',' '};
  91.   
  92.           c = *bytes++;
  93.           switch (c) {
  94.             case '\t':
  95.               SYNCH_IN();
  96. !             if (_waddbytes(win, blanks, 8-(x%8)) == ERR) {
  97.               return ERR;
  98.               }
  99.               SYNCH_OUT();
  100. *** addch.c.was    Sun Apr 21 00:13:50 1991
  101. --- addch.c    Fri Jan  8 15:40:46 1993
  102. ***************
  103. *** 43,49 ****
  104.    */
  105.   waddch(win, c)
  106.   WINDOW    *win;
  107. ! char        c;
  108.   {
  109. !     return waddbytes(win, &c, 1);
  110.   }
  111. --- 43,49 ----
  112.    */
  113.   waddch(win, c)
  114.   WINDOW    *win;
  115. ! chtype c;
  116.   {
  117. !     return _waddbytes(win, &c, 1);
  118.   }
  119. *** addstr.c.was    Sun Apr 21 00:13:50 1991
  120. --- addstr.c    Fri Jan  8 17:22:38 1993
  121. ***************
  122. *** 43,52 ****
  123.    */
  124.   waddstr(win,str)
  125.   reg WINDOW    *win; 
  126. ! reg char    *str;
  127.   {
  128.   # ifdef DEBUG
  129.       fprintf(outf, "WADDSTR(\"%s\")\n", str);
  130.   # endif
  131. !     return waddbytes(win, str, strlen(str));
  132.   }
  133. --- 43,59 ----
  134.    */
  135.   waddstr(win,str)
  136.   reg WINDOW    *win; 
  137. ! char        *str;
  138.   {
  139. +     chtype c;
  140. +     reg char *s;
  141.   # ifdef DEBUG
  142.       fprintf(outf, "WADDSTR(\"%s\")\n", str);
  143.   # endif
  144. !     for (s = str; *s;) {
  145. !         c = (unsigned char) *s++;
  146. !         if (_waddbytes(win, &c, 1) == ERR)
  147. !             return ERR;
  148. !     }
  149. !     return OK;
  150.   }
  151. *** box.c.was    Sun Apr 21 00:13:50 1991
  152. --- box.c    Fri Jan  8 17:00:54 1993
  153. ***************
  154. *** 44,54 ****
  155.    */
  156.   box(win, vert, hor)
  157.   reg WINDOW    *win;
  158. ! char        vert, hor; {
  159.   
  160.       reg int        i;
  161.       reg int        endy, endx;
  162. !     reg char    *fp, *lp;
  163.   
  164.       endx = win->_maxx;
  165.       endy = win->_maxy - 1;
  166. --- 44,54 ----
  167.    */
  168.   box(win, vert, hor)
  169.   reg WINDOW    *win;
  170. ! chtype vert, hor; {
  171.   
  172.       reg int        i;
  173.       reg int        endy, endx;
  174. !     reg chtype      *fp, *lp;
  175.   
  176.       endx = win->_maxx;
  177.       endy = win->_maxy - 1;
  178. *** clrtobot.c.was    Sun Apr 21 00:13:51 1991
  179. --- clrtobot.c    Fri Jan  8 15:51:42 1993
  180. ***************
  181. *** 45,51 ****
  182.   reg WINDOW    *win; {
  183.   
  184.       reg int        y;
  185. !     reg char    *sp, *end, *maxx;
  186.       reg int        startx, minx;
  187.   
  188.       startx = win->_curx;
  189. --- 45,51 ----
  190.   reg WINDOW    *win; {
  191.   
  192.       reg int        y;
  193. !     reg chtype      *sp, *end, *maxx;
  194.       reg int        startx, minx;
  195.   
  196.       startx = win->_curx;
  197. *** clrtoeol.c.was    Sun Apr 21 00:13:51 1991
  198. --- clrtoeol.c    Fri Jan  8 15:53:06 1993
  199. ***************
  200. *** 44,52 ****
  201.   wclrtoeol(win)
  202.   reg WINDOW    *win; {
  203.   
  204. !     reg char    *sp, *end;
  205.       reg int        y, x;
  206. !     reg char    *maxx;
  207.       reg int        minx;
  208.   
  209.       y = win->_cury;
  210. --- 44,52 ----
  211.   wclrtoeol(win)
  212.   reg WINDOW    *win; {
  213.   
  214. !     reg chtype      *sp, *end;
  215.       reg int        y, x;
  216. !     reg chtype      *maxx;
  217.       reg int        minx;
  218.   
  219.       y = win->_cury;
  220. *** cr_put.c.was    Sun Apr 21 00:13:51 1991
  221. --- cr_put.c    Fri Jan  8 16:46:36 1993
  222. ***************
  223. *** 180,185 ****
  224. --- 180,186 ----
  225.   {
  226.       register int i, j, k;
  227.       register int soutcol, soutline;
  228. +     chtype ch;
  229.   
  230.       plodcnt = plodflg = cnt;
  231.       soutcol = outcol;
  232. ***************
  233. *** 373,381 ****
  234.               if (plodflg)    /* avoid a complex calculation */
  235.                   plodcnt--;
  236.               else {
  237. !                 i = curscr->_y[outline][outcol];
  238. !                 if ((i&_STANDOUT) == (curscr->_flags&_STANDOUT))
  239. !                     _putchar(i & 0177);
  240.                   else
  241.                       goto nondes;
  242.               }
  243. --- 374,382 ----
  244.               if (plodflg)    /* avoid a complex calculation */
  245.                   plodcnt--;
  246.               else {
  247. !                 ch = curscr->_y[outline][outcol];
  248. !                 if ((ch&_STANDOUT) == (curscr->_flags&_STANDOUT))
  249. !                     _putchar(ch);
  250.                   else
  251.                       goto nondes;
  252.               }
  253. *** curses.h.was    Sun Apr 21 00:13:52 1991
  254. --- curses.h    Fri Jan  8 17:03:22 1993
  255. ***************
  256. *** 44,49 ****
  257. --- 44,51 ----
  258.   #define    bool    char
  259.   #define    reg    register
  260.   
  261. + typedef unsigned short chtype;
  262.   #define    TRUE    (1)
  263.   #define    FALSE    (0)
  264.   #define    ERR    (0)
  265. ***************
  266. *** 55,61 ****
  267.   #define    _FLUSH        010
  268.   #define    _FULLLINE    020
  269.   #define    _IDLINE        040
  270. ! #define    _STANDOUT    0200
  271.   #define    _NOCHANGE    -1
  272.   
  273.   #define    _puts(s)    tputs(s, 0, _putchar)
  274. --- 57,63 ----
  275.   #define    _FLUSH        010
  276.   #define    _FULLLINE    020
  277.   #define    _IDLINE        040
  278. ! #define _STANDOUT       0400
  279.   #define    _NOCHANGE    -1
  280.   
  281.   #define    _puts(s)    tputs(s, 0, _putchar)
  282. ***************
  283. *** 92,98 ****
  284.       bool        _clear;
  285.       bool        _leave;
  286.       bool        _scroll;
  287. !     char        **_y;
  288.       short        *_firstch;
  289.       short        *_lastch;
  290.       struct _win_st    *_nextp, *_orig;
  291. --- 94,100 ----
  292.       bool        _clear;
  293.       bool        _leave;
  294.       bool        _scroll;
  295. !     chtype          **_y;
  296.       short        *_firstch;
  297.       short        *_lastch;
  298.       struct _win_st    *_nextp, *_orig;
  299. ***************
  300. *** 127,133 ****
  301.   #define    addch(ch)    VOID(waddch(stdscr, ch))
  302.   #define    getch()        VOID(wgetch(stdscr))
  303.   #define    addbytes(da,co)    VOID(waddbytes(stdscr, da,co))
  304. ! #define    addstr(str)    VOID(waddbytes(stdscr, str, strlen(str)))
  305.   #define    getstr(str)    VOID(wgetstr(stdscr, str))
  306.   #define    move(y, x)    VOID(wmove(stdscr, y, x))
  307.   #define    clear()        VOID(wclear(stdscr))
  308. --- 129,135 ----
  309.   #define    addch(ch)    VOID(waddch(stdscr, ch))
  310.   #define    getch()        VOID(wgetch(stdscr))
  311.   #define    addbytes(da,co)    VOID(waddbytes(stdscr, da,co))
  312. ! #define addstr(str)     VOID(waddstr(stdscr, str))
  313.   #define    getstr(str)    VOID(wgetstr(stdscr, str))
  314.   #define    move(y, x)    VOID(wmove(stdscr, y, x))
  315.   #define    clear()        VOID(wclear(stdscr))
  316. ***************
  317. *** 151,157 ****
  318.   #define    mvwaddbytes(win,y,x,da,co) \
  319.           VOID(wmove(win,y,x)==ERR?ERR:waddbytes(win,da,co))
  320.   #define    mvwaddstr(win,y,x,str) \
  321. !         VOID(wmove(win,y,x)==ERR?ERR:waddbytes(win,str,strlen(str)))
  322.   #define mvwgetstr(win,y,x,str)  VOID(wmove(win,y,x)==ERR?ERR:wgetstr(win,str))
  323.   #define    mvwinch(win,y,x)    VOID(wmove(win,y,x) == ERR ? ERR : winch(win))
  324.   #define    mvwdelch(win,y,x)    VOID(wmove(win,y,x) == ERR ? ERR : wdelch(win))
  325. --- 153,159 ----
  326.   #define    mvwaddbytes(win,y,x,da,co) \
  327.           VOID(wmove(win,y,x)==ERR?ERR:waddbytes(win,da,co))
  328.   #define    mvwaddstr(win,y,x,str) \
  329. !         VOID(wmove(win,y,x)==ERR?ERR:waddstr(win,str))
  330.   #define mvwgetstr(win,y,x,str)  VOID(wmove(win,y,x)==ERR?ERR:wgetstr(win,str))
  331.   #define    mvwinch(win,y,x)    VOID(wmove(win,y,x) == ERR ? ERR : winch(win))
  332.   #define    mvwdelch(win,y,x)    VOID(wmove(win,y,x) == ERR ? ERR : wdelch(win))
  333. ***************
  334. *** 174,180 ****
  335.   #define    scrollok(win,bf) (win->_scroll = bf)
  336.   #define flushok(win,bf)     (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH))
  337.   #define    getyx(win,y,x)     y = win->_cury, x = win->_curx
  338. ! #define    winch(win)     (win->_y[win->_cury][win->_curx] & 0177)
  339.   
  340.   #define raw()     (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, \
  341.       ioctl(_tty_ch, TIOCSETP, &_tty))
  342. --- 176,182 ----
  343.   #define    scrollok(win,bf) (win->_scroll = bf)
  344.   #define flushok(win,bf)     (bf ? (win->_flags |= _FLUSH):(win->_flags &= ~_FLUSH))
  345.   #define    getyx(win,y,x)     y = win->_cury, x = win->_curx
  346. ! #define winch(win)       (win->_y[win->_cury][win->_curx] & 0xFF)
  347.   
  348.   #define raw()     (_tty.sg_flags|=RAW, _pfast=_rawmode=TRUE, \
  349.       ioctl(_tty_ch, TIOCSETP, &_tty))
  350. *** delch.c.was    Sun Apr 21 00:13:52 1991
  351. --- delch.c    Fri Jan  8 15:56:16 1993
  352. ***************
  353. *** 45,53 ****
  354.   wdelch(win)
  355.   reg WINDOW    *win; {
  356.   
  357. !     reg char    *temp1, *temp2;
  358. !     reg char    *end;
  359. !     reg int        lch;
  360.   
  361.       end = &win->_y[win->_cury][win->_maxx - 1];
  362.       temp1 = &win->_y[win->_cury][win->_curx];
  363. --- 45,52 ----
  364.   wdelch(win)
  365.   reg WINDOW    *win; {
  366.   
  367. !     reg chtype      *temp1, *temp2;
  368. !     reg chtype      *end;
  369.   
  370.       end = &win->_y[win->_cury][win->_maxx - 1];
  371.       temp1 = &win->_y[win->_cury][win->_curx];
  372. *** deleteln.c.was    Sun Apr 21 00:13:52 1991
  373. --- deleteln.c    Fri Jan  8 16:00:59 1993
  374. ***************
  375. *** 45,53 ****
  376.   wdeleteln(win)
  377.   reg WINDOW    *win;
  378.   {
  379. !     reg char    *temp;
  380.       reg int        y;
  381. !     reg char    *end;
  382.       reg int        x;
  383.   
  384.   # ifdef DEBUG
  385. --- 45,53 ----
  386.   wdeleteln(win)
  387.   reg WINDOW    *win;
  388.   {
  389. !     reg chtype      *temp;
  390.       reg int        y;
  391. !     reg chtype      *end;
  392.       reg int        x;
  393.   
  394.   # ifdef DEBUG
  395. ***************
  396. *** 58,64 ****
  397.           if (win->_orig == NULL)
  398.               win->_y[y] = win->_y[y + 1];
  399.           else
  400. !             bcopy(win->_y[y + 1], win->_y[y], win->_maxx);
  401.           touchline(win, y, 0, win->_maxx - 1);
  402.       }
  403.       if (win->_orig == NULL)
  404. --- 58,64 ----
  405.           if (win->_orig == NULL)
  406.               win->_y[y] = win->_y[y + 1];
  407.           else
  408. !             bcopy(win->_y[y + 1], win->_y[y], win->_maxx * sizeof(chtype));
  409.           touchline(win, y, 0, win->_maxx - 1);
  410.       }
  411.       if (win->_orig == NULL)
  412. *** erase.c.was    Sun Apr 21 00:13:53 1991
  413. --- erase.c    Fri Jan  8 16:03:21 1993
  414. ***************
  415. *** 45,51 ****
  416.   reg WINDOW    *win; {
  417.   
  418.       reg int        y;
  419. !     reg char    *sp, *end, *start, *maxx;
  420.       reg int        minx;
  421.   
  422.   # ifdef DEBUG
  423. --- 45,51 ----
  424.   reg WINDOW    *win; {
  425.   
  426.       reg int        y;
  427. !     reg chtype      *sp, *end, *start, *maxx;
  428.       reg int        minx;
  429.   
  430.   # ifdef DEBUG
  431. *** getch.c.was    Sun Apr 21 00:13:53 1991
  432. --- getch.c    Fri Jan  8 16:06:46 1993
  433. ***************
  434. *** 45,51 ****
  435.   reg WINDOW    *win; {
  436.   
  437.       reg bool    weset = FALSE;
  438. !     reg char    inp;
  439.   
  440.       if (!win->_scroll && (win->_flags&_FULLWIN)
  441.           && win->_curx == win->_maxx - 1 && win->_cury == win->_maxy - 1)
  442. --- 45,51 ----
  443.   reg WINDOW    *win; {
  444.   
  445.       reg bool    weset = FALSE;
  446. !     reg int         inp;
  447.   
  448.       if (!win->_scroll && (win->_flags&_FULLWIN)
  449.           && win->_curx == win->_maxx - 1 && win->_cury == win->_maxy - 1)
  450. ***************
  451. *** 58,70 ****
  452.           weset++;
  453.       }
  454.       inp = getchar();
  455.   # ifdef DEBUG
  456.       fprintf(outf,"WGETCH got '%s'\n",unctrl(inp));
  457.   # endif
  458.       if (_echoit) {
  459.           mvwaddch(curscr, win->_cury + win->_begy,
  460. !             win->_curx + win->_begx, inp);
  461. !         waddch(win, inp);
  462.       }
  463.       if (weset)
  464.           nocbreak();
  465. --- 58,72 ----
  466.           weset++;
  467.       }
  468.       inp = getchar();
  469. +     if (inp != EOF) {
  470.   # ifdef DEBUG
  471.           fprintf(outf,"WGETCH got '%s'\n",unctrl(inp));
  472.   # endif
  473.           if (_echoit) {
  474.               mvwaddch(curscr, win->_cury + win->_begy,
  475. !                 win->_curx + win->_begx, (unsigned char) inp);
  476. !             waddch(win, (unsigned char) inp);
  477. !         }
  478.       }
  479.       if (weset)
  480.           nocbreak();
  481. *** getstr.c.was    Sun Apr 21 00:13:54 1991
  482. --- getstr.c    Fri Jan  8 16:09:33 1993
  483. ***************
  484. *** 44,56 ****
  485.   wgetstr(win,str)
  486.   reg WINDOW    *win; 
  487.   reg char    *str; {
  488.   
  489. !     while ((*str = wgetch(win)) != ERR && *str != '\n')
  490. !         str++;
  491. !     if (*str == ERR) {
  492.           *str = '\0';
  493.           return ERR;
  494. -     }
  495. -     *str = '\0';
  496.       return OK;
  497.   }
  498. --- 44,55 ----
  499.   wgetstr(win,str)
  500.   reg WINDOW    *win; 
  501.   reg char    *str; {
  502. +     int c;
  503.   
  504. !     while ((c = wgetch(win)) != ERR && c != EOF && c != '\n')
  505. !         *str++ = c;
  506.       *str = '\0';
  507. +     if (c == ERR)
  508.           return ERR;
  509.       return OK;
  510.   }
  511. *** insch.c.was    Sun Apr 21 00:13:54 1991
  512. --- insch.c    Fri Jan  8 16:11:22 1993
  513. ***************
  514. *** 44,53 ****
  515.    */
  516.   winsch(win, c)
  517.   reg WINDOW    *win;
  518. ! char        c; {
  519.   
  520. !     reg char    *temp1, *temp2;
  521. !     reg char    *end;
  522.   
  523.       end = &win->_y[win->_cury][win->_curx];
  524.       temp1 = &win->_y[win->_cury][win->_maxx - 1];
  525. --- 44,53 ----
  526.    */
  527.   winsch(win, c)
  528.   reg WINDOW    *win;
  529. ! chtype          c; {
  530.   
  531. !     reg chtype      *temp1, *temp2;
  532. !     reg chtype      *end;
  533.   
  534.       end = &win->_y[win->_cury][win->_curx];
  535.       temp1 = &win->_y[win->_cury][win->_maxx - 1];
  536. *** insertln.c.was    Sun Apr 21 00:13:55 1991
  537. --- insertln.c    Fri Jan  8 16:00:59 1993
  538. ***************
  539. *** 45,53 ****
  540.   winsertln(win)
  541.   reg WINDOW    *win; {
  542.   
  543. !     reg char    *temp;
  544.       reg int        y;
  545. !     reg char    *end;
  546.       reg int        x;
  547.   
  548.   #ifdef    DEBUG
  549. --- 45,53 ----
  550.   winsertln(win)
  551.   reg WINDOW    *win; {
  552.   
  553. !     reg chtype      *temp;
  554.       reg int        y;
  555. !     reg chtype      *end;
  556.       reg int        x;
  557.   
  558.   #ifdef    DEBUG
  559. ***************
  560. *** 59,65 ****
  561.           if (win->_orig == NULL)
  562.               win->_y[y] = win->_y[y - 1];
  563.           else
  564. !             bcopy(win->_y[y - 1], win->_y[y], win->_maxx);
  565.           touchline(win, y, 0, win->_maxx - 1);
  566.       }
  567.       if (win->_orig == NULL)
  568. --- 59,65 ----
  569.           if (win->_orig == NULL)
  570.               win->_y[y] = win->_y[y - 1];
  571.           else
  572. !             bcopy(win->_y[y - 1], win->_y[y], win->_maxx * sizeof(chtype));
  573.           touchline(win, y, 0, win->_maxx - 1);
  574.       }
  575.       if (win->_orig == NULL)
  576. *** newwin.c.was    Sun Apr 21 00:13:56 1991
  577. --- newwin.c    Fri Jan  8 16:18:59 1993
  578. ***************
  579. *** 55,61 ****
  580.   int    num_lines, num_cols, begy, begx;
  581.   {
  582.       reg WINDOW    *win;
  583. !     reg char    *sp;
  584.       reg int        i, by, bx, nl, nc;
  585.       reg int        j;
  586.   
  587. --- 55,61 ----
  588.   int    num_lines, num_cols, begy, begx;
  589.   {
  590.       reg WINDOW    *win;
  591. !     reg chtype      *sp;
  592.       reg int        i, by, bx, nl, nc;
  593.       reg int        j;
  594.   
  595. ***************
  596. *** 87,93 ****
  597.           win->_lastch[i] = _NOCHANGE;
  598.       }
  599.       for (i = 0; i < nl; i++)
  600. !         if ((win->_y[i] = malloc(nc * sizeof win->_y[0])) == NULL) {
  601.               for (j = 0; j < i; j++)
  602.                   free(win->_y[j]);
  603.               free(win->_firstch);
  604. --- 87,93 ----
  605.           win->_lastch[i] = _NOCHANGE;
  606.       }
  607.       for (i = 0; i < nl; i++)
  608. !         if ((win->_y[i] = (chtype *) malloc(nc * sizeof(chtype))) == NULL) {
  609.               for (j = 0; j < i; j++)
  610.                   free(win->_y[j]);
  611.               free(win->_firstch);
  612. ***************
  613. *** 188,194 ****
  614.   # ifdef DEBUG
  615.       fprintf(outf, "MAKENEW: nl = %d\n", nl);
  616.   # endif
  617. !     if ((win->_y = (char **) malloc(nl * sizeof win->_y[0])) == NULL) {
  618.           free(win);
  619.           return NULL;
  620.       }
  621. --- 188,194 ----
  622.   # ifdef DEBUG
  623.       fprintf(outf, "MAKENEW: nl = %d\n", nl);
  624.   # endif
  625. !     if ((win->_y = (chtype **) malloc(nl * sizeof(chtype *))) == NULL) {
  626.           free(win);
  627.           return NULL;
  628.       }
  629. *** overlay.c.was    Sun Apr 21 00:13:56 1991
  630. --- overlay.c    Fri Jan  8 16:21:04 1993
  631. ***************
  632. *** 36,42 ****
  633.   #endif /* not lint */
  634.   
  635.   # include    "curses.ext"
  636. - # include    <ctype.h>
  637.   
  638.   # define    min(a,b)    (a < b ? a : b)
  639.   # define    max(a,b)    (a > b ? a : b)
  640. --- 36,41 ----
  641. ***************
  642. *** 48,54 ****
  643.   overlay(win1, win2)
  644.   reg WINDOW    *win1, *win2; {
  645.   
  646. !     reg char    *sp, *end;
  647.       reg int        x, y, endy, endx, starty, startx;
  648.       reg int     y1,y2;
  649.   
  650. --- 47,53 ----
  651.   overlay(win1, win2)
  652.   reg WINDOW    *win1, *win2; {
  653.   
  654. !     reg chtype      *sp, *end;
  655.       reg int        x, y, endy, endx, starty, startx;
  656.       reg int     y1,y2;
  657.   
  658. ***************
  659. *** 70,76 ****
  660.           end = &win1->_y[y1][endx - win1->_begx];
  661.           x = startx - win2->_begx;
  662.           for (sp = &win1->_y[y1][startx - win1->_begx]; sp < end; sp++) {
  663. !             if (!isspace(*sp))
  664.                   mvwaddch(win2, y2, x, *sp);
  665.               x++;
  666.           }
  667. --- 69,75 ----
  668.           end = &win1->_y[y1][endx - win1->_begx];
  669.           x = startx - win2->_begx;
  670.           for (sp = &win1->_y[y1][startx - win1->_begx]; sp < end; sp++) {
  671. !             if (*sp != ' ')
  672.                   mvwaddch(win2, y2, x, *sp);
  673.               x++;
  674.           }
  675. *** overwrite.c.was    Sun Apr 21 00:13:56 1991
  676. --- overwrite.c    Fri Jan  8 16:00:59 1993
  677. ***************
  678. *** 48,54 ****
  679.   overwrite(win1, win2)
  680.   reg WINDOW    *win1, *win2; {
  681.   
  682. -     reg char    *sp, *end;
  683.       reg int        x, y, endy, endx, starty, startx;
  684.   
  685.   # ifdef DEBUG
  686. --- 48,53 ----
  687. ***************
  688. *** 66,72 ****
  689.       x = endx - startx;
  690.       for (y = starty; y < endy; y++) {
  691.           bcopy(&win1->_y[y - win1->_begy][startx - win1->_begx],
  692. !               &win2->_y[y - win2->_begy][startx - win2->_begx], x);
  693.           touchline(win2, y, startx - win2->_begx, endx - win2->_begx);
  694.       }
  695.   }
  696. --- 65,71 ----
  697.       x = endx - startx;
  698.       for (y = starty; y < endy; y++) {
  699.           bcopy(&win1->_y[y - win1->_begy][startx - win1->_begx],
  700. !               &win2->_y[y - win2->_begy][startx - win2->_begx], x * sizeof(chtype));
  701.           touchline(win2, y, startx - win2->_begx, endx - win2->_begx);
  702.       }
  703.   }
  704. *** printw.c.was    Sun Apr 21 00:13:56 1991
  705. --- printw.c    Fri Jan  8 16:23:10 1993
  706. ***************
  707. *** 111,117 ****
  708.       register int c = n;
  709.   
  710.       while (--c >= 0) {
  711. !         if (waddch(win, *buf++) == ERR)
  712.               return (-1);
  713.       }
  714.       return n;
  715. --- 111,117 ----
  716.       register int c = n;
  717.   
  718.       while (--c >= 0) {
  719. !         if (waddch(win, (unsigned char) *buf++) == ERR)
  720.               return (-1);
  721.       }
  722.       return n;
  723. *** refresh.c.was    Sun Apr 21 00:13:57 1991
  724. --- refresh.c    Fri Jan  8 16:36:09 1993
  725. ***************
  726. *** 169,177 ****
  727.   reg WINDOW    *win;
  728.   short        wy;
  729.   {
  730. !     reg char    *nsp, *csp, *ce;
  731.       reg short    wx, lch, y;
  732.       reg int        nlsp, clsp;    /* last space in lines        */
  733.   
  734.       wx = win->_firstch[wy] - win->_ch_off;
  735.       if (wx >= win->_maxx)
  736. --- 169,179 ----
  737.   reg WINDOW    *win;
  738.   short        wy;
  739.   {
  740. !     reg chtype      *nsp, *csp, *ce;
  741.       reg short    wx, lch, y;
  742.       reg int        nlsp, clsp;    /* last space in lines        */
  743. +     char *ce_tcap;
  744. +     static chtype blank[] = {' ','\0'};
  745.   
  746.       wx = win->_firstch[wy] - win->_ch_off;
  747.       if (wx >= win->_maxx)
  748. ***************
  749. *** 186,192 ****
  750.       y = wy + win->_begy;
  751.   
  752.       if (curwin)
  753. !         csp = " ";
  754.       else
  755.           csp = &curscr->_y[wy + win->_begy][wx + win->_begx];
  756.   
  757. --- 188,194 ----
  758.       y = wy + win->_begy;
  759.   
  760.       if (curwin)
  761. !         csp = blank;
  762.       else
  763.           csp = &curscr->_y[wy + win->_begy][wx + win->_begx];
  764.   
  765. ***************
  766. *** 199,207 ****
  767.       }
  768.   
  769.       if (!curwin)
  770. !         ce = CE;
  771.       else
  772. !         ce = NULL;
  773.   
  774.       while (wx <= lch) {
  775.           if (*nsp != *csp) {
  776. --- 201,209 ----
  777.       }
  778.   
  779.       if (!curwin)
  780. !         ce_tcap = CE;
  781.       else
  782. !         ce_tcap = NULL;
  783.   
  784.       while (wx <= lch) {
  785.           if (*nsp != *csp) {
  786. ***************
  787. *** 212,218 ****
  788.               ly = y;
  789.               lx = wx + win->_begx;
  790.               while (*nsp != *csp && wx <= lch) {
  791. !                 if (ce != NULL && wx >= nlsp && *nsp == ' ') {
  792.                       /*
  793.                        * check for clear to end-of-line
  794.                        */
  795. --- 214,220 ----
  796.               ly = y;
  797.               lx = wx + win->_begx;
  798.               while (*nsp != *csp && wx <= lch) {
  799. !                 if (ce_tcap != NULL && wx >= nlsp && *nsp == ' ') {
  800.                       /*
  801.                        * check for clear to end-of-line
  802.                        */
  803. ***************
  804. *** 235,241 ****
  805.                               *csp++ = ' ';
  806.                           return OK;
  807.                       }
  808. !                     ce = NULL;
  809.                   }
  810.                   /*
  811.                    * enter/exit standout mode as appropriate
  812. --- 237,243 ----
  813.                               *csp++ = ' ';
  814.                           return OK;
  815.                       }
  816. !                     ce_tcap = NULL;
  817.                   }
  818.                   /*
  819.                    * enter/exit standout mode as appropriate
  820. ***************
  821. *** 260,268 ****
  822.                               curscr->_flags &= ~_STANDOUT;
  823.                               }
  824.                           if (!curwin)
  825. !                         _putchar((*csp = *nsp) & 0177);
  826.                           else
  827. !                         _putchar(*nsp & 0177);
  828.                           if (win->_flags&_FULLWIN && !curwin)
  829.                           scroll(curscr);
  830.                           ly = win->_begy+win->_cury;
  831. --- 262,270 ----
  832.                               curscr->_flags &= ~_STANDOUT;
  833.                               }
  834.                           if (!curwin)
  835. !                         _putchar((*csp = *nsp));
  836.                           else
  837. !                         _putchar(*nsp);
  838.                           if (win->_flags&_FULLWIN && !curwin)
  839.                           scroll(curscr);
  840.                           ly = win->_begy+win->_cury;
  841. ***************
  842. *** 274,285 ****
  843.                           return ERR;
  844.                       }
  845.                   if (!curwin)
  846. !                     _putchar((*csp++ = *nsp) & 0177);
  847.                   else
  848. !                     _putchar(*nsp & 0177);
  849.   # ifdef FULLDEBUG
  850.                   fprintf(outf,
  851. !                     "MAKECH:putchar(%c)\n", *nsp & 0177);
  852.   # endif
  853.                   if (UC && (*nsp & _STANDOUT)) {
  854.                       _putchar('\b');
  855. --- 276,287 ----
  856.                           return ERR;
  857.                       }
  858.                   if (!curwin)
  859. !                     _putchar((*csp++ = *nsp));
  860.                   else
  861. !                     _putchar(*nsp);
  862.   # ifdef FULLDEBUG
  863.                   fprintf(outf,
  864. !                     "MAKECH:putchar(%c)\n", *nsp);
  865.   # endif
  866.                   if (UC && (*nsp & _STANDOUT)) {
  867.                       _putchar('\b');
  868. -- 
  869. In-This-Life:  Andrew A. Chernov    |  "Hay mas dicha, mas contento
  870. Internet:      ache@astral.msk.su   |  "Que adorar una hermosura
  871. Organization:  The RELCOM Corp.,    |  "Brujuleada entre los lejos
  872.                Moscow, Russia       |  "De lo imposible?!"  (Calderon)
  873.  
  874.