From b71e1aaea66e6ff74e050911811a6a87735bbdd2 Mon Sep 17 00:00:00 2001 From: Michal Sojka Date: Wed, 31 Jul 2013 16:17:48 +0200 Subject: [PATCH] cmdproc: Add more comments --- libs4c/cmdproc/cmd_io_line.c | 2 +- libs4c/cmdproc/cmd_proc.h | 11 ++++++++--- libs4c/cmdproc/cmdio_std_line.c | 9 +++++++++ 3 files changed, 18 insertions(+), 4 deletions(-) diff --git a/libs4c/cmdproc/cmd_io_line.c b/libs4c/cmdproc/cmd_io_line.c index a6631a9..dd87c2d 100644 --- a/libs4c/cmdproc/cmd_io_line.c +++ b/libs4c/cmdproc/cmd_io_line.c @@ -85,7 +85,7 @@ int cmd_io_line_out(cmd_io_t *cmd_io) return 1; } -/* process input */ +/* process input & perform echo if requested */ int cmd_io_line_in(cmd_io_t *cmd_io) { int ch; diff --git a/libs4c/cmdproc/cmd_proc.h b/libs4c/cmdproc/cmd_proc.h index 1f0cf00..db6d423 100644 --- a/libs4c/cmdproc/cmd_proc.h +++ b/libs4c/cmdproc/cmd_proc.h @@ -28,7 +28,9 @@ #define FL_ELB_ECHO 0x10 /* Read characters are echoed back */ #define FL_ELB_INSEND 0x20 /* The line is currently being sent */ -#define FL_ELB_NOCRLF 0x40 /* CR and/or LF will not start the new line */ +#define FL_ELB_NOCRLF 0x40 /* CR and/or LF will not start a new + * line (used for out buffers to store + * more than a single line) */ #define CMD_DES_CONTINUE_AT_ID ((cmd_des_t*)1) #define CMD_DES_INCLUDE_SUBLIST_ID ((cmd_des_t*)2) #define CMD_DES_CONTINUE_AT(list) CMD_DES_CONTINUE_AT_ID,((cmd_des_t*)list) @@ -58,8 +60,11 @@ typedef struct cmd_io{ int (*read)(struct cmd_io *cmd_io,void *buf,int count); union { struct { - ed_line_buf_t *in; - ed_line_buf_t *out; + ed_line_buf_t *in; /* Buffer for storing the read command line */ + ed_line_buf_t *out; /* Temporarily stores characters to be sent + * out (until the send operation is + * finished). This is not used for echo + * handling. */ struct cmd_io *io_stack; } ed_line; struct { diff --git a/libs4c/cmdproc/cmdio_std_line.c b/libs4c/cmdproc/cmdio_std_line.c index 2de0865..34fd5c8 100644 --- a/libs4c/cmdproc/cmdio_std_line.c +++ b/libs4c/cmdproc/cmdio_std_line.c @@ -1,3 +1,12 @@ +/** + * @file cmdio_std_line.c + * @author Michal Sojka + * @date Wed Jul 31 16:05:10 2013 + * + * @brief cmd_io_line implementation for stdin/stdout. + * + */ + #include #include #include "cmdio_std.h" -- 2.39.2