\hypertarget{buffer__compat_8h}{\section{opal/mca/event/libevent2013/libevent/include/event2/buffer\+\_\+compat.h File Reference}
\label{buffer__compat_8h}\index{opal/mca/event/libevent2013/libevent/include/event2/buffer\+\_\+compat.\+h@{opal/mca/event/libevent2013/libevent/include/event2/buffer\+\_\+compat.\+h}}
}


Obsolete and deprecated versions of the functions in \hyperlink{buffer_8h}{buffer.\+h}\+: provided only for backward compatibility.  


\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{buffer__compat_8h_ab8d9564980e380cf1887f2be70f687ad}{\#define \hyperlink{buffer__compat_8h_ab8d9564980e380cf1887f2be70f687ad}{E\+V\+B\+U\+F\+F\+E\+R\+\_\+\+L\+E\+N\+G\+T\+H}(x)~\hyperlink{buffer_8h_af1b44374d37735f3a90ae402eaeddf44}{evbuffer\+\_\+get\+\_\+length}(x)}\label{buffer__compat_8h_ab8d9564980e380cf1887f2be70f687ad}

\begin{DoxyCompactList}\small\item\em deprecated in favor of calling the functions directly \end{DoxyCompactList}\item 
\hypertarget{buffer__compat_8h_a1c57a451c56dc1483a1c8aaeb9b92cc6}{\#define \hyperlink{buffer__compat_8h_a1c57a451c56dc1483a1c8aaeb9b92cc6}{E\+V\+B\+U\+F\+F\+E\+R\+\_\+\+D\+A\+T\+A}(x)~\hyperlink{buffer_8h_a07df786553218ae3a7b0ebd2c9471a96}{evbuffer\+\_\+pullup}((x), -\/1)}\label{buffer__compat_8h_a1c57a451c56dc1483a1c8aaeb9b92cc6}

\begin{DoxyCompactList}\small\item\em deprecated in favor of calling the functions directly \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef void($\ast$ \hyperlink{buffer__compat_8h_a613068ef7e1be05deead9c9b6f021158}{evbuffer\+\_\+cb} )(struct \hyperlink{structevbuffer}{evbuffer} $\ast$buffer, size\+\_\+t old\+\_\+len, size\+\_\+t new\+\_\+len, void $\ast$arg)
\begin{DoxyCompactList}\small\item\em Type definition for a callback that is invoked whenever data is added or removed from an evbuffer. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
char $\ast$ \hyperlink{buffer__compat_8h_a65177a5ae259100c90f3f4c2812db070}{evbuffer\+\_\+readline} (struct \hyperlink{structevbuffer}{evbuffer} $\ast$buffer)
\begin{DoxyCompactList}\small\item\em Obsolete alias for evbuffer\+\_\+readln(buffer, N\+U\+L\+L, E\+O\+L\+\_\+\+S\+T\+Y\+L\+E\+\_\+\+A\+N\+Y). \end{DoxyCompactList}\item 
void \hyperlink{buffer__compat_8h_a410c80ef25950aed88a08141278f23ab}{evbuffer\+\_\+setcb} (struct \hyperlink{structevbuffer}{evbuffer} $\ast$buffer, \hyperlink{buffer__compat_8h_a613068ef7e1be05deead9c9b6f021158}{evbuffer\+\_\+cb} cb, void $\ast$cbarg)
\begin{DoxyCompactList}\small\item\em Replace all callbacks on an evbuffer with a single new callback, or remove them. \end{DoxyCompactList}\item 
unsigned char $\ast$ \hyperlink{buffer__compat_8h_adb7851f684bf8400ce7b26e06e30c2d3}{evbuffer\+\_\+find} (struct \hyperlink{structevbuffer}{evbuffer} $\ast$buffer, const unsigned char $\ast$what, size\+\_\+t len)
\begin{DoxyCompactList}\small\item\em Find a string within an evbuffer. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Obsolete and deprecated versions of the functions in \hyperlink{buffer_8h}{buffer.\+h}\+: provided only for backward compatibility. 



\subsection{Typedef Documentation}
\hypertarget{buffer__compat_8h_a613068ef7e1be05deead9c9b6f021158}{\index{buffer\+\_\+compat.\+h@{buffer\+\_\+compat.\+h}!evbuffer\+\_\+cb@{evbuffer\+\_\+cb}}
\index{evbuffer\+\_\+cb@{evbuffer\+\_\+cb}!buffer\+\_\+compat.\+h@{buffer\+\_\+compat.\+h}}
\subsubsection[{evbuffer\+\_\+cb}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ evbuffer\+\_\+cb)(struct {\bf evbuffer} $\ast$buffer, size\+\_\+t old\+\_\+len, size\+\_\+t new\+\_\+len, void $\ast$arg)}}\label{buffer__compat_8h_a613068ef7e1be05deead9c9b6f021158}


Type definition for a callback that is invoked whenever data is added or removed from an evbuffer. 

An evbuffer may have one or more callbacks set at a time. The order in which they are executed is undefined.

A callback function may add more callbacks, or remove itself from the list of callbacks, or add or remove data from the buffer. It may not remove another callback from the list.

If a callback adds or removes data from the buffer or from another buffer, this can cause a recursive invocation of your callback or other callbacks. If you ask for an infinite loop, you might just get one\+: watch out!


\begin{DoxyParams}{Parameters}
{\em buffer} & the buffer whose size has changed \\
\hline
{\em old\+\_\+len} & the previous length of the buffer \\
\hline
{\em new\+\_\+len} & the current length of the buffer \\
\hline
{\em arg} & a pointer to user data \\
\hline
\end{DoxyParams}


\subsection{Function Documentation}
\hypertarget{buffer__compat_8h_adb7851f684bf8400ce7b26e06e30c2d3}{\index{buffer\+\_\+compat.\+h@{buffer\+\_\+compat.\+h}!evbuffer\+\_\+find@{evbuffer\+\_\+find}}
\index{evbuffer\+\_\+find@{evbuffer\+\_\+find}!buffer\+\_\+compat.\+h@{buffer\+\_\+compat.\+h}}
\subsubsection[{evbuffer\+\_\+find}]{\setlength{\rightskip}{0pt plus 5cm}unsigned char$\ast$ evbuffer\+\_\+find (
\begin{DoxyParamCaption}
\item[{struct {\bf evbuffer} $\ast$}]{buffer, }
\item[{const unsigned char $\ast$}]{what, }
\item[{size\+\_\+t}]{len}
\end{DoxyParamCaption}
)}}\label{buffer__compat_8h_adb7851f684bf8400ce7b26e06e30c2d3}


Find a string within an evbuffer. 


\begin{DoxyParams}{Parameters}
{\em buffer} & the evbuffer to be searched \\
\hline
{\em what} & the string to be searched for \\
\hline
{\em len} & the length of the search string \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a pointer to the beginning of the search string, or N\+U\+L\+L if the search failed. 
\end{DoxyReturn}


References evbuffer\+\_\+pullup(), and evbuffer\+\_\+search().

\hypertarget{buffer__compat_8h_a65177a5ae259100c90f3f4c2812db070}{\index{buffer\+\_\+compat.\+h@{buffer\+\_\+compat.\+h}!evbuffer\+\_\+readline@{evbuffer\+\_\+readline}}
\index{evbuffer\+\_\+readline@{evbuffer\+\_\+readline}!buffer\+\_\+compat.\+h@{buffer\+\_\+compat.\+h}}
\subsubsection[{evbuffer\+\_\+readline}]{\setlength{\rightskip}{0pt plus 5cm}char$\ast$ evbuffer\+\_\+readline (
\begin{DoxyParamCaption}
\item[{struct {\bf evbuffer} $\ast$}]{buffer}
\end{DoxyParamCaption}
)}}\label{buffer__compat_8h_a65177a5ae259100c90f3f4c2812db070}


Obsolete alias for evbuffer\+\_\+readln(buffer, N\+U\+L\+L, E\+O\+L\+\_\+\+S\+T\+Y\+L\+E\+\_\+\+A\+N\+Y). 

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000004}{Deprecated}]This function is deprecated because its behavior is not correct for almost any protocol, and also because it's wholly subsumed by \hyperlink{buffer_8h_ae2460b5060948d3233342c4c81888650}{evbuffer\+\_\+readln()}.\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em buffer} & the evbuffer to read from \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
pointer to a single line, or N\+U\+L\+L if an error occurred 
\end{DoxyReturn}


References E\+V\+B\+U\+F\+F\+E\+R\+\_\+\+E\+O\+L\+\_\+\+A\+N\+Y, and evbuffer\+\_\+readln().

\hypertarget{buffer__compat_8h_a410c80ef25950aed88a08141278f23ab}{\index{buffer\+\_\+compat.\+h@{buffer\+\_\+compat.\+h}!evbuffer\+\_\+setcb@{evbuffer\+\_\+setcb}}
\index{evbuffer\+\_\+setcb@{evbuffer\+\_\+setcb}!buffer\+\_\+compat.\+h@{buffer\+\_\+compat.\+h}}
\subsubsection[{evbuffer\+\_\+setcb}]{\setlength{\rightskip}{0pt plus 5cm}void evbuffer\+\_\+setcb (
\begin{DoxyParamCaption}
\item[{struct {\bf evbuffer} $\ast$}]{buffer, }
\item[{{\bf evbuffer\+\_\+cb}}]{cb, }
\item[{void $\ast$}]{cbarg}
\end{DoxyParamCaption}
)}}\label{buffer__compat_8h_a410c80ef25950aed88a08141278f23ab}


Replace all callbacks on an evbuffer with a single new callback, or remove them. 

Subsequent calls to \hyperlink{buffer__compat_8h_a410c80ef25950aed88a08141278f23ab}{evbuffer\+\_\+setcb()} replace callbacks set by previous calls. Setting the callback to N\+U\+L\+L removes any previously set callback.

\begin{DoxyRefDesc}{Deprecated}
\item[\hyperlink{deprecated__deprecated000005}{Deprecated}]This function is deprecated because it clears all previous callbacks set on the evbuffer, which can cause confusing behavior if multiple parts of the code all want to add their own callbacks on a buffer. Instead, use \hyperlink{buffer_8h_a69c3b8893a49bdd919642c6920c1fcb4}{evbuffer\+\_\+add()}, evbuffer\+\_\+del(), and evbuffer\+\_\+setflags() to manage your own evbuffer callbacks without interfering with callbacks set by others.\end{DoxyRefDesc}



\begin{DoxyParams}{Parameters}
{\em buffer} & the evbuffer to be monitored \\
\hline
{\em cb} & the callback function to invoke when the evbuffer is modified, or N\+U\+L\+L to remove all callbacks. \\
\hline
{\em cbarg} & an argument to be provided to the callback function \\
\hline
\end{DoxyParams}


References evbuffer\+\_\+cb\+\_\+entry\+::cb, evbuffer\+\_\+add\+\_\+cb(), and evbuffer\+\_\+cb\+\_\+entry\+::flags.

