]> rtime.felk.cvut.cz Git - sysless.git/commitdiff
cmdproc: Add more comments
authorMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 31 Jul 2013 14:17:48 +0000 (16:17 +0200)
committerMichal Sojka <sojkam1@fel.cvut.cz>
Wed, 31 Jul 2013 14:17:48 +0000 (16:17 +0200)
libs4c/cmdproc/cmd_io_line.c
libs4c/cmdproc/cmd_proc.h
libs4c/cmdproc/cmdio_std_line.c

index a6631a9f13475dc553887f2d5c9d7af28e7ad78d..dd87c2d1cc2adec4fdfcada0aca5cb61547d5040 100644 (file)
@@ -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;
index 1f0cf00194cf7fb03d06039fafe260cffeb60140..db6d423d1f38ba592c0e047ccd8f8af8ddcfeb27 100644 (file)
@@ -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 {
index 2de0865f4fe81acf0323f75d2668089d78e8713d..34fd5c849ac04110d2bb480589edd9dd477b7add 100644 (file)
@@ -1,3 +1,12 @@
+/**
+ * @file   cmdio_std_line.c
+ * @author Michal Sojka <sojkam1@fel.cvut.cz>
+ * @date   Wed Jul 31 16:05:10 2013
+ *
+ * @brief  cmd_io_line implementation for stdin/stdout.
+ *
+ */
+
 #include <cmd_proc.h>
 #include <string.h>
 #include "cmdio_std.h"