rdline: move some constants in configuration file
authorOlivier Matz <zer0@droids-corp.org>
Thu, 26 Mar 2015 18:40:47 +0000 (19:40 +0100)
committerOlivier Matz <zer0@droids-corp.org>
Thu, 26 Mar 2015 18:45:59 +0000 (19:45 +0100)
In case the user wants to modify them.

Signed-off-by: Gregor Riepl <onitake@gmail.com>
Signed-off-by: Olivier Matz <zer0@droids-corp.org>
modules/ihm/rdline/config/rdline_config.h
modules/ihm/rdline/rdline.h
modules/ihm/rdline/test/rdline_config.h

index e69de29..961e8a1 100644 (file)
@@ -0,0 +1,13 @@
+/* configuration file for rdline module */
+
+/* Size of the line buffer */
+#define RDLINE_BUF_SIZE 64
+
+/* Size of the prompt buffer */
+#define RDLINE_PROMPT_SIZE  16
+
+/* Size of the buffer used to decode vt100 codes */
+#define RDLINE_VT100_BUF_SIZE  8
+
+/* Size of history buffer (in chars) */
+#define RDLINE_HISTORY_BUF_SIZE 128
index 40bd20d..e99abb7 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <cirbuf.h>
 #include <vt100.h>
+#include <rdline_config.h>
 
 #define vt100_bell         "\007"
 #define vt100_bs           "\010"
 #define vt100_word_left    "\033\142"
 #define vt100_word_right   "\033\146"
 
-/* configuration */
+/* default configuration */
+#ifndef RDLINE_BUF_SIZE
 #define RDLINE_BUF_SIZE 64
+#endif
+#ifndef RDLINE_PROMPT_SIZE
 #define RDLINE_PROMPT_SIZE  16
+#endif
+#ifndef RDLINE_VT100_BUF_SIZE
 #define RDLINE_VT100_BUF_SIZE  8
+#endif
+#ifndef RDLINE_HISTORY_BUF_SIZE
 #define RDLINE_HISTORY_BUF_SIZE 128
-#define RDLINE_HISTORY_MAX_LINE 64
+#endif
 
 enum rdline_status {
        RDLINE_STOPPED,
index e69de29..961e8a1 100644 (file)
@@ -0,0 +1,13 @@
+/* configuration file for rdline module */
+
+/* Size of the line buffer */
+#define RDLINE_BUF_SIZE 64
+
+/* Size of the prompt buffer */
+#define RDLINE_PROMPT_SIZE  16
+
+/* Size of the buffer used to decode vt100 codes */
+#define RDLINE_VT100_BUF_SIZE  8
+
+/* Size of history buffer (in chars) */
+#define RDLINE_HISTORY_BUF_SIZE 128