home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / unix / bsd / 11038 < prev    next >
Encoding:
Internet Message Format  |  1993-01-08  |  3.4 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 #2 for curses, make it clean 8-bit
  5. Date: Fri, 08 Jan 93 18:51:32 +0300
  6. Distribution: world
  7. Organization: Ha-oh-lahm Yetzirah
  8. Message-ID: <YI4CQJh8l6@astral.msk.su>
  9. Sender: news-service@newcom.kiae.su
  10. Reply-To: ache@astral.msk.su
  11. Lines: 116
  12.  
  13. I don't think, that any programs wish to use internal curses
  14. attribute _STANDOUT directly, in expressions like:
  15.     addch( ch | _STANDOUT );
  16. Normal interface use standout() and standend() functions instead.
  17. Many programs use 'char' type (with sign extention) for input characters
  18. and sign extention becomes _STANDOUT mode in this case.
  19. So, I refuse this future and allow 8-bit characters for programs,
  20. which is designed for 7-bit only ('char' type using instead of
  21. 'unsigned char').
  22.  
  23. ATTENTION: use my first patch before this
  24.  
  25. *** addch.c.pl1    Fri Jan  8 15:40:46 1993
  26. --- addch.c    Fri Jan  8 18:26:21 1993
  27. ***************
  28. *** 43,49 ****
  29.    */
  30.   waddch(win, c)
  31.   WINDOW    *win;
  32. ! chtype c;
  33.   {
  34. !     return _waddbytes(win, &c, 1);
  35.   }
  36. --- 43,50 ----
  37.    */
  38.   waddch(win, c)
  39.   WINDOW    *win;
  40. ! char c;
  41.   {
  42. !     chtype ch = (unsigned char) c;
  43. !     return _waddbytes(win, &ch, 1);
  44.   }
  45. *** box.c.pl1    Fri Jan  8 17:00:54 1993
  46. --- box.c    Fri Jan  8 18:26:21 1993
  47. ***************
  48. *** 44,50 ****
  49.    */
  50.   box(win, vert, hor)
  51.   reg WINDOW    *win;
  52. ! chtype vert, hor; {
  53.   
  54.       reg int        i;
  55.       reg int        endy, endx;
  56. --- 44,50 ----
  57.    */
  58.   box(win, vert, hor)
  59.   reg WINDOW    *win;
  60. ! char vert, hor; {
  61.   
  62.       reg int        i;
  63.       reg int        endy, endx;
  64. ***************
  65. *** 55,64 ****
  66.       fp = win->_y[0];
  67.       lp = win->_y[endy];
  68.       for (i = 0; i < endx; i++)
  69. !         fp[i] = lp[i] = hor;
  70.       endx--;
  71.       for (i = 0; i <= endy; i++)
  72. !         win->_y[i][0] = (win->_y[i][endx] = vert);
  73.       if (!win->_scroll && (win->_flags&_SCROLLWIN))
  74.           fp[0] = fp[endx] = lp[0] = lp[endx] = ' ';
  75.       touchwin(win);
  76. --- 55,64 ----
  77.       fp = win->_y[0];
  78.       lp = win->_y[endy];
  79.       for (i = 0; i < endx; i++)
  80. !         fp[i] = lp[i] = (unsigned char) hor;
  81.       endx--;
  82.       for (i = 0; i <= endy; i++)
  83. !         win->_y[i][0] = (win->_y[i][endx] = (unsigned char) vert);
  84.       if (!win->_scroll && (win->_flags&_SCROLLWIN))
  85.           fp[0] = fp[endx] = lp[0] = lp[endx] = ' ';
  86.       touchwin(win);
  87. *** insch.c.pl1    Fri Jan  8 16:11:22 1993
  88. --- insch.c    Fri Jan  8 18:28:48 1993
  89. ***************
  90. *** 44,50 ****
  91.    */
  92.   winsch(win, c)
  93.   reg WINDOW    *win;
  94. ! chtype          c; {
  95.   
  96.       reg chtype      *temp1, *temp2;
  97.       reg chtype      *end;
  98. --- 44,50 ----
  99.    */
  100.   winsch(win, c)
  101.   reg WINDOW    *win;
  102. ! char c; {
  103.   
  104.       reg chtype      *temp1, *temp2;
  105.       reg chtype      *end;
  106. ***************
  107. *** 54,60 ****
  108.       temp2 = temp1 - 1;
  109.       while (temp1 > end)
  110.           *temp1-- = *temp2--;
  111. !     *temp1 = c;
  112.       touchline(win, win->_cury, win->_curx, win->_maxx - 1);
  113.       if (win->_cury == LINES - 1 && win->_y[LINES-1][COLS-1] != ' ')
  114.           if (win->_scroll) {
  115. --- 54,60 ----
  116.       temp2 = temp1 - 1;
  117.       while (temp1 > end)
  118.           *temp1-- = *temp2--;
  119. !     *temp1 = (unsigned char) c;
  120.       touchline(win, win->_cury, win->_curx, win->_maxx - 1);
  121.       if (win->_cury == LINES - 1 && win->_y[LINES-1][COLS-1] != ' ')
  122.           if (win->_scroll) {
  123. -- 
  124. In-This-Life:  Andrew A. Chernov    |  "Hay mas dicha, mas contento
  125. Internet:      ache@astral.msk.su   |  "Que adorar una hermosura
  126. Organization:  The RELCOM Corp.,    |  "Brujuleada entre los lejos
  127.                Moscow, Russia       |  "De lo imposible?!"  (Calderon)
  128.  
  129.