1 #ifndef __LUNAIX_TERM_H
2 #define __LUNAIX_TERM_H
4 #include <lunaix/device.h>
10 struct llist_header lcntls;
11 size_t (*apply)(struct term* termdev, char* line, size_t len);
26 struct llist_header lcntl_stack;
27 struct linebuffer line;
35 term_bind(struct term* tdev, struct device* chdev);
38 term_push_lcntl(struct term* tdev, struct term_lcntl* lcntl);
41 term_pop_lcntl(struct term* tdev);
44 term_get_lcntl(u32_t lcntl_index);
47 line_flip(struct linebuffer* lbf);
50 line_alloc(struct linebuffer* lbf, size_t sz_hlf);
53 line_free(struct linebuffer* lbf, size_t sz_hlf);
56 line_put_next(struct linebuffer* lbf, char val, int delta)
58 size_t dptr = (size_t)(lbf->ptr + delta);
59 if (dptr >= lbf->sz_hlf) {
63 lbf->next[dptr] = val;
69 term_sendline(struct term* tdev, size_t len);
72 term_readline(struct term* tdev, size_t len);
74 #endif /* __LUNAIX_TERM_H */