root/include/asm-alpha/termios.h

/* [previous][next][first][last][top][bottom][index][help] */

INCLUDED FROM


DEFINITIONS

This source file includes following definitions.
  1. trans_from_termio
  2. trans_to_termio

   1 #ifndef _ALPHA_TERMIOS_H
   2 #define _ALPHA_TERMIOS_H
   3 
   4 #include <asm/ioctls.h>
   5 #include <asm/termbits.h>
   6 
   7 struct sgttyb {
   8         char    sg_ispeed;
   9         char    sg_ospeed;
  10         char    sg_erase;
  11         char    sg_kill;
  12         short   sg_flags;
  13 };
  14 
  15 struct tchars {
  16         char    t_intrc;
  17         char    t_quitc;
  18         char    t_startc;
  19         char    t_stopc;
  20         char    t_eofc;
  21         char    t_brkc;
  22 };
  23 
  24 struct ltchars {
  25         char    t_suspc;
  26         char    t_dsuspc;
  27         char    t_rprntc;
  28         char    t_flushc;
  29         char    t_werasc;
  30         char    t_lnextc;
  31 };
  32 
  33 struct winsize {
  34         unsigned short ws_row;
  35         unsigned short ws_col;
  36         unsigned short ws_xpixel;
  37         unsigned short ws_ypixel;
  38 };
  39 
  40 #define NCC 8
  41 struct termio {
  42         unsigned short c_iflag;         /* input mode flags */
  43         unsigned short c_oflag;         /* output mode flags */
  44         unsigned short c_cflag;         /* control mode flags */
  45         unsigned short c_lflag;         /* local mode flags */
  46         unsigned char c_line;           /* line discipline */
  47         unsigned char c_cc[NCC];        /* control characters */
  48 };
  49 
  50 /*
  51  * c_cc characters in the termio structure.  Oh, how I love being
  52  * backwardly compatible.  Notice that character 4 and 5 are
  53  * interpreted differently depending on whether ICANON is set in
  54  * c_lflag.  If it's set, they are used as _VEOF and _VEOL, otherwise
  55  * as _VMIN and V_TIME.  This is for compatibility with OSF/1 (which
  56  * is compatible with sysV)...
  57  */
  58 #define _VINTR  0
  59 #define _VQUIT  1
  60 #define _VERASE 2
  61 #define _VKILL  3
  62 #define _VEOF   4
  63 #define _VMIN   4
  64 #define _VEOL   5
  65 #define _VTIME  5
  66 #define _VEOL2  6
  67 #define _VSWTC  7
  68 
  69 /* line disciplines */
  70 #define N_TTY           0
  71 #define N_SLIP          1
  72 #define N_MOUSE         2
  73 #define N_PPP           3
  74 
  75 #ifdef __KERNEL__
  76 /*      eof=^D          eol=\0          eol2=\0         erase=del
  77         werase=^W       kill=^U         reprint=^R      sxtc=\0
  78         intr=^C         quit=^\         susp=^Z         <OSF/1 VDSUSP>
  79         start=^Q        stop=^S         lnext=^V        discard=^U
  80         vmin=\1         vtime=\0
  81 */
  82 #define INIT_C_CC "\004\000\000\177\027\025\022\000\003\034\032\000\021\023\026\025\001\000"
  83 
  84 /*
  85  * Translate a "termio" structure into a "termios". Ugh.
  86  */
  87 extern inline void trans_from_termio(struct termio * termio,
     /* [previous][next][first][last][top][bottom][index][help] */
  88         struct termios * termios)
  89 {
  90 #define SET_LOW_BITS(x,y)       ((x) = (0xffff0000 & (x)) | (y))
  91         SET_LOW_BITS(termios->c_iflag, termio->c_iflag);
  92         SET_LOW_BITS(termios->c_oflag, termio->c_oflag);
  93         SET_LOW_BITS(termios->c_cflag, termio->c_cflag);
  94         SET_LOW_BITS(termios->c_lflag, termio->c_lflag);
  95 #undef SET_LOW_BITS
  96         termios->c_cc[VINTR] = termio->c_cc[_VINTR];
  97         termios->c_cc[VQUIT] = termio->c_cc[_VQUIT];
  98         termios->c_cc[VERASE]= termio->c_cc[_VERASE];
  99         termios->c_cc[VKILL] = termio->c_cc[_VKILL];
 100         termios->c_cc[VEOF]  = termio->c_cc[_VEOF];
 101         termios->c_cc[VMIN]  = termio->c_cc[_VMIN];
 102         termios->c_cc[VEOL]  = termio->c_cc[_VEOL];
 103         termios->c_cc[VTIME] = termio->c_cc[_VTIME];
 104         termios->c_cc[VEOL2] = termio->c_cc[_VEOL2];
 105         termios->c_cc[VSWTC] = termio->c_cc[_VSWTC];
 106 }
 107 
 108 /*
 109  * Translate a "termios" structure into a "termio". Ugh.
 110  *
 111  * Note the "fun" _VMIN overloading.
 112  */
 113 extern inline void trans_to_termio(struct termios * termios,
     /* [previous][next][first][last][top][bottom][index][help] */
 114         struct termio * termio)
 115 {
 116         termio->c_iflag = termios->c_iflag;
 117         termio->c_oflag = termios->c_oflag;
 118         termio->c_cflag = termios->c_cflag;
 119         termio->c_lflag = termios->c_lflag;
 120         termio->c_line  = termios->c_line;
 121         termio->c_cc[_VINTR] = termios->c_cc[VINTR];
 122         termio->c_cc[_VQUIT] = termios->c_cc[VQUIT];
 123         termio->c_cc[_VERASE]= termios->c_cc[VERASE];
 124         termio->c_cc[_VKILL] = termios->c_cc[VKILL];
 125         termio->c_cc[_VEOF]  = termios->c_cc[VEOF];
 126         termio->c_cc[_VEOL]  = termios->c_cc[VEOL];
 127         termio->c_cc[_VEOL2] = termios->c_cc[VEOL2];
 128         termio->c_cc[_VSWTC] = termios->c_cc[VSWTC];
 129         if (!(termios->c_lflag & ICANON)) {
 130                 termio->c_cc[_VMIN]  = termios->c_cc[VMIN];
 131                 termio->c_cc[_VTIME] = termios->c_cc[VTIME];
 132         }
 133 }
 134 
 135 #endif  /* __KERNEL__ */
 136 
 137 #endif  /* _ALPHA_TERMIOS_H */

/* [previous][next][first][last][top][bottom][index][help] */