1 #ifndef __LUNAIX_TERM_H
2 #define __LUNAIX_TERM_H
4 #include <lunaix/device.h>
5 #include <lunaix/ds/rbuffer.h>
6 #include <lunaix/signal_defs.h>
8 #include <usr/lunaix/term.h>
15 struct rbuffer* current;
19 #define LSTATE_EOL (1)
20 #define LSTATE_EOF (1 << 1)
21 #define LSTATE_SIGRAISE (1 << 2)
23 typedef struct rbuffer** lbuf_ref_t;
24 #define ref_current(lbuf) (&(lbuf)->current)
25 #define ref_next(lbuf) (&(lbuf)->next)
26 #define deref(bref) (*(bref))
31 int (*process_and_put)(struct term*, struct linebuffer*, char);
38 struct term_lcntl* lcntl;
39 struct linebuffer line_out;
40 struct linebuffer line_in;
45 int (*set_speed)(struct device*, speed_t);
48 /* -- POSIX.1-2008 compliant fields -- */
56 extern struct device* sysconsole;
59 term_create(struct device* chardev, char* suffix);
62 term_bind(struct term* tdev, struct device* chdev);
65 term_push_lcntl(struct term* tdev, struct term_lcntl* lcntl);
68 term_pop_lcntl(struct term* tdev);
71 term_get_lcntl(u32_t lcntl_index);
74 line_flip(struct linebuffer* lbf)
76 struct rbuffer* tmp = lbf->current;
77 lbf->current = lbf->next;
82 line_alloc(struct linebuffer* lbf, size_t sz_hlf);
85 line_free(struct linebuffer* lbf, size_t sz_hlf);
88 term_sendsig(struct term* tdev, int signal);
91 term_flush(struct term* tdev);
94 term_read(struct term* tdev);
97 lcntl_transform_inseq(struct term* tdev);
100 lcntl_transform_outseq(struct term* tdev);
102 #endif /* __LUNAIX_TERM_H */