]> rtime.felk.cvut.cz Git - sysless.git/blob - libs4c/cmdproc/cmdio_std_line.c
34fd5c849ac04110d2bb480589edd9dd477b7add
[sysless.git] / libs4c / cmdproc / cmdio_std_line.c
1 /**
2  * @file   cmdio_std_line.c
3  * @author Michal Sojka <sojkam1@fel.cvut.cz>
4  * @date   Wed Jul 31 16:05:10 2013
5  *
6  * @brief  cmd_io_line implementation for stdin/stdout.
7  *
8  */
9
10 #include <cmd_proc.h>
11 #include <string.h>
12 #include "cmdio_std.h"
13
14 #define ED_LINE_CHARS 80
15
16 char ed_line_in_std[ED_LINE_CHARS+1];
17 char ed_line_out_std[ED_LINE_CHARS+1];
18
19
20 ed_line_buf_t ed_line_buf_in_std={
21 //    flg:FL_ELB_ECHO,
22     inbuf:0,
23     alloc:sizeof(ed_line_in_std),
24     maxlen:0,
25     lastch:0,
26     buf:ed_line_in_std
27 };
28
29 ed_line_buf_t ed_line_buf_out_std={
30     flg:FL_ELB_NOCRLF,
31     inbuf:0,
32     alloc:sizeof(ed_line_out_std),
33     maxlen:0,
34     lastch:0,
35     buf:ed_line_out_std
36 };
37
38 extern cmd_io_t cmd_io_std;
39 const cmd_io_t cmd_io_std_line={
40     putc:cmd_io_line_putc,
41     getc:NULL,
42     write:cmd_io_write_bychar,
43     read:NULL,
44     priv:{
45         ed_line:{
46             in: &ed_line_buf_in_std,
47             out:&ed_line_buf_out_std,
48             io_stack:&cmd_io_std
49         }
50     }
51 };