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


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


Add a buffer at head of the circular buffer. 'c' is a pointer to a buffer, and n is the number of char to add. Return the number of copied bytes on success, or a negative value on \doxyref{error}{p.}{structerror}. 

Definition at line 31 of file cirbuf\_\-add\_\-buf\_\-head.c.

References cirbuf::buf, CIRBUF\_\-GET\_\-FREELEN, CIRBUF\_\-IS\_\-EMPTY, dprintf, EINVAL, cirbuf::len, cirbuf::maxlen, and cirbuf::start.

Referenced by uart\_\-send\_\-9bits(), and uart\_\-send\_\-9bits\_\-nowait().