\section{aversive\_\-10-03-12/modules/ihm/rdline/rdline.h File Reference}
\label{rdline_8h}\index{aversive\_\-10-03-12/modules/ihm/rdline/rdline.h@{aversive\_\-10-03-12/modules/ihm/rdline/rdline.h}}
{\tt \#include $<$cirbuf.h$>$}\par
{\tt \#include $<$vt100.h$>$}\par
\subsection*{Data Structures}
\begin{CompactItemize}
\item 
struct {\bf rdline}
\end{CompactItemize}
\subsection*{Defines}
\begin{CompactItemize}
\item 
\#define {\bf vt100\_\-bell}~\char`\"{}$\backslash$007\char`\"{}
\item 
\#define {\bf vt100\_\-bs}~\char`\"{}$\backslash$010\char`\"{}
\item 
\#define {\bf vt100\_\-bs\_\-clear}~\char`\"{}$\backslash$010 $\backslash$010\char`\"{}
\item 
\#define {\bf vt100\_\-tab}~\char`\"{}$\backslash$011\char`\"{}
\item 
\#define {\bf vt100\_\-crnl}~\char`\"{}$\backslash$012$\backslash$015\char`\"{}
\item 
\#define {\bf vt100\_\-clear\_\-right}~\char`\"{}$\backslash$033[0K\char`\"{}
\item 
\#define {\bf vt100\_\-clear\_\-left}~\char`\"{}$\backslash$033[1K\char`\"{}
\item 
\#define {\bf vt100\_\-clear\_\-down}~\char`\"{}$\backslash$033[0J\char`\"{}
\item 
\#define {\bf vt100\_\-clear\_\-up}~\char`\"{}$\backslash$033[1J\char`\"{}
\item 
\#define {\bf vt100\_\-clear\_\-line}~\char`\"{}$\backslash$033[2K\char`\"{}
\item 
\#define {\bf vt100\_\-clear\_\-screen}~\char`\"{}$\backslash$033[2J\char`\"{}
\item 
\#define {\bf vt100\_\-up\_\-arr}~\char`\"{}$\backslash$033$\backslash$133$\backslash$101\char`\"{}
\item 
\#define {\bf vt100\_\-down\_\-arr}~\char`\"{}$\backslash$033$\backslash$133$\backslash$102\char`\"{}
\item 
\#define {\bf vt100\_\-right\_\-arr}~\char`\"{}$\backslash$033$\backslash$133$\backslash$103\char`\"{}
\item 
\#define {\bf vt100\_\-left\_\-arr}~\char`\"{}$\backslash$033$\backslash$133$\backslash$104\char`\"{}
\item 
\#define {\bf vt100\_\-multi\_\-right}~\char`\"{}$\backslash$033$\backslash$133\%uC\char`\"{}
\item 
\#define {\bf vt100\_\-multi\_\-left}~\char`\"{}$\backslash$033$\backslash$133\%uD\char`\"{}
\item 
\#define {\bf vt100\_\-suppr}~\char`\"{}$\backslash$033$\backslash$133$\backslash$063$\backslash$176\char`\"{}
\item 
\#define {\bf vt100\_\-home}~\char`\"{}$\backslash$033M$\backslash$033E\char`\"{}
\item 
\#define {\bf vt100\_\-word\_\-left}~\char`\"{}$\backslash$033$\backslash$142\char`\"{}
\item 
\#define {\bf vt100\_\-word\_\-right}~\char`\"{}$\backslash$033$\backslash$146\char`\"{}
\item 
\#define {\bf RDLINE\_\-BUF\_\-SIZE}~64
\item 
\#define {\bf RDLINE\_\-PROMPT\_\-SIZE}~16
\item 
\#define {\bf RDLINE\_\-VT100\_\-BUF\_\-SIZE}~8
\item 
\#define {\bf RDLINE\_\-HISTORY\_\-BUF\_\-SIZE}~128
\item 
\#define {\bf RDLINE\_\-HISTORY\_\-MAX\_\-LINE}~64
\end{CompactItemize}
\subsection*{Typedefs}
\begin{CompactItemize}
\item 
typedef void( {\bf rdline\_\-write\_\-char\_\-t} )(char)
\item 
typedef void( {\bf rdline\_\-validate\_\-t} )(const char $\ast$buf, uint8\_\-t size)
\item 
typedef int8\_\-t( {\bf rdline\_\-complete\_\-t} )(const char $\ast$buf, char $\ast$dstbuf, uint8\_\-t dstsize, int16\_\-t $\ast$state)
\end{CompactItemize}
\subsection*{Enumerations}
\begin{CompactItemize}
\item 
enum {\bf rdline\_\-status} \{ {\bf RDLINE\_\-INIT}, 
{\bf RDLINE\_\-RUNNING}
 \}
\end{CompactItemize}
\subsection*{Functions}
\begin{CompactItemize}
\item 
void {\bf rdline\_\-init} (struct {\bf rdline} $\ast$rdl, {\bf rdline\_\-write\_\-char\_\-t} $\ast$write\_\-char, {\bf rdline\_\-validate\_\-t} $\ast$validate, {\bf rdline\_\-complete\_\-t} $\ast$complete)
\item 
void {\bf rdline\_\-newline} (struct {\bf rdline} $\ast$rdl, const char $\ast$prompt)
\item 
void {\bf rdline\_\-stop} (struct {\bf rdline} $\ast$rdl)
\item 
void {\bf rdline\_\-restart} (struct {\bf rdline} $\ast$rdl)
\item 
void {\bf rdline\_\-redisplay} (struct {\bf rdline} $\ast$rdl)
\item 
int8\_\-t {\bf rdline\_\-char\_\-in} (struct {\bf rdline} $\ast$rdl, char c)
\item 
const char $\ast$ {\bf rdline\_\-get\_\-buffer} (struct {\bf rdline} $\ast$rdl)
\item 
int8\_\-t {\bf rdline\_\-add\_\-history} (struct {\bf rdline} $\ast$rdl, const char $\ast$buf)
\item 
void {\bf rdline\_\-clear\_\-history} (struct {\bf rdline} $\ast$rdl)
\item 
char $\ast$ {\bf rdline\_\-get\_\-history\_\-item} (struct {\bf rdline} $\ast$rdl, uint8\_\-t {\bf i})
\end{CompactItemize}


\subsection{Define Documentation}
\index{rdline.h@{rdline.h}!RDLINE\_\-BUF\_\-SIZE@{RDLINE\_\-BUF\_\-SIZE}}
\index{RDLINE\_\-BUF\_\-SIZE@{RDLINE\_\-BUF\_\-SIZE}!rdline.h@{rdline.h}}
\subsubsection[RDLINE\_\-BUF\_\-SIZE]{\setlength{\rightskip}{0pt plus 5cm}\#define RDLINE\_\-BUF\_\-SIZE~64}\label{rdline_8h_8ad4b5c72420bd7a7e59265beb5b2fdd}




Definition at line 60 of file rdline.h.

Referenced by rdline\_\-char\_\-in(), and rdline\_\-newline().\index{rdline.h@{rdline.h}!RDLINE\_\-HISTORY\_\-BUF\_\-SIZE@{RDLINE\_\-HISTORY\_\-BUF\_\-SIZE}}
\index{RDLINE\_\-HISTORY\_\-BUF\_\-SIZE@{RDLINE\_\-HISTORY\_\-BUF\_\-SIZE}!rdline.h@{rdline.h}}
\subsubsection[RDLINE\_\-HISTORY\_\-BUF\_\-SIZE]{\setlength{\rightskip}{0pt plus 5cm}\#define RDLINE\_\-HISTORY\_\-BUF\_\-SIZE~128}\label{rdline_8h_2d148b416c5eae72d9a79bcd1894836f}




Definition at line 63 of file rdline.h.

Referenced by rdline\_\-init().\index{rdline.h@{rdline.h}!RDLINE\_\-HISTORY\_\-MAX\_\-LINE@{RDLINE\_\-HISTORY\_\-MAX\_\-LINE}}
\index{RDLINE\_\-HISTORY\_\-MAX\_\-LINE@{RDLINE\_\-HISTORY\_\-MAX\_\-LINE}!rdline.h@{rdline.h}}
\subsubsection[RDLINE\_\-HISTORY\_\-MAX\_\-LINE]{\setlength{\rightskip}{0pt plus 5cm}\#define RDLINE\_\-HISTORY\_\-MAX\_\-LINE~64}\label{rdline_8h_ba97710e05bbf5798aee30c109920cb4}




Definition at line 64 of file rdline.h.\index{rdline.h@{rdline.h}!RDLINE\_\-PROMPT\_\-SIZE@{RDLINE\_\-PROMPT\_\-SIZE}}
\index{RDLINE\_\-PROMPT\_\-SIZE@{RDLINE\_\-PROMPT\_\-SIZE}!rdline.h@{rdline.h}}
\subsubsection[RDLINE\_\-PROMPT\_\-SIZE]{\setlength{\rightskip}{0pt plus 5cm}\#define RDLINE\_\-PROMPT\_\-SIZE~16}\label{rdline_8h_2b1c6a5ea91c086f8b281f1e04d0911c}




Definition at line 61 of file rdline.h.\index{rdline.h@{rdline.h}!RDLINE\_\-VT100\_\-BUF\_\-SIZE@{RDLINE\_\-VT100\_\-BUF\_\-SIZE}}
\index{RDLINE\_\-VT100\_\-BUF\_\-SIZE@{RDLINE\_\-VT100\_\-BUF\_\-SIZE}!rdline.h@{rdline.h}}
\subsubsection[RDLINE\_\-VT100\_\-BUF\_\-SIZE]{\setlength{\rightskip}{0pt plus 5cm}\#define RDLINE\_\-VT100\_\-BUF\_\-SIZE~8}\label{rdline_8h_66d8b618dc06d0698f14fa7022238605}




Definition at line 62 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-bell@{vt100\_\-bell}}
\index{vt100\_\-bell@{vt100\_\-bell}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-bell]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-bell~\char`\"{}$\backslash$007\char`\"{}}\label{rdline_8h_21c4d63157eb27bed0fa88fe739fe99b}


This library is a small equivalent to the GNU readline library, but it is designed for small systems, like Atmel AVR microcontrollers (8 bits). Indeed, we don't use any malloc that is sometimes not implemented on such systems. 

Definition at line 37 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-bs@{vt100\_\-bs}}
\index{vt100\_\-bs@{vt100\_\-bs}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-bs]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-bs~\char`\"{}$\backslash$010\char`\"{}}\label{rdline_8h_d431d1985d6afb349040f258b7efb3b2}




Definition at line 38 of file rdline.h.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!vt100\_\-bs\_\-clear@{vt100\_\-bs\_\-clear}}
\index{vt100\_\-bs\_\-clear@{vt100\_\-bs\_\-clear}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-bs\_\-clear]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-bs\_\-clear~\char`\"{}$\backslash$010 $\backslash$010\char`\"{}}\label{rdline_8h_b3817400233f1fe78f8f2900bc198006}




Definition at line 39 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-clear\_\-down@{vt100\_\-clear\_\-down}}
\index{vt100\_\-clear\_\-down@{vt100\_\-clear\_\-down}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-clear\_\-down]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-clear\_\-down~\char`\"{}$\backslash$033[0J\char`\"{}}\label{rdline_8h_41a313cdeb40ed06bbcb0ecc37ec41d3}




Definition at line 44 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-clear\_\-left@{vt100\_\-clear\_\-left}}
\index{vt100\_\-clear\_\-left@{vt100\_\-clear\_\-left}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-clear\_\-left]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-clear\_\-left~\char`\"{}$\backslash$033[1K\char`\"{}}\label{rdline_8h_56eb7b4e8284304f3e8b1bd1bedd736d}




Definition at line 43 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-clear\_\-line@{vt100\_\-clear\_\-line}}
\index{vt100\_\-clear\_\-line@{vt100\_\-clear\_\-line}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-clear\_\-line]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-clear\_\-line~\char`\"{}$\backslash$033[2K\char`\"{}}\label{rdline_8h_58733c321b0df39bddcee99566785170}




Definition at line 46 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-clear\_\-right@{vt100\_\-clear\_\-right}}
\index{vt100\_\-clear\_\-right@{vt100\_\-clear\_\-right}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-clear\_\-right]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-clear\_\-right~\char`\"{}$\backslash$033[0K\char`\"{}}\label{rdline_8h_e205cfae7e989f33212d08d076bb1e46}




Definition at line 42 of file rdline.h.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!vt100\_\-clear\_\-screen@{vt100\_\-clear\_\-screen}}
\index{vt100\_\-clear\_\-screen@{vt100\_\-clear\_\-screen}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-clear\_\-screen]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-clear\_\-screen~\char`\"{}$\backslash$033[2J\char`\"{}}\label{rdline_8h_998d9fff7c91523a11be688964bb19a0}




Definition at line 47 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-clear\_\-up@{vt100\_\-clear\_\-up}}
\index{vt100\_\-clear\_\-up@{vt100\_\-clear\_\-up}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-clear\_\-up]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-clear\_\-up~\char`\"{}$\backslash$033[1J\char`\"{}}\label{rdline_8h_99194c07d343e12a2dd7a4f7514cc442}




Definition at line 45 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-crnl@{vt100\_\-crnl}}
\index{vt100\_\-crnl@{vt100\_\-crnl}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-crnl]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-crnl~\char`\"{}$\backslash$012$\backslash$015\char`\"{}}\label{rdline_8h_1c6762dd195db327ff2b350e89943b8d}




Definition at line 41 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-down\_\-arr@{vt100\_\-down\_\-arr}}
\index{vt100\_\-down\_\-arr@{vt100\_\-down\_\-arr}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-down\_\-arr]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-down\_\-arr~\char`\"{}$\backslash$033$\backslash$133$\backslash$102\char`\"{}}\label{rdline_8h_c39c8f911574f17fef171b6cd2fe0caa}




Definition at line 49 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-home@{vt100\_\-home}}
\index{vt100\_\-home@{vt100\_\-home}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-home]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-home~\char`\"{}$\backslash$033M$\backslash$033E\char`\"{}}\label{rdline_8h_2dfb98909356df73e9d072434cf76228}




Definition at line 55 of file rdline.h.

Referenced by rdline\_\-redisplay().\index{rdline.h@{rdline.h}!vt100\_\-left\_\-arr@{vt100\_\-left\_\-arr}}
\index{vt100\_\-left\_\-arr@{vt100\_\-left\_\-arr}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-left\_\-arr]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-left\_\-arr~\char`\"{}$\backslash$033$\backslash$133$\backslash$104\char`\"{}}\label{rdline_8h_4afe7f1b78859491517c5f9bd22a7dfe}




Definition at line 51 of file rdline.h.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!vt100\_\-multi\_\-left@{vt100\_\-multi\_\-left}}
\index{vt100\_\-multi\_\-left@{vt100\_\-multi\_\-left}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-multi\_\-left]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-multi\_\-left~\char`\"{}$\backslash$033$\backslash$133\%uD\char`\"{}}\label{rdline_8h_e5e4afadf23c3db011c0ad4030a86f96}




Definition at line 53 of file rdline.h.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!vt100\_\-multi\_\-right@{vt100\_\-multi\_\-right}}
\index{vt100\_\-multi\_\-right@{vt100\_\-multi\_\-right}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-multi\_\-right]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-multi\_\-right~\char`\"{}$\backslash$033$\backslash$133\%uC\char`\"{}}\label{rdline_8h_562a45bc5c5d9b1bb84e0cf83e33234c}




Definition at line 52 of file rdline.h.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!vt100\_\-right\_\-arr@{vt100\_\-right\_\-arr}}
\index{vt100\_\-right\_\-arr@{vt100\_\-right\_\-arr}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-right\_\-arr]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-right\_\-arr~\char`\"{}$\backslash$033$\backslash$133$\backslash$103\char`\"{}}\label{rdline_8h_4a88bdf38c03bd971ec377cc47a35351}




Definition at line 50 of file rdline.h.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!vt100\_\-suppr@{vt100\_\-suppr}}
\index{vt100\_\-suppr@{vt100\_\-suppr}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-suppr]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-suppr~\char`\"{}$\backslash$033$\backslash$133$\backslash$063$\backslash$176\char`\"{}}\label{rdline_8h_0853e5de1f3257c01af9c5ab53140882}




Definition at line 54 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-tab@{vt100\_\-tab}}
\index{vt100\_\-tab@{vt100\_\-tab}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-tab]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-tab~\char`\"{}$\backslash$011\char`\"{}}\label{rdline_8h_796e1ae4770f96867daf5d1fd8a61e04}




Definition at line 40 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-up\_\-arr@{vt100\_\-up\_\-arr}}
\index{vt100\_\-up\_\-arr@{vt100\_\-up\_\-arr}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-up\_\-arr]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-up\_\-arr~\char`\"{}$\backslash$033$\backslash$133$\backslash$101\char`\"{}}\label{rdline_8h_adfde3b9cb595cdbdf76dcee6cbd42ff}




Definition at line 48 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-word\_\-left@{vt100\_\-word\_\-left}}
\index{vt100\_\-word\_\-left@{vt100\_\-word\_\-left}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-word\_\-left]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-word\_\-left~\char`\"{}$\backslash$033$\backslash$142\char`\"{}}\label{rdline_8h_8011ab1b5de0bde99b592769485039f3}




Definition at line 56 of file rdline.h.\index{rdline.h@{rdline.h}!vt100\_\-word\_\-right@{vt100\_\-word\_\-right}}
\index{vt100\_\-word\_\-right@{vt100\_\-word\_\-right}!rdline.h@{rdline.h}}
\subsubsection[vt100\_\-word\_\-right]{\setlength{\rightskip}{0pt plus 5cm}\#define vt100\_\-word\_\-right~\char`\"{}$\backslash$033$\backslash$146\char`\"{}}\label{rdline_8h_d3b19254b91b200670e99c9862f064bd}




Definition at line 57 of file rdline.h.

\subsection{Typedef Documentation}
\index{rdline.h@{rdline.h}!rdline\_\-complete\_\-t@{rdline\_\-complete\_\-t}}
\index{rdline\_\-complete\_\-t@{rdline\_\-complete\_\-t}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-complete\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef int8\_\-t( {\bf rdline\_\-complete\_\-t})(const char $\ast$buf, char $\ast$dstbuf, uint8\_\-t dstsize, int16\_\-t $\ast$state)}\label{rdline_8h_ae179aec31b922a085caa4c1cba38c16}




Definition at line 75 of file rdline.h.\index{rdline.h@{rdline.h}!rdline\_\-validate\_\-t@{rdline\_\-validate\_\-t}}
\index{rdline\_\-validate\_\-t@{rdline\_\-validate\_\-t}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-validate\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef void( {\bf rdline\_\-validate\_\-t})(const char $\ast$buf, uint8\_\-t size)}\label{rdline_8h_535118cb96f47a44912ebe8cdd2a865a}




Definition at line 74 of file rdline.h.\index{rdline.h@{rdline.h}!rdline\_\-write\_\-char\_\-t@{rdline\_\-write\_\-char\_\-t}}
\index{rdline\_\-write\_\-char\_\-t@{rdline\_\-write\_\-char\_\-t}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-write\_\-char\_\-t]{\setlength{\rightskip}{0pt plus 5cm}typedef void( {\bf rdline\_\-write\_\-char\_\-t})(char)}\label{rdline_8h_4b5b86f1136efbc165f7e7378da54dd9}




Definition at line 73 of file rdline.h.

\subsection{Enumeration Type Documentation}
\index{rdline.h@{rdline.h}!rdline\_\-status@{rdline\_\-status}}
\index{rdline\_\-status@{rdline\_\-status}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-status]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf rdline\_\-status}}\label{rdline_8h_0b6d4c96d4243ff6342c80fa2681a250}


\begin{Desc}
\item[Enumerator: ]\par
\begin{description}
\index{RDLINE\_\-INIT@{RDLINE\_\-INIT}!rdline.h@{rdline.h}}\index{rdline.h@{rdline.h}!RDLINE\_\-INIT@{RDLINE\_\-INIT}}\item[{\em 
RDLINE\_\-INIT\label{rdline_8h_0b6d4c96d4243ff6342c80fa2681a2502fc642977b513045137d4ad97ccdf8d9}
}]\index{RDLINE\_\-RUNNING@{RDLINE\_\-RUNNING}!rdline.h@{rdline.h}}\index{rdline.h@{rdline.h}!RDLINE\_\-RUNNING@{RDLINE\_\-RUNNING}}\item[{\em 
RDLINE\_\-RUNNING\label{rdline_8h_0b6d4c96d4243ff6342c80fa2681a250d203937528967b2c248073d65b7058ed}
}]\end{description}
\end{Desc}



Definition at line 66 of file rdline.h.

\subsection{Function Documentation}
\index{rdline.h@{rdline.h}!rdline\_\-add\_\-history@{rdline\_\-add\_\-history}}
\index{rdline\_\-add\_\-history@{rdline\_\-add\_\-history}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-add\_\-history]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t rdline\_\-add\_\-history (struct {\bf rdline} $\ast$ {\em rdl}, \/  const char $\ast$ {\em buf})}\label{rdline_8h_fa223954c2184029beb24cd1ea8478b3}


Add the buffer to history. return $<$ 0 on \doxyref{error}{p.}{structerror}. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rdl}]A pointer to a struct \doxyref{rdline}{p.}{structrdline} \item[{\em buf}]A buffer that is terminated by '' \end{description}
\end{Desc}


Definition at line 535 of file rdline.c.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!rdline\_\-char\_\-in@{rdline\_\-char\_\-in}}
\index{rdline\_\-char\_\-in@{rdline\_\-char\_\-in}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-char\_\-in]{\setlength{\rightskip}{0pt plus 5cm}int8\_\-t rdline\_\-char\_\-in (struct {\bf rdline} $\ast$ {\em rdl}, \/  char {\em c})}\label{rdline_8h_e9186b1e2793d6dad174d0acdc655faf}


append a char to the readline buffer. Return 1 when the line has been validated. Return 2 when the user asked to complete the buffer. Return -1 if it is not running. Return -2 if EOF (ctrl-d on an empty line). Else return 0. XXX \doxyref{error}{p.}{structerror} case when the buffer is full ?

\begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rdl}]A pointer to a struct \doxyref{rdline}{p.}{structrdline} \item[{\em c}]The character to append \end{description}
\end{Desc}


Definition at line 142 of file rdline.c.

References cirbuf\_\-add\_\-buf\_\-tail(), cirbuf\_\-add\_\-head(), cirbuf\_\-add\_\-tail(), cirbuf\_\-add\_\-tail\_\-safe(), cirbuf\_\-align\_\-left(), cirbuf\_\-del\_\-buf\_\-head(), cirbuf\_\-del\_\-head(), cirbuf\_\-del\_\-head\_\-safe(), cirbuf\_\-del\_\-tail(), cirbuf\_\-del\_\-tail\_\-safe(), cirbuf\_\-get\_\-buf\_\-head(), cirbuf\_\-get\_\-head(), CIRBUF\_\-GET\_\-LEN, cirbuf\_\-get\_\-tail(), cirbuf\_\-init(), CIRBUF\_\-IS\_\-EMPTY, rdline::complete, KEY\_\-BKSPACE, KEY\_\-CTRL\_\-A, KEY\_\-CTRL\_\-B, KEY\_\-CTRL\_\-C, KEY\_\-CTRL\_\-D, KEY\_\-CTRL\_\-E, KEY\_\-CTRL\_\-F, KEY\_\-CTRL\_\-K, KEY\_\-CTRL\_\-L, KEY\_\-CTRL\_\-Y, KEY\_\-DOWN\_\-ARR, KEY\_\-HELP, KEY\_\-LEFT\_\-ARR, KEY\_\-META\_\-BKSPACE, KEY\_\-RETURN, KEY\_\-RETURN2, KEY\_\-RIGHT\_\-ARR, KEY\_\-SUPPR, KEY\_\-TAB, KEY\_\-UP\_\-ARR, KEY\_\-WLEFT, KEY\_\-WRIGHT, rdline::left, rdline::left\_\-buf, rdline::prompt, rdline\_\-add\_\-history(), RDLINE\_\-BUF\_\-SIZE, rdline\_\-get\_\-buffer(), rdline\_\-get\_\-history\_\-item(), RDLINE\_\-INIT, rdline\_\-newline(), rdline\_\-redisplay(), RDLINE\_\-RUNNING, rdline::right, rdline::right\_\-buf, rdline::status, rdline::validate, rdline::vt100, vt100\_\-bs, vt100\_\-clear\_\-right, vt100\_\-init(), vt100\_\-left\_\-arr, vt100\_\-multi\_\-left, vt100\_\-multi\_\-right, vt100\_\-parser(), vt100\_\-right\_\-arr, and rdline::write\_\-char.\index{rdline.h@{rdline.h}!rdline\_\-clear\_\-history@{rdline\_\-clear\_\-history}}
\index{rdline\_\-clear\_\-history@{rdline\_\-clear\_\-history}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-clear\_\-history]{\setlength{\rightskip}{0pt plus 5cm}void rdline\_\-clear\_\-history (struct {\bf rdline} $\ast$ {\em rdl})}\label{rdline_8h_34a9e7bb84507ceb4644f36e0550a734}


Clear current history \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rdl}]A pointer to a struct \doxyref{rdline}{p.}{structrdline} \end{description}
\end{Desc}


Definition at line 536 of file rdline.c.\index{rdline.h@{rdline.h}!rdline\_\-get\_\-buffer@{rdline\_\-get\_\-buffer}}
\index{rdline\_\-get\_\-buffer@{rdline\_\-get\_\-buffer}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-get\_\-buffer]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ rdline\_\-get\_\-buffer (struct {\bf rdline} $\ast$ {\em rdl})}\label{rdline_8h_dcd2d89335b71f48a4b6d2de36176697}


Return the current buffer, terminated by ''. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rdl}]A pointer to a struct \doxyref{rdline}{p.}{structrdline} \end{description}
\end{Desc}


Definition at line 96 of file rdline.c.

References cirbuf\_\-align\_\-left(), CIRBUF\_\-GET\_\-LEN, rdline::left, rdline::left\_\-buf, rdline::right, and rdline::right\_\-buf.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!rdline\_\-get\_\-history\_\-item@{rdline\_\-get\_\-history\_\-item}}
\index{rdline\_\-get\_\-history\_\-item@{rdline\_\-get\_\-history\_\-item}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-get\_\-history\_\-item]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ rdline\_\-get\_\-history\_\-item (struct {\bf rdline} $\ast$ {\em rdl}, \/  uint8\_\-t {\em i})}\label{rdline_8h_86581280d1f466b2f725a68da18d09d9}


Get the i-th history item 

Definition at line 537 of file rdline.c.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!rdline\_\-init@{rdline\_\-init}}
\index{rdline\_\-init@{rdline\_\-init}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-init]{\setlength{\rightskip}{0pt plus 5cm}void rdline\_\-init (struct {\bf rdline} $\ast$ {\em rdl}, \/  {\bf rdline\_\-write\_\-char\_\-t} $\ast$ {\em write\_\-char}, \/  {\bf rdline\_\-validate\_\-t} $\ast$ {\em validate}, \/  {\bf rdline\_\-complete\_\-t} $\ast$ {\em complete})}\label{rdline_8h_8065da1f82fca174f2395c0c5fb057ae}


Init fields for a struct \doxyref{rdline}{p.}{structrdline}. Call this only once at the beginning of your program. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rdl}]A pointer to an uninitialized struct \doxyref{rdline}{p.}{structrdline} \item[{\em write\_\-char}]The function used by the function to write a character \item[{\em validate}]A pointer to the function to execute when the user validates the buffer. \item[{\em complete}]A pointer to the function to execute when the user completes the buffer. \end{description}
\end{Desc}


Definition at line 46 of file rdline.c.

References cirbuf\_\-init(), rdline::complete, RDLINE\_\-HISTORY\_\-BUF\_\-SIZE, RDLINE\_\-INIT, rdline::status, rdline::validate, and rdline::write\_\-char.\index{rdline.h@{rdline.h}!rdline\_\-newline@{rdline\_\-newline}}
\index{rdline\_\-newline@{rdline\_\-newline}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-newline]{\setlength{\rightskip}{0pt plus 5cm}void rdline\_\-newline (struct {\bf rdline} $\ast$ {\em rdl}, \/  const char $\ast$ {\em prompt})}\label{rdline_8h_d793c0f725f1cbe3e11c2bd633152063}


Init the current buffer, and display a prompt. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rdl}]A pointer to a struct \doxyref{rdline}{p.}{structrdline} \item[{\em prompt}]A string containing the prompt \end{description}
\end{Desc}


Definition at line 62 of file rdline.c.

References cirbuf\_\-init(), i, rdline::left, rdline::left\_\-buf, rdline::prompt, rdline::prompt\_\-size, RDLINE\_\-BUF\_\-SIZE, RDLINE\_\-RUNNING, rdline::right, rdline::right\_\-buf, rdline::status, rdline::vt100, vt100\_\-init(), and rdline::write\_\-char.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!rdline\_\-redisplay@{rdline\_\-redisplay}}
\index{rdline\_\-redisplay@{rdline\_\-redisplay}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-redisplay]{\setlength{\rightskip}{0pt plus 5cm}void rdline\_\-redisplay (struct {\bf rdline} $\ast$ {\em rdl})}\label{rdline_8h_4d5ea46995e07c00aa753ed0ced7ef08}


Redisplay the current buffer \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rdl}]A pointer to a struct \doxyref{rdline}{p.}{structrdline} \end{description}
\end{Desc}


Definition at line 127 of file rdline.c.

References CIRBUF\_\-FOREACH, rdline::left, rdline::prompt, rdline::prompt\_\-size, vt100\_\-home, and rdline::write\_\-char.

Referenced by rdline\_\-char\_\-in().\index{rdline.h@{rdline.h}!rdline\_\-restart@{rdline\_\-restart}}
\index{rdline\_\-restart@{rdline\_\-restart}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-restart]{\setlength{\rightskip}{0pt plus 5cm}void rdline\_\-restart (struct {\bf rdline} $\ast$ {\em rdl})}\label{rdline_8h_bb5a2436df7746ba8f42aa52ebc22814}


Restart after a call to \doxyref{rdline\_\-stop()}{p.}{rdline_8c_f2a86401dff132869fc6b8e6b138fad8} \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rdl}]A pointer to a struct \doxyref{rdline}{p.}{structrdline} \end{description}
\end{Desc}


Definition at line 90 of file rdline.c.

References RDLINE\_\-RUNNING, and rdline::status.\index{rdline.h@{rdline.h}!rdline\_\-stop@{rdline\_\-stop}}
\index{rdline\_\-stop@{rdline\_\-stop}!rdline.h@{rdline.h}}
\subsubsection[rdline\_\-stop]{\setlength{\rightskip}{0pt plus 5cm}void rdline\_\-stop (struct {\bf rdline} $\ast$ {\em rdl})}\label{rdline_8h_f2a86401dff132869fc6b8e6b138fad8}


Call it and all received chars will be ignored. \begin{Desc}
\item[Parameters:]
\begin{description}
\item[{\em rdl}]A pointer to a struct \doxyref{rdline}{p.}{structrdline} \end{description}
\end{Desc}


Definition at line 84 of file rdline.c.

References RDLINE\_\-INIT, and rdline::status.