I was trying to look into the termios structure in C. I wanted to know how the value to the several flags are assigned in the terminal. I could not understand how the c_cc
array in the structure gets its value assigned to its various indexes. Is it through the input we give in the terminal. Or is there some other way the values are assigned to this variable.?
#include <termios.h>
struct termios {
tcflag_t c_iflag;
tcflag_t c_oflag;
tcflag_t c_cflag;
tcflag_t c_lflag;
cc_t c_cc[NCCS];
speed_t c_ispeed;
speed_t c_ospeed;
};
tcflag_t
and speed_t
are unsigned int
, cc_t
is unsigned char
.