home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume3 / lib_term / underline.c < prev   
Encoding:
C/C++ Source or Header  |  1986-11-30  |  1.1 KB  |  58 lines

  1.  
  2. void underline(on_or_off)
  3. int on_or_off;
  4.  
  5.  
  6. /*
  7.  ---------------------------------------------------------------------------
  8.  
  9.    Last revision - 
  10.      30 March 1984 - GWS
  11.  
  12.  
  13.    NAME
  14.      underline - set or clear terminal underline mode
  15.  
  16.    SYNOPSIS
  17.     void underline(on_or_off) 
  18.     int on_or_off;
  19.  
  20.    DESCRIPTION
  21.     Uses termcap(3x) routines to set terminal mode. 
  22.  
  23.    SEE ALSO
  24.     termcap(3) 
  25.  
  26.    DIAGNOSTICS
  27.     If the mode doesn't change, it didn't work. 
  28.  
  29.    AUTHOR
  30.      George W. Sherouse
  31.      30 March 1984
  32.  
  33.  ---------------------------------------------------------------------------
  34. */
  35.  
  36. {
  37.     static int called = 0;
  38.     static char us_id[] = "us", ue_id[] = "ue", us_str[10], ue_str[10];
  39.     static char *us_point = us_str, **us_point2 = &us_point;
  40.     static char *ue_point = ue_str, **ue_point2 = &ue_point;
  41.     extern char bp[1024];
  42.     int tgetent(), tputs();
  43.     int putchar();
  44.  
  45.     if (!called)
  46.     {
  47.     tgetstr(us_id, us_point2);
  48.     tgetstr(ue_id, ue_point2);
  49.     called++;
  50.     }
  51.  
  52.     if (on_or_off)
  53.         (void) tputs(us_str, 1, putchar);
  54.     else
  55.         (void) tputs(ue_str, 1, putchar);
  56.     return;
  57. }
  58.