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


\subsection{Function Documentation}
\index{cirbuf\_\-add\_\-head.c@{cirbuf\_\-add\_\-head.c}!cirbuf\_\-add\_\-head@{cirbuf\_\-add\_\-head}}
\index{cirbuf\_\-add\_\-head@{cirbuf\_\-add\_\-head}!cirbuf_add_head.c@{cirbuf\_\-add\_\-head.c}}
\subsubsection[cirbuf\_\-add\_\-head]{\setlength{\rightskip}{0pt plus 5cm}void cirbuf\_\-add\_\-head (struct {\bf cirbuf} $\ast$ {\em cbuf}, \/  char {\em c})}\label{cirbuf__add__head_8c_eaa133e35546ce46723a7956830e5e86}


Add a character at head of the circular buffer. You \_\-must\_\- check that you have enough free space in the buffer before calling this func. 

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

Referenced by rdline\_\-char\_\-in(), uart\_\-send(), and uart\_\-send\_\-nowait().\index{cirbuf\_\-add\_\-head.c@{cirbuf\_\-add\_\-head.c}!cirbuf\_\-add\_\-head\_\-safe@{cirbuf\_\-add\_\-head\_\-safe}}
\index{cirbuf\_\-add\_\-head\_\-safe@{cirbuf\_\-add\_\-head\_\-safe}!cirbuf_add_head.c@{cirbuf\_\-add\_\-head.c}}
\subsubsection[cirbuf\_\-add\_\-head\_\-safe]{\setlength{\rightskip}{0pt plus 5cm}{\bf cirbuf\_\-int} cirbuf\_\-add\_\-head\_\-safe (struct {\bf cirbuf} $\ast$ {\em cbuf}, \/  char {\em c})}\label{cirbuf__add__head_8c_4fd357026153cc8f1f7c0a240a0c8e45}


Add a character at head of the circular buffer. Return 0 on success, or a negative value on \doxyref{error}{p.}{structerror}. 

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

References CIRBUF\_\-IS\_\-FULL, and EINVAL.