home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume7 / rvi / part2 / rv_print_ln.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  751 b   |  44 lines

  1. #include "rv.h"
  2.  
  3. void
  4. print_line(s)
  5. /*
  6.  * Print line to screen at current cursor loc.
  7.  */
  8. char    *s;
  9. {
  10.     char    *uchr;
  11.  
  12.     --s;
  13.     while(*++s) {
  14.         if (*s < ' ' || *s > '~') /* If control char */
  15.             if (*s == '\t' && !set_list) /* tab */
  16. /* Alan - Expand this using set_tabstops!! */
  17. /* Ugh.. later.  This loop is already too slow.  AEK */
  18.                 addch(*s); 
  19.             else {
  20.                 /*
  21.                  * Expand control char to ^x
  22.                  */
  23.                 uchr = unctrl(*s);
  24.                 addch(uchr[0]);
  25.                 addch(uchr[1]);
  26.             }
  27.         else
  28.             addch(*s);
  29.     }
  30.     if (set_list)
  31.         addch('$');
  32. #ifndef USG
  33.     /*
  34.      * KLUDGE - Handle xenl brain damage in the VT100 and
  35.      * Concept 100 until Berkeley cleans up it's Curses implementation
  36.      */
  37.     if (XN && CURCOLUMN==0) {
  38.         addch(' '); 
  39.         refresh();
  40.         addch('\b');
  41.     }
  42. #endif
  43. }
  44.