tty.h File Reference

#include "histedit.h"
#include <termios.h>
#include <unistd.h>

Go to the source code of this file.

Classes

struct  TTYPerm_t
struct  ElTTY_t

Defines

#define CONTROL(A)   ((A) & 037)
#define ONLRET   0
#define TAB3   0
#define ONLCR   0
#define IEXTEN   0
#define ECHOCTL   0
#define PARENB   0
#define EXTPROC   0
#define FLUSHO   0
#define _POSIX_VDISABLE   ((unsigned char) -1)
#define CINTR   CONTROL('c')
#define CQUIT   034
#define CERASE   0177
#define CKILL   CONTROL('u')
#define CEOF   CONTROL('d')
#define CEOL   _POSIX_VDISABLE
#define CEOL2   _POSIX_VDISABLE
#define CSWTCH   _POSIX_VDISABLE
#define CDSWTCH   _POSIX_VDISABLE
#define CERASE2   _POSIX_VDISABLE
#define CSTART   CONTROL('q')
#define CSTOP   CONTROL('s')
#define CSUSP   CONTROL('z')
#define CDSUSP   CONTROL('y')
#define CREPRINT   CONTROL('r')
#define CDISCARD   CONTROL('o')
#define CLNEXT   CONTROL('v')
#define CWERASE   CONTROL('w')
#define CSTATUS   CONTROL('t')
#define CPAGE   ' '
#define CPGOFF   CONTROL('m')
#define CKILL2   _POSIX_VDISABLE
#define CBRK   0377
#define CMIN   CEOF
#define CTIME   CEOL
#define C_INTR   0
#define C_QUIT   1
#define C_ERASE   2
#define C_KILL   3
#define C_EOF   4
#define C_EOL   5
#define C_EOL2   6
#define C_SWTCH   7
#define C_DSWTCH   8
#define C_ERASE2   9
#define C_START   10
#define C_STOP   11
#define C_WERASE   12
#define C_SUSP   13
#define C_DSUSP   14
#define C_REPRINT   15
#define C_DISCARD   16
#define C_LNEXT   17
#define C_STATUS   18
#define C_PAGE   19
#define C_PGOFF   20
#define C_KILL2   21
#define C_BRK   22
#define C_MIN   23
#define C_TIME   24
#define C_NCC   25
#define C_SH(A)   (1 << (A))
#define EX_IO   0
#define ED_IO   1
#define TS_IO   2
#define QU_IO   2
#define NN_IO   3
#define MD_INP   0
#define MD_OUT   1
#define MD_CTL   2
#define MD_LIN   3
#define MD_CHAR   4
#define MD_NN   5

Typedefs

typedef unsigned char TTYChar_t [NN_IO][C_NCC]

Functions

el_protected int tty_init (EditLine_t *)
el_protected void tty_end (EditLine_t *)
el_protected int tty_stty (EditLine_t *, int, const char **)
el_protected int tty_rawmode (EditLine_t *)
el_protected int tty_cookedmode (EditLine_t *)
el_protected int tty_quotemode (EditLine_t *)
el_protected int tty_noquotemode (EditLine_t *)
el_protected void tty_bind_char (EditLine_t *, int)
el_protected int tty_can_output (void)


Define Documentation

#define _POSIX_VDISABLE   ((unsigned char) -1)

Definition at line 164 of file tty.h.

Referenced by tty_init().

#define C_BRK   22

Definition at line 438 of file tty.h.

#define C_DISCARD   16

Definition at line 432 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_DSUSP   14

Definition at line 430 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_DSWTCH   8

Definition at line 424 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_EOF   4

Definition at line 420 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_EOL   5

Definition at line 421 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_EOL2   6

Definition at line 422 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_ERASE   2

Definition at line 418 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_ERASE2   9

Definition at line 425 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_INTR   0

Definition at line 416 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_KILL   3

Definition at line 419 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_KILL2   21

Definition at line 437 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_LNEXT   17

Definition at line 433 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_MIN   23

Definition at line 439 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_NCC   25

Definition at line 441 of file tty.h.

Referenced by tty_rawmode(), and tty_setup().

#define C_PAGE   19

Definition at line 435 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_PGOFF   20

Definition at line 436 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_QUIT   1

Definition at line 417 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_REPRINT   15

Definition at line 431 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_SH ( A   )     (1 << (A))

Definition at line 442 of file tty.h.

Referenced by tty_rawmode().

#define C_START   10

Definition at line 426 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_STATUS   18

Definition at line 434 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_STOP   11

Definition at line 427 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_SUSP   13

Definition at line 429 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_SWTCH   7

Definition at line 423 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_TIME   24

Definition at line 440 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define C_WERASE   12

Definition at line 428 of file tty.h.

Referenced by tty__getchar(), and tty__setchar().

#define CBRK   0377

Definition at line 263 of file tty.h.

#define CDISCARD   CONTROL('o')

Definition at line 238 of file tty.h.

#define CDSUSP   CONTROL('y')

Definition at line 214 of file tty.h.

#define CDSWTCH   _POSIX_VDISABLE

Definition at line 199 of file tty.h.

#define CEOF   CONTROL('d')

Definition at line 187 of file tty.h.

#define CEOL   _POSIX_VDISABLE

Definition at line 190 of file tty.h.

#define CEOL2   _POSIX_VDISABLE

Definition at line 193 of file tty.h.

#define CERASE   0177

Definition at line 181 of file tty.h.

#define CERASE2   _POSIX_VDISABLE

Definition at line 202 of file tty.h.

#define CINTR   CONTROL('c')

Definition at line 175 of file tty.h.

#define CKILL   CONTROL('u')

Definition at line 184 of file tty.h.

#define CKILL2   _POSIX_VDISABLE

Definition at line 259 of file tty.h.

#define CLNEXT   CONTROL('v')

Definition at line 241 of file tty.h.

#define CMIN   CEOF

Definition at line 269 of file tty.h.

#define CONTROL ( A   )     ((A) & 037)

Definition at line 57 of file tty.h.

Referenced by map_init_emacs().

#define CPAGE   ' '

Definition at line 253 of file tty.h.

#define CPGOFF   CONTROL('m')

Definition at line 256 of file tty.h.

#define CQUIT   034

Definition at line 178 of file tty.h.

#define CREPRINT   CONTROL('r')

Definition at line 235 of file tty.h.

#define CSTART   CONTROL('q')

Definition at line 205 of file tty.h.

#define CSTATUS   CONTROL('t')

Definition at line 250 of file tty.h.

#define CSTOP   CONTROL('s')

Definition at line 208 of file tty.h.

#define CSUSP   CONTROL('z')

Definition at line 211 of file tty.h.

#define CSWTCH   _POSIX_VDISABLE

Definition at line 196 of file tty.h.

#define CTIME   CEOL

Definition at line 272 of file tty.h.

#define CWERASE   CONTROL('w')

Definition at line 244 of file tty.h.

#define ECHOCTL   0

Definition at line 107 of file tty.h.

#define ED_IO   1

Definition at line 448 of file tty.h.

Referenced by read_preread(), tty_bind_char(), tty_noquotemode(), tty_rawmode(), tty_setup(), and tty_stty().

#define EX_IO   0

Definition at line 447 of file tty.h.

Referenced by tty_cookedmode(), tty_init(), tty_rawmode(), tty_setup(), and tty_stty().

#define EXTPROC   0

Definition at line 115 of file tty.h.

#define FLUSHO   0

Definition at line 119 of file tty.h.

#define IEXTEN   0

Definition at line 103 of file tty.h.

Referenced by gl_char_init().

#define MD_CHAR   4

Definition at line 457 of file tty.h.

Referenced by tty_rawmode().

#define MD_CTL   2

Definition at line 455 of file tty.h.

Referenced by tty_quotemode(), tty_rawmode(), and tty_setup().

#define MD_INP   0

Definition at line 453 of file tty.h.

Referenced by tty_quotemode(), tty_rawmode(), and tty_setup().

#define MD_LIN   3

Definition at line 456 of file tty.h.

Referenced by tty_quotemode(), tty_rawmode(), and tty_setup().

#define MD_NN   5

Definition at line 458 of file tty.h.

#define MD_OUT   1

Definition at line 454 of file tty.h.

Referenced by tty_quotemode(), tty_rawmode(), and tty_setup().

#define NN_IO   3

Definition at line 451 of file tty.h.

#define ONLCR   0

Definition at line 99 of file tty.h.

#define ONLRET   0

Definition at line 83 of file tty.h.

#define PARENB   0

Definition at line 111 of file tty.h.

#define QU_IO   2

Definition at line 450 of file tty.h.

Referenced by tty_noquotemode(), tty_quotemode(), tty_rawmode(), and tty_stty().

#define TAB3   0

Definition at line 90 of file tty.h.

#define TS_IO   2

Definition at line 449 of file tty.h.

Referenced by tty_rawmode(), and tty_setup().


Typedef Documentation

typedef unsigned char TTYChar_t[NN_IO][C_NCC]

Definition at line 466 of file tty.h.


Function Documentation

el_protected void tty_bind_char ( EditLine_t ,
int   
)

Definition at line 787 of file tty.cxx.

References ED_IO, ElMap_t::fAlt, TTYMap_t::fBind, ElMap_t::fEmacs, ElMap_t::fKey, EditLine_t::fMap, TTYMap_t::fNCh, TTYMap_t::fOCh, EditLine_t::fTTY, ElMap_t::fType, ElMap_t::fVic, ElMap_t::fVii, if(), key_clear(), MAP_VI, NULL, and ElTTY_t::t_c.

Referenced by map_init_emacs(), map_init_vi(), and tty_rawmode().

el_protected int tty_can_output ( void   ) 

Definition at line 474 of file tty.cxx.

References STDOUT_FILENO.

Referenced by prompt_print(), sig_handler(), and tty_setup().

el_protected int tty_cookedmode ( EditLine_t  ) 

Definition at line 1013 of file tty.cxx.

References EDIT_DISABLED, EX_IO, EditLine_t::fErrFile, EditLine_t::fFlags, fprintf(), EditLine_t::fTTY, strerror(), ElTTY_t::t_mode, tty_setty, tty_setup(), and void.

Referenced by el_reset(), readline(), and sig_handler().

el_protected void tty_end ( EditLine_t  ) 

Definition at line 604 of file tty.cxx.

Referenced by el_end().

el_protected int tty_init ( EditLine_t  ) 

Definition at line 590 of file tty.cxx.

References _POSIX_VDISABLE, EX_IO, EditLine_t::fTTY, ElTTY_t::t_c, ElTTY_t::t_mode, ElTTY_t::t_t, ElTTY_t::t_vdisable, tty_setup(), ttyperm, and void.

Referenced by el_init().

el_protected int tty_noquotemode ( EditLine_t  ) 

Definition at line 1086 of file tty.cxx.

References ED_IO, EditLine_t::fErrFile, fprintf(), EditLine_t::fTTY, QU_IO, strerror(), ElTTY_t::t_mode, tty_setty, tty_setup(), and void.

Referenced by ed_quoted_insert(), and setEcho().

el_protected int tty_quotemode ( EditLine_t  ) 

Definition at line 1045 of file tty.cxx.

References EditLine_t::fErrFile, fprintf(), EditLine_t::fTTY, MD_CTL, MD_INP, MD_LIN, MD_OUT, QU_IO, strerror(), TTYPerm_t::t_clrmask, ElTTY_t::t_mode, TTYPerm_t::t_setmask, ElTTY_t::t_t, tty_setty, tty_setup(), and void.

Referenced by ed_quoted_insert(), and setEcho().

el_protected int tty_rawmode ( EditLine_t  ) 

Definition at line 835 of file tty.cxx.

References C_NCC, C_SH, ED_IO, EDIT_DISABLED, EL_CAN_TAB, EX_IO, EditLine_t::fErrFile, EditLine_t::fFlags, fprintf(), EditLine_t::fTTY, i, MD_CHAR, MD_CTL, MD_INP, MD_LIN, MD_OUT, QU_IO, strerror(), ElTTY_t::t_c, TTYPerm_t::t_clrmask, ElTTY_t::t_eight, ElTTY_t::t_mode, TTYPerm_t::t_setmask, ElTTY_t::t_speed, ElTTY_t::t_t, ElTTY_t::t_tabs, ElTTY_t::t_ts, ElTTY_t::t_vdisable, TS_IO, tty__cooked_mode, tty__getchar(), tty__geteightbit, tty__getspeed(), tty__gettabs, tty__setchar(), tty_bind_char(), tty_getty, tty_setup(), and void.

Referenced by readline(), and sig_handler().

el_protected int tty_stty ( EditLine_t ,
int  ,
const char **   
)

Definition at line 1114 of file tty.cxx.

References d, ED_IO, EX_IO, EditLine_t::fErrFile, ElCoord_t::fH, EditLine_t::fOutFile, fprintf(), ElTerm_t::fSize, EditLine_t::fTerm, EditLine_t::fTTY, i, if(), len, m, name, NULL, QU_IO, s, TTYPerm_t::t_clrmask, TTYPerm_t::t_name, TTYPerm_t::t_setmask, ElTTY_t::t_t, void, and x.

Referenced by el_builtins_init(), el_get(), and el_set().


Generated on Tue Jul 5 15:57:25 2011 for ROOT_528-00b_version by  doxygen 1.5.1