home *** CD-ROM | disk | FTP | other *** search
/ Computer Club Elmshorn Atari PD / CCE_PD.iso / pc / 0600 / CCE_0638.ZIP / CCE_0638 / UPDATE / UPDATE29.ZOO / editline / sysatari.c < prev    next >
C/C++ Source or Header  |  1993-03-28  |  1KB  |  57 lines

  1. /*  $Revision: 1.1 $
  2. **
  3. **  atari system-dependant routines for editline library.
  4. */
  5. #include "editline.h"
  6.  
  7. #include <sgtty.h>
  8.  
  9. void
  10. rl_ttyset(Reset)
  11.     int                Reset;
  12. {
  13.     static struct sgttyb    old_sgttyb;
  14.     static struct tchars    old_tchars;
  15.     struct sgttyb        new_sgttyb;
  16.     struct tchars        new_tchars;
  17.  
  18.     if (Reset == 0) {
  19.     (void)ioctl(0, TIOCGETP, &old_sgttyb);
  20.     rl_erase = old_sgttyb.sg_erase;
  21.     rl_kill = old_sgttyb.sg_kill;
  22.  
  23.     (void)ioctl(0, TIOCGETC, &old_tchars);
  24.     rl_eof = old_tchars.t_eofc;
  25.     rl_intr = old_tchars.t_intrc;
  26.     rl_quit = old_tchars.t_quitc;
  27.  
  28.     new_sgttyb = old_sgttyb;
  29.     new_sgttyb.sg_flags &= ~ECHO;
  30.     new_sgttyb.sg_flags |= RAW;
  31. #if    defined(PASS8)
  32.     new_sgttyb.sg_flags |= PASS8;
  33. #endif    /* defined(PASS8) */
  34.     (void)ioctl(0, TIOCSETP, &new_sgttyb);
  35.  
  36.     new_tchars = old_tchars;
  37.     new_tchars.t_intrc = -1;
  38.     new_tchars.t_quitc = -1;
  39.     (void)ioctl(0, TIOCSETC, &new_tchars);
  40.     }
  41.     else {
  42.     (void)ioctl(0, TIOCSETP, &old_sgttyb);
  43.     (void)ioctl(0, TIOCSETC, &old_tchars);
  44.     }
  45. }
  46.  
  47. void
  48. rl_add_slash(path, p)
  49.     char    *path;
  50.     char    *p;
  51. {
  52.     struct stat    Sb;
  53.  
  54.     if (stat(path, &Sb) >= 0)
  55.     (void)strcat(p, S_ISDIR(Sb.st_mode) ? "/" : " ");
  56. }
  57.