home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / unix / volume3 / libc_term / get_erase.c < prev    next >
Encoding:
C/C++ Source or Header  |  1986-11-30  |  824 b   |  55 lines

  1.  
  2. #include <stdio.h>
  3. #include <sgtty.h>
  4. #include <sys/ioctl.h>
  5. #include "c_term.h"
  6.  
  7. char get_erase()
  8. /*
  9.  ---------------------------------------------------------------------------
  10.  
  11.    Last revision - 
  12.      6 January 1985 - GWS
  13.  
  14.  
  15.    NAME
  16.      get_erase - get erase character for terminal
  17.  
  18.    SYNOPSIS
  19.     char get_erase()
  20.  
  21.    DESCRIPTION
  22.     The return character is the terminal's erase character.
  23.  
  24.    SEE ALSO
  25.  
  26.  
  27.    DIAGNOSTICS
  28.     Will exit(1) on any error. 
  29.  
  30.    BUGS
  31.     none known 
  32.  
  33.    AUTHOR
  34.      George W. Sherouse
  35.      3 January 1985
  36.  
  37.  ---------------------------------------------------------------------------
  38. */
  39.  
  40. {
  41.     struct sgttyb params;
  42.     int ret;
  43.     int ioctl();
  44.  
  45.     ret = ioctl(0, TIOCGETP, ¶ms);
  46.     if (ret == -1)
  47.     {
  48.         fprintf(stderr, "ioctl fail\n");
  49.         perror("get_erase");
  50.         exit(1);
  51.     }
  52.  
  53.     return(params.sg_erase);
  54. }
  55.