\section{aversive\_\-10-03-12/modules/base/cirbuf/cirbuf\_\-get\_\-buf\_\-head.c File Reference}
\label{cirbuf__get__buf__head_8c}\index{aversive\_\-10-03-12/modules/base/cirbuf/cirbuf\_\-get\_\-buf\_\-head.c@{aversive\_\-10-03-12/modules/base/cirbuf/cirbuf\_\-get\_\-buf\_\-head.c}}
{\tt \#include $<$string.h$>$}\par
{\tt \#include $<$cirbuf.h$>$}\par
\subsection*{Functions}
\begin{CompactItemize}
\item 
{\bf cirbuf\_\-int} {\bf cirbuf\_\-get\_\-buf\_\-head} (struct {\bf cirbuf} $\ast$cbuf, char $\ast$c, {\bf cirbuf\_\-uint} size)
\end{CompactItemize}


\subsection{Function Documentation}
\index{cirbuf\_\-get\_\-buf\_\-head.c@{cirbuf\_\-get\_\-buf\_\-head.c}!cirbuf\_\-get\_\-buf\_\-head@{cirbuf\_\-get\_\-buf\_\-head}}
\index{cirbuf\_\-get\_\-buf\_\-head@{cirbuf\_\-get\_\-buf\_\-head}!cirbuf_get_buf_head.c@{cirbuf\_\-get\_\-buf\_\-head.c}}
\subsubsection[cirbuf\_\-get\_\-buf\_\-head]{\setlength{\rightskip}{0pt plus 5cm}{\bf cirbuf\_\-int} cirbuf\_\-get\_\-buf\_\-head (struct {\bf cirbuf} $\ast$ {\em cbuf}, \/  char $\ast$ {\em c}, \/  {\bf cirbuf\_\-uint} {\em size})}\label{cirbuf__get__buf__head_8c_bcc63846f8b2a035e578de5df8502ae3}


Copy a maximum of 'size' characters from the head of the circular buffer to a flat one pointed by 'c'. Return the number of copied chars. 

Definition at line 30 of file cirbuf\_\-get\_\-buf\_\-head.c.

References cirbuf::buf, CIRBUF\_\-GET\_\-LEN, dprintf, cirbuf::end, cirbuf::maxlen, and cirbuf::start.

Referenced by rdline\_\-char\_\-in().