term.cxx File Reference

#include "compat.h"
#include "sys.h"
#include <stdio.h>
#include <signal.h>
#include <string.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <string>
#include "el.h"
#include "TTermManip.h"
#include "rlcurses.h"

Go to the source code of this file.

Classes

struct  TermCapStr_t
struct  TermCapVal_t

Defines

#define TC_BUFSIZE   2048
#define GoodStr(a)
#define Str(a)   el->fTerm.fStr[a]
#define Val(a)   el->fTerm.fVal[a]
#define T_al   0
#define T_bl   1
#define T_cd   2
#define T_ce   3
#define T_ch   4
#define T_cl   5
#define T_dc   6
#define T_dl   7
#define T_dm   8
#define T_ed   9
#define T_ei   10
#define T_fs   11
#define T_ho   12
#define T_ic   13
#define T_im   14
#define T_ip   15
#define T_kd   16
#define T_kl   17
#define T_kr   18
#define T_ku   19
#define T_md   20
#define T_me   21
#define T_nd   22
#define T_se   23
#define T_so   24
#define T_ts   25
#define T_up   26
#define T_us   27
#define T_ue   28
#define T_vb   29
#define T_DC   30
#define T_DO   31
#define T_IC   32
#define T_LE   33
#define T_RI   34
#define T_UP   35
#define T_kh   36
#define T_at7   37
#define T_kD   38
#define T_str   39
#define T_am   0
#define T_pt   1
#define T_li   2
#define T_co   3
#define T_km   4
#define T_xt   5
#define T_xn   6
#define T_MT   7
#define T_val   8

Functions

el_private void term_setflags (EditLine_t *)
el_private int term_rebuffer_display (EditLine_t *)
el_private void term_free_display (EditLine_t *)
el_private int term_alloc_display (EditLine_t *)
el_private void term_alloc (EditLine_t *, const struct TermCapStr_t *, const char *)
el_private void term_init_arrow (EditLine_t *)
el_private void term_reset_arrow (EditLine_t *)
el_private void term_init_color (EditLine_t *)
el_protected int term_init (EditLine_t *el)
el_protected void term_end (EditLine_t *el)
el_protected void term_move_to_line (EditLine_t *el, int where)
el_protected void term_move_to_char (EditLine_t *el, int where)
el_protected void term_overwrite (EditLine_t *el, const char *cp, ElColor_t *color, int n)
el_protected void term_deletechars (EditLine_t *el, int num)
el_protected void term_insertwrite (EditLine_t *el, const char *cp, ElColor_t *color, int num)
el_protected void term_clear_EOL (EditLine_t *el, int num)
el_protected void term_clear_screen (EditLine_t *el)
el_protected void term_beep (EditLine_t *el)
el_protected int term_set (EditLine_t *el, const char *term)
el_protected int term_get_size (EditLine_t *el, int *lins, int *cols)
el_protected int term_change_size (EditLine_t *el, int lins, int cols)
el_protected int term_set_arrow (EditLine_t *el, char *name, KeyValue_t *fun, int type)
el_protected int term_clear_arrow (EditLine_t *el, char *name)
el_protected void term_print_arrow (EditLine_t *el, const char *name)
el_protected void term_bind_arrow (EditLine_t *el)
el_private TTermManipterm__gettermmanip ()
el_protected void term__resetcolor ()
el_protected int term__putc (int c)
el_public int term__atocolor (const char *name)
el_protected void term__setcolor (int fgcol)
el_protected int term__putcolorch (int c, ElColor_t *color)
el_protected void term__repaint (EditLine_t *el, int index)
el_protected void term__flush (void)
el_protected int term_telltc (EditLine_t *el, int, const char **)
el_protected int term_settc (EditLine_t *el, int, const char **argv)
el_protected int term_echotc (EditLine_t *el, int, const char **argv)

Variables

el_private struct TermCapStr_t tstr []
el_private struct TermCapVal_t tval []
el_private FILE * term_outfile = NULL


Define Documentation

#define GoodStr (  ) 

Value:

(el->fTerm.fStr[a] != NULL && \
                    el->fTerm.fStr[a][0] != '\0')

Definition at line 79 of file term.cxx.

Referenced by term_beep(), term_clear_EOL(), term_clear_screen(), term_deletechars(), term_insertwrite(), term_move_to_char(), term_move_to_line(), and term_setflags().

#define Str (  )     el->fTerm.fStr[a]

Definition at line 81 of file term.cxx.

Referenced by term_beep(), term_clear_EOL(), term_clear_screen(), term_deletechars(), term_insertwrite(), term_move_to_char(), term_move_to_line(), and term_setflags().

#define T_al   0

#define T_am   0

Referenced by term_set(), and term_setflags().

#define T_at7   37

Referenced by term_init_arrow().

#define T_bl   1

Referenced by term_beep().

#define T_cd   2

Referenced by term_clear_screen().

#define T_ce   3

Referenced by term_clear_EOL(), and term_setflags().

#define T_ch   4

Referenced by term_move_to_char().

#define T_cl   5

Referenced by term_clear_screen().

#define T_co   3

Referenced by term_change_size(), term_get_size(), term_rebuffer_display(), term_set(), and term_telltc().

#define T_DC   30

Referenced by term_deletechars(), and term_setflags().

#define T_dc   6

Referenced by term_deletechars(), and term_setflags().

#define T_dl   7

#define T_dm   8

Referenced by term_deletechars().

#define T_DO   31

Referenced by term_move_to_line().

#define T_ed   9

Referenced by term_deletechars().

#define T_ei   10

Referenced by term_insertwrite().

#define T_fs   11

#define T_ho   12

Referenced by term_clear_screen().

#define T_IC   32

Referenced by term_insertwrite(), and term_setflags().

#define T_ic   13

Referenced by term_insertwrite(), and term_setflags().

#define T_im   14

Referenced by term_insertwrite(), and term_setflags().

#define T_ip   15

Referenced by term_insertwrite().

#define T_kD   38

Referenced by term_init_arrow().

#define T_kd   16

Referenced by term_init_arrow().

#define T_kh   36

Referenced by term_init_arrow().

#define T_kl   17

Referenced by term_init_arrow().

#define T_km   4

Referenced by term_echotc(), term_set(), and term_setflags().

#define T_kr   18

Referenced by term_init_arrow().

#define T_ku   19

Referenced by term_init_arrow().

#define T_LE   33

Referenced by term_move_to_char().

#define T_li   2

Referenced by term_change_size(), term_clear_screen(), term_get_size(), term_rebuffer_display(), term_set(), and term_telltc().

#define T_md   20

#define T_me   21

Referenced by term_setflags().

#define T_MT   7

Referenced by term_set(), and term_setflags().

#define T_nd   22

#define T_pt   1

Referenced by term_set(), and term_setflags().

#define T_RI   34

Referenced by term_move_to_char().

#define T_se   23

Referenced by term_setflags().

#define T_so   24

#define T_str   39

Referenced by term_alloc(), and term_init().

#define T_ts   25

#define T_ue   28

Referenced by term_setflags().

#define T_UP   35

Referenced by term_move_to_line(), and term_setflags().

#define T_up   26

Referenced by term_move_to_line(), and term_setflags().

#define T_us   27

#define T_val   8

Referenced by term_init().

#define T_vb   29

#define T_xn   6

Referenced by term_set(), and term_setflags().

#define T_xt   5

Referenced by term_set(), and term_setflags().

#define TC_BUFSIZE   2048

Definition at line 77 of file term.cxx.

Referenced by term_alloc(), term_echotc(), term_init(), and term_set().

#define Val (  )     el->fTerm.fVal[a]

Definition at line 82 of file term.cxx.

Referenced by XrdCmsNode::do_Locate(), XrdSecsssKT::keyB2X(), XrdSecsssKT::ktDecode0(), XrdCnsLogRec::setDone(), term_change_size(), term_clear_screen(), term_echotc(), term_get_size(), term_rebuffer_display(), term_set(), term_setflags(), term_telltc(), and XrdPssSys::xconf().


Function Documentation

el_public int term__atocolor ( const char *  name  ) 

Definition at line 1485 of file term.cxx.

References fprintf(), TTermManip::GetColorIndex(), i, size_t, and term__gettermmanip().

Referenced by prompt_print(), and setColors().

el_protected void term__flush ( void   ) 

Definition at line 1647 of file term.cxx.

References fflush(), term_outfile, and void.

Referenced by ed_delete_next_char(), ed_unassigned(), el_getc(), el_gets(), el_gets_newline(), el_push(), el_resize(), em_delete_or_list(), re_fastaddc(), re_goto_bottom(), re_refresh_cursor(), sig_handler(), term__repaint(), and term__resetcolor().

el_private TTermManip& term__gettermmanip (  ) 

Definition at line 1454 of file term.cxx.

Referenced by term__atocolor(), term__resetcolor(), and term__setcolor().

el_protected int term__putc ( int  c  ) 

Definition at line 1475 of file term.cxx.

References NULL, and term__putcolorch().

Referenced by term_beep(), term_clear_EOL(), term_clear_screen(), term_deletechars(), term_insertwrite(), term_move_to_char(), and term_move_to_line().

el_protected int term__putcolorch ( int  c,
ElColor_t color 
)

Definition at line 1598 of file term.cxx.

References NULL, term__setcolor(), and term_outfile.

Referenced by re_clear_lines(), re_fastputc(), re_goto_bottom(), term__putc(), term_beep(), term_clear_EOL(), term_clear_screen(), term_insertwrite(), term_move_to_char(), term_move_to_line(), and term_overwrite().

el_protected void term__repaint ( EditLine_t el,
int  index 
)

Definition at line 1613 of file term.cxx.

References ElLine_t::fBufColor, ElLine_t::fBuffer, ElLine_t::fCursor, EditLine_t::fCursor, ElCoord_t::fH, EditLine_t::fLine, ElPrompt_t::fPos, EditLine_t::fPrompt, ElTerm_t::fSize, EditLine_t::fTerm, ElCoord_t::fV, line, term__flush(), term_move_to_char(), term_move_to_line(), and term_overwrite().

Referenced by colorBrackets(), colorWord(), and matchParentheses().

el_protected void term__resetcolor ( void   ) 

Definition at line 1464 of file term.cxx.

References TTermManip::ResetTerm(), term__flush(), and term__gettermmanip().

Referenced by rl_complete_internal().

el_protected void term__setcolor ( int  fgcol  ) 

Definition at line 1568 of file term.cxx.

References TTermManip::SetColor(), TTermManip::SetDefaultColor(), TTermManip::StartBold(), TTermManip::StartUnderline(), TTermManip::StopBold(), TTermManip::StopUnderline(), and term__gettermmanip().

Referenced by colorBrackets(), colorWord(), rl_complete_internal(), and term__putcolorch().

el_private void term_alloc ( EditLine_t ,
const struct TermCapStr_t ,
const char *   
)

Definition at line 405 of file term.cxx.

References ElTerm_t::fBuf, EditLine_t::fErrFile, ElTerm_t::fLoc, fprintf(), ElTerm_t::fStr, EditLine_t::fTerm, NULL, ptr, str, strcpy(), t, T_str, TC_BUFSIZE, tstr, and void.

Referenced by term_set().

el_private int term_alloc_display ( EditLine_t  ) 

Definition at line 496 of file term.cxx.

References b, c, el_free, el_malloc, EditLine_t::fDispColor, EditLine_t::fDisplay, ElTerm_t::fSize, EditLine_t::fTerm, EditLine_t::fVDispColor, EditLine_t::fVDisplay, i, if(), NULL, and size_t.

Referenced by term_rebuffer_display().

el_protected void term_beep ( EditLine_t el  ) 

Definition at line 1008 of file term.cxx.

References GoodStr, NULL, Str, T_bl, term__putc(), term__putcolorch(), tputs(), and void.

Referenced by c_gets(), ce_inc_search(), ed_unassigned(), el_beep(), el_gets(), el_push(), and em_delete_or_list().

el_protected void term_bind_arrow ( EditLine_t el  ) 

Definition at line 1351 of file term.cxx.

References A_K_NKEYS, arrow(), ED_SEQUENCE_LEAD_IN, ED_UNASSIGNED, ElMap_t::fAlt, ElTerm_t::fBuf, ElMap_t::fEmacs, ElTerm_t::fFKey, ElMap_t::fKey, EditLine_t::fMap, ElTerm_t::fStr, EditLine_t::fTerm, ElMap_t::fType, fType, ElMap_t::fVic, i, if(), j, key_add(), key_clear(), MAP_VI, NULL, p, term_reset_arrow(), XK_CMD, and XK_NOD.

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

el_protected int term_change_size ( EditLine_t el,
int  lins,
int  cols 
)

Definition at line 1181 of file term.cxx.

References re_clear_display(), T_co, T_li, term_rebuffer_display(), and Val.

Referenced by el_resize(), and term_set().

el_protected int term_clear_arrow ( EditLine_t el,
char *  name 
)

Definition at line 1314 of file term.cxx.

References A_K_NKEYS, arrow(), ElTerm_t::fFKey, EditLine_t::fTerm, fType, i, and XK_NOD.

Referenced by map_bind().

el_protected void term_clear_EOL ( EditLine_t el,
int  num 
)

Definition at line 971 of file term.cxx.

References EL_CAN_CEOL, EditLine_t::fCursor, ElCoord_t::fH, GoodStr, i, NULL, Str, T_ce, term__putc(), term__putcolorch(), tputs(), and void.

Referenced by re_clear_lines(), and re_update_line().

el_protected void term_clear_screen ( EditLine_t el  ) 

Definition at line 989 of file term.cxx.

References GoodStr, NULL, Str, T_cd, T_cl, T_ho, T_li, term__putc(), term__putcolorch(), tputs(), Val, and void.

Referenced by ed_clear_screen().

el_protected void term_deletechars ( EditLine_t el,
int  num 
)

Definition at line 849 of file term.cxx.

References EL_CAN_DELETE, EditLine_t::fErrFile, ElCoord_t::fH, fprintf(), ElTerm_t::fSize, EditLine_t::fTerm, GoodStr, Str, T_DC, T_dc, T_dm, T_ed, term__putc(), tputs(), and void.

Referenced by re_update_line().

el_protected int term_echotc ( EditLine_t el,
int  ,
const char **  argv 
)

Definition at line 1782 of file term.cxx.

References buf, EL_CAN_TAB, EL_HAS_AUTO_MARGINS, EL_HAS_MAGIC_MARGINS, EditLine_t::fOutFile, fprintf(), EditLine_t::fTTY, NULL, silent, t, T_km, ElTTY_t::t_speed, TC_BUFSIZE, Val, verbose, and void.

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

el_protected void term_end ( EditLine_t el  ) 

Definition at line 387 of file term.cxx.

References el_free, ElTerm_t::fBuf, ElTerm_t::fCap, ElTerm_t::fLoc, ElTerm_t::fStr, EditLine_t::fTerm, ElTerm_t::fVal, NULL, and term_free_display().

Referenced by el_end().

el_private void term_free_display ( EditLine_t  ) 

Definition at line 588 of file term.cxx.

References b, c, el_free, EditLine_t::fDispColor, EditLine_t::fDisplay, EditLine_t::fVDispColor, EditLine_t::fVDisplay, and NULL.

Referenced by term_end(), and term_rebuffer_display().

el_protected int term_get_size ( EditLine_t el,
int *  lins,
int *  cols 
)

Definition at line 1139 of file term.cxx.

References EditLine_t::fInFD, T_co, T_li, and Val.

Referenced by el_resize(), and term_set().

el_protected int term_init ( EditLine_t el  ) 

Definition at line 341 of file term.cxx.

References A_K_NKEYS, el_malloc, ElTerm_t::fBuf, ElTerm_t::fCap, ElTerm_t::fFKey, ElTerm_t::fLoc, EditLine_t::fOutFile, ElTerm_t::fStr, EditLine_t::fTerm, ElTerm_t::fVal, NULL, T_str, T_val, TC_BUFSIZE, term_init_arrow(), term_init_color(), term_outfile, term_set(), and void.

Referenced by el_init().

el_private void term_init_arrow ( EditLine_t  ) 

Definition at line 1201 of file term.cxx.

References A_K_DE, A_K_DN, A_K_EN, A_K_HO, A_K_LT, A_K_RT, A_K_UP, arrow(), ED_DELETE_NEXT_CHAR, ED_MOVE_TO_BEG, ED_MOVE_TO_END, ED_NEXT_CHAR, ED_NEXT_HISTORY, ED_PREV_CHAR, ED_PREV_HISTORY, ElTerm_t::fFKey, EditLine_t::fTerm, T_at7, T_kD, T_kd, T_kh, T_kl, T_kr, T_ku, and XK_CMD.

Referenced by term_init().

el_private void term_init_color ( EditLine_t  ) 

Definition at line 1412 of file term.cxx.

References ERR, EditLine_t::fFlags, fprintf(), getenv(), NO_TTY, and setupterm().

Referenced by term_init().

el_protected void term_insertwrite ( EditLine_t el,
const char *  cp,
ElColor_t color,
int  num 
)

Definition at line 897 of file term.cxx.

References EL_CAN_INSERT, EditLine_t::fCursor, EditLine_t::fErrFile, ElCoord_t::fH, fprintf(), ElTerm_t::fSize, EditLine_t::fTerm, GoodStr, Str, T_ei, T_IC, T_ic, T_im, T_ip, term__putc(), term__putcolorch(), term_overwrite(), tputs(), and void.

Referenced by re_update_line().

el_protected void term_move_to_char ( EditLine_t el,
int  where 
)

Definition at line 704 of file term.cxx.

References EL_CAN_TAB, EditLine_t::fCursor, EditLine_t::fDispColor, EditLine_t::fDisplay, EditLine_t::fErrFile, ElCoord_t::fH, fprintf(), ElTerm_t::fSize, EditLine_t::fTerm, ElCoord_t::fV, GoodStr, i, NULL, Str, T_ch, T_LE, T_RI, term__putc(), term__putcolorch(), term_overwrite(), tputs(), and void.

Referenced by re_clear_lines(), re_refresh_cursor(), re_update_line(), term__repaint(), and term_move_to_line().

el_protected void term_move_to_line ( EditLine_t el,
int  where 
)

Definition at line 645 of file term.cxx.

References EL_HAS_AUTO_MARGINS, EditLine_t::fCursor, EditLine_t::fDispColor, EditLine_t::fDisplay, EditLine_t::fErrFile, ElCoord_t::fH, fprintf(), ElTerm_t::fSize, EditLine_t::fTerm, ElCoord_t::fV, GoodStr, NULL, Str, T_DO, T_UP, T_up, term__putc(), term__putcolorch(), term_move_to_char(), term_overwrite(), tputs(), and void.

Referenced by re_clear_lines(), re_goto_bottom(), re_refresh_cursor(), re_update_line(), and term__repaint().

el_protected void term_overwrite ( EditLine_t el,
const char *  cp,
ElColor_t color,
int  n 
)

Definition at line 798 of file term.cxx.

References c, EL_HAS_AUTO_MARGINS, EL_HAS_MAGIC_MARGINS, EditLine_t::fCursor, EditLine_t::fDispColor, EditLine_t::fDisplay, EditLine_t::fErrFile, ElCoord_t::fH, fprintf(), ElTerm_t::fSize, EditLine_t::fTerm, ElCoord_t::fV, NULL, term__putcolorch(), term_overwrite(), and void.

Referenced by ed_delete_next_char(), em_delete_or_list(), re_update_line(), term__repaint(), term_insertwrite(), term_move_to_char(), term_move_to_line(), and term_overwrite().

el_protected void term_print_arrow ( EditLine_t el,
const char *  name 
)

Definition at line 1332 of file term.cxx.

References A_K_NKEYS, arrow(), ElTerm_t::fFKey, EditLine_t::fTerm, fType, i, key_kprint(), and XK_NOD.

Referenced by map_bind().

el_private int term_rebuffer_display ( EditLine_t  ) 

Definition at line 477 of file term.cxx.

References c, ElTerm_t::fSize, EditLine_t::fTerm, T_co, T_li, term_alloc_display(), term_free_display(), and Val.

Referenced by term_change_size().

el_private void term_reset_arrow ( EditLine_t  ) 

Definition at line 1245 of file term.cxx.

References A_K_DN, A_K_EN, A_K_HO, A_K_LT, A_K_RT, A_K_UP, arrow(), ElTerm_t::fFKey, EditLine_t::fMap, EditLine_t::fTerm, ElMap_t::fType, fType, key_add(), and MAP_VI.

Referenced by term_bind_arrow().

el_protected int term_set ( EditLine_t el,
const char *  term 
)

Definition at line 1040 of file term.cxx.

References buf, EDIT_DISABLED, ElTerm_t::fCap, EditLine_t::fErrFile, EditLine_t::fFlags, ElCoord_t::fH, fprintf(), ElTerm_t::fSize, EditLine_t::fTerm, ElCoord_t::fV, getenv(), i, NULL, SIG_BLOCK, SIG_SETMASK, t, T_am, T_co, T_km, T_li, T_MT, T_pt, T_xn, T_xt, TC_BUFSIZE, term_alloc(), term_bind_arrow(), term_change_size(), term_get_size(), term_setflags(), tstr, Val, and void.

Referenced by el_set(), and term_init().

el_protected int term_set_arrow ( EditLine_t el,
char *  name,
KeyValue_t fun,
int  type 
)

Definition at line 1295 of file term.cxx.

References A_K_NKEYS, arrow(), ElTerm_t::fFKey, EditLine_t::fTerm, and i.

Referenced by map_bind().

el_private void term_setflags ( EditLine_t  ) 

Definition at line 284 of file term.cxx.

References EL_CAN_CEOL, EL_CAN_DELETE, EL_CAN_INSERT, EL_CAN_UP, EL_FLAGS, EditLine_t::fErrFile, fprintf(), EditLine_t::fTTY, GoodStr, Str, T_am, T_ce, T_DC, T_dc, T_IC, T_ic, T_im, T_km, T_me, T_MT, T_pt, T_se, ElTTY_t::t_tabs, T_ue, T_UP, T_up, T_xn, T_xt, TERM_CAN_CEOL, TERM_CAN_DELETE, TERM_CAN_INSERT, TERM_CAN_ME, TERM_CAN_TAB, TERM_CAN_UP, TERM_HAS_AUTO_MARGINS, TERM_HAS_MAGIC_MARGINS, TERM_HAS_META, Val, and void.

Referenced by term_set().

el_protected int term_settc ( EditLine_t el,
int  ,
const char **  argv 
)

Definition at line 1694 of file term.cxx.

References TNamed::fName, NULL, ts, tstr, and what.

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

el_protected int term_telltc ( EditLine_t el,
int  ,
const char **   
)

Definition at line 1657 of file term.cxx.

References EL_BUFSIZ, EL_CAN_TAB, EL_HAS_AUTO_MARGINS, EL_HAS_MAGIC_MARGINS, EL_HAS_META, EditLine_t::fOutFile, fprintf(), ElTerm_t::fStr, EditLine_t::fTerm, key__decode_str(), NULL, t, T_co, T_li, ts, tstr, Val, and void.

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


Variable Documentation

el_private FILE* term_outfile = NULL

Definition at line 277 of file term.cxx.

Referenced by term__flush(), term__putcolorch(), and term_init().

el_private struct TermCapStr_t tstr[]

Referenced by SavePuk(), term_alloc(), term_set(), term_settc(), and term_telltc().

el_private struct TermCapVal_t tval[]

Referenced by TGuiBldMenuDialog::Build(), TRootContextMenu::Dialog(), TQCanvasMenu::Dialog(), XrdProofdManager::DoDirectiveRole(), XrdProofdProofServMgr::DoDirectiveShutdown(), RooBCPEffDecay::generateEvent(), RooBCPGenDecay::generateEvent(), RooBMixDecay::generateEvent(), RooNonCPEigenDecay::generateEvent(), RooDecay::generateEvent(), TInspectCanvas::InspectObject(), XrdFrmReqFile::ListL(), XrdSysCondVar::Wait(), XrdSysCondVar::WaitMS(), XrdOfsEvsMsg::XrdOfsEvsMsg(), and XrdOucTList::XrdOucTList().


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