TERMCAP is a library and data base that enables programs to use display terminals in a terminal-independent manner
The tgetent() function looks up the termcap entry for name. The emulation ignores the buffer pointer bp.
The tgetstr() function gets the string entry for id. If area is not a null pointer and does not point to a null pointer,
tgetstr() copies the string entry into the buffer pointed to by *area and advances the variable pointed to by area to the first byte after the copy of the string entry.
The tgoto() function instantiates the parameters col and row into the capability cap and returns a pointer to the resulting
string.
- Setting the terminal;
- Get signals;
- Create the list of the arguments;
- Print the list;
- Do keyhooks;
- End seesion and set terminal back.
- Look up the description of the terminal type in use, using tgetent() and tgetent();
- Get the parrameters (key pressed immediately by the user) using tcgetattr()
- Setting the terminal into nonconincal mode, allows to set how many characters should be read
before input is given to the program. (&= ~ICANON) unset a flag using bit mask operation;
ICANON - "line editing" mode, terminal buffers line at a time;
ECHO - controls wheter input is immediately re-echoed as output; - Set buffer size to 1 byte and time wait to 0 sec, (VMIN, VTIME)
- Set the attributes of the terminal making change immediately;
- Extract information we will use using tgetstr(), tputs();