1 #ifndef __LUNAIX_LCNTL_H
2 #define __LUNAIX_LCNTL_H
6 #define LCNTLF_SPECIAL_CHAR 0b000001
7 #define LCNTLF_CLEAR_INBUF 0b000010
8 #define LCNTLF_CLEAR_OUTBUF 0b000100
9 #define LCNTLF_STOP 0b001000
18 tcflag_t _if; // iflags
19 tcflag_t _of; // oflags
20 tcflag_t _lf; // local flags
21 tcflag_t _cf; // control flags
22 tcflag_t _sf; // state flags
23 enum lcntl_dir direction;
25 struct linebuffer* active_line;
26 struct rbuffer* inbuf;
27 struct rbuffer* outbuf;
28 struct rbuffer* echobuf;
32 lcntl_put_char(struct lcntl_state* state, char c);
35 lcntl_set_flag(struct lcntl_state* state, int flags)
41 lcntl_raise_line_event(struct lcntl_state* state, int event)
43 state->active_line->sflags |= event;
47 lcntl_unset_flag(struct lcntl_state* state, int flags)
53 lcntl_test_flag(struct lcntl_state* state, int flags)
55 return !!(state->_sf & flags);
59 lcntl_outbound(struct lcntl_state* state)
61 return (state->direction == OUTBOUND);
65 lcntl_inbound(struct lcntl_state* state)
67 return (state->direction == INBOUND);
71 lcntl_check_echo(struct lcntl_state* state, int echo_type)
73 return lcntl_inbound(state) && (state->_lf & echo_type);
77 #endif /* __LUNAIX_LCNTL_H */