From: Olivier Matz Date: Thu, 26 Mar 2015 18:40:47 +0000 (+0100) Subject: rdline: move some constants in configuration file X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=9697d3e28eea4168a95577bacdb43ea64f90f3f7;p=aversive.git rdline: move some constants in configuration file In case the user wants to modify them. Signed-off-by: Gregor Riepl Signed-off-by: Olivier Matz --- diff --git a/modules/ihm/rdline/config/rdline_config.h b/modules/ihm/rdline/config/rdline_config.h index e69de29..961e8a1 100644 --- a/modules/ihm/rdline/config/rdline_config.h +++ b/modules/ihm/rdline/config/rdline_config.h @@ -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 diff --git a/modules/ihm/rdline/rdline.h b/modules/ihm/rdline/rdline.h index 40bd20d..e99abb7 100644 --- a/modules/ihm/rdline/rdline.h +++ b/modules/ihm/rdline/rdline.h @@ -33,6 +33,7 @@ #include #include +#include #define vt100_bell "\007" #define vt100_bs "\010" @@ -56,12 +57,19 @@ #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, diff --git a/modules/ihm/rdline/test/rdline_config.h b/modules/ihm/rdline/test/rdline_config.h index e69de29..961e8a1 100644 --- a/modules/ihm/rdline/test/rdline_config.h +++ b/modules/ihm/rdline/test/rdline_config.h @@ -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