init ct_termio
This commit is contained in:
parent
7466d19c5e
commit
17d763c597
2 changed files with 40 additions and 0 deletions
21
src/termio.c
Normal file
21
src/termio.c
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
#include "termio.h"
|
||||
|
||||
int termmode_raw(struct ct_term *restrict t) {
|
||||
t->termios.c_lflag &= ~(ISIG);
|
||||
}
|
||||
|
||||
/* Set ncurses terminal mode (buffering, character processing,
|
||||
* Key->SIG handling, and other termios(3) functionality).
|
||||
*/
|
||||
int termmode(struct ct_term *restrict t, const enum crs_termmode mode) {
|
||||
switch (mode) {
|
||||
case TMODE_RAW:
|
||||
return raw();
|
||||
case TMODE_CANON:
|
||||
return canon(); /* ITS A CANON EVENT OHMAHGOH */
|
||||
default:
|
||||
/* defaulting is not possible. */
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue