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


Core functions for waiting for and receiving events, and using event bases.  


{\ttfamily \#include \char`\"{}opal\+\_\+rename.\+h\char`\"{}}\\*
{\ttfamily \#include $<$event2/event-\/config.\+h$>$}\\*
{\ttfamily \#include $<$stdio.\+h$>$}\\*
{\ttfamily \#include $<$event2/util.\+h$>$}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a69cc368a9137187726ef371a06f9cc9f}{\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a69cc368a9137187726ef371a06f9cc9f}{event\+\_\+get\+\_\+signal}(ev)~((int)\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_aee0c9c3fc7c997e4d4b77bdcdf321ee6}{event\+\_\+get\+\_\+fd}(ev))}\label{libevent2013_2libevent_2include_2event2_2event_8h_a69cc368a9137187726ef371a06f9cc9f}

\begin{DoxyCompactList}\small\item\em Get the signal number assigned to a signal event. \end{DoxyCompactList}\item 
\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_aad00c7d4ddbd6b590c15861a2e767182}{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N}~\+\_\+\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N
\begin{DoxyCompactList}\small\item\em As event\+\_\+get\+\_\+version, but gives the version of Libevent's headers. \end{DoxyCompactList}\item 
\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a8a9c8021651a2d8d7946083281279586}{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+N\+U\+M\+B\+E\+R}~\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+U\+M\+E\+R\+I\+C\+\_\+\+V\+E\+R\+S\+I\+O\+N
\begin{DoxyCompactList}\small\item\em As event\+\_\+get\+\_\+version\+\_\+number, but gives the version number of Libevent's headers. \end{DoxyCompactList}\item 
\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad74f7bf73ff985bfaf61c462cbba022f}{E\+V\+E\+N\+T\+\_\+\+M\+A\+X\+\_\+\+P\+R\+I\+O\+R\+I\+T\+I\+E\+S}~256
\begin{DoxyCompactList}\small\item\em Largest number of priorities that Libevent can support. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ade387a9a39bbbdf40ff20b4d977ec6ae}{\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ade387a9a39bbbdf40ff20b4d977ec6ae}{E\+V\+E\+N\+T\+\_\+\+S\+E\+T\+\_\+\+M\+E\+M\+\_\+\+F\+U\+N\+C\+T\+I\+O\+N\+S\+\_\+\+I\+M\+P\+L\+E\+M\+E\+N\+T\+E\+D}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ade387a9a39bbbdf40ff20b4d977ec6ae}

\begin{DoxyCompactList}\small\item\em This definition is present if Libevent was built with support for \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a653e38c4bdd2f3b2d7476fcee95c1a62}{event\+\_\+set\+\_\+mem\+\_\+functions()} \end{DoxyCompactList}\end{DoxyCompactItemize}
\begin{Indent}{\bf Log severities}\par
\begin{DoxyCompactItemize}
\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a964443418439acdd775129ae260b21bb}{\#define {\bfseries \+\_\+\+E\+V\+E\+N\+T\+\_\+\+L\+O\+G\+\_\+\+D\+E\+B\+U\+G}~0}\label{libevent2013_2libevent_2include_2event2_2event_8h_a964443418439acdd775129ae260b21bb}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a6d898badc07a518c29ecb0129cc77188}{\#define {\bfseries \+\_\+\+E\+V\+E\+N\+T\+\_\+\+L\+O\+G\+\_\+\+M\+S\+G}~1}\label{libevent2013_2libevent_2include_2event2_2event_8h_a6d898badc07a518c29ecb0129cc77188}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_aa8ba4ffdc827c139311654c41cfddd1d}{\#define {\bfseries \+\_\+\+E\+V\+E\+N\+T\+\_\+\+L\+O\+G\+\_\+\+W\+A\+R\+N}~2}\label{libevent2013_2libevent_2include_2event2_2event_8h_aa8ba4ffdc827c139311654c41cfddd1d}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a829eede32e73952922a35e42b510bfe9}{\#define {\bfseries \+\_\+\+E\+V\+E\+N\+T\+\_\+\+L\+O\+G\+\_\+\+E\+R\+R}~3}\label{libevent2013_2libevent_2include_2event2_2event_8h_a829eede32e73952922a35e42b510bfe9}

\end{DoxyCompactItemize}
\end{Indent}
\begin{Indent}{\bf Loop flags}\par
{\em These flags control the behavior of \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop()}. }\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afab575b1e867dde13a2c7f2f967e0e4e}{E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E}~0x01
\begin{DoxyCompactList}\small\item\em Block until we have an active event, then exit once all active events have had their callbacks run. \end{DoxyCompactList}\item 
\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a10b9c102337d0ece8607c9c01bc4f7c8}{E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K}~0x02
\begin{DoxyCompactList}\small\item\em Do not block\+: see which events are ready now, run the callbacks of the highest-\/priority ones, then exit. \end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}
\begin{Indent}{\bf event flags}\par
{\em Flags to pass to \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a49773a4e3e46f60e488ac37fb46950d9}{event\+\_\+pending()}, and anything else with an argument of the form \char`\"{}short events\char`\"{} }\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a37ef4b6056484f5580f7d72fcf46fccf}{E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T}~0x01
\begin{DoxyCompactList}\small\item\em Indicates that a timeout has occurred. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a74bbaf2d529670cc0ab793497b41700f}{\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a74bbaf2d529670cc0ab793497b41700f}{E\+V\+\_\+\+R\+E\+A\+D}~0x02}\label{libevent2013_2libevent_2include_2event2_2event_8h_a74bbaf2d529670cc0ab793497b41700f}

\begin{DoxyCompactList}\small\item\em Wait for a socket or F\+D to become readable. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a2a31813fa3b26bf2d150512cbbf893f7}{\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a2a31813fa3b26bf2d150512cbbf893f7}{E\+V\+\_\+\+W\+R\+I\+T\+E}~0x04}\label{libevent2013_2libevent_2include_2event2_2event_8h_a2a31813fa3b26bf2d150512cbbf893f7}

\begin{DoxyCompactList}\small\item\em Wait for a socket or F\+D to become writeable. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a59b7e95284ac1a197969d42ee9441ece}{\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a59b7e95284ac1a197969d42ee9441ece}{E\+V\+\_\+\+S\+I\+G\+N\+A\+L}~0x08}\label{libevent2013_2libevent_2include_2event2_2event_8h_a59b7e95284ac1a197969d42ee9441ece}

\begin{DoxyCompactList}\small\item\em Wait for a P\+O\+S\+I\+X signal to be raised. \end{DoxyCompactList}\item 
\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3c4947a60eb6d09327c61f89135f9f37}{E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T}~0x10
\begin{DoxyCompactList}\small\item\em Persistent event\+: won't get removed automatically when activated. \end{DoxyCompactList}\item 
\#define \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a01084abbcdd3a58b4068359548a3ea71}{E\+V\+\_\+\+E\+T}~0x20
\begin{DoxyCompactList}\small\item\em Select edge-\/triggered behavior, if supported by the backend. \end{DoxyCompactList}\end{DoxyCompactItemize}
\end{Indent}
\begin{Indent}{\bf evtimer\+\_\+$\ast$ macros}\par
{\em Aliases for working with one-\/shot timer events }\begin{DoxyCompactItemize}
\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a356b4550edd470440efa7a74da413939}{\#define {\bfseries evtimer\+\_\+assign}(ev, b, cb, arg)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign}((ev), (b), -\/1, 0, (cb), (arg))}\label{libevent2013_2libevent_2include_2event2_2event_8h_a356b4550edd470440efa7a74da413939}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a76b701417f1cd29208019283d1fd1691}{\#define {\bfseries evtimer\+\_\+new}(b, cb, arg)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new}((b), -\/1, 0, (cb), (arg))}\label{libevent2013_2libevent_2include_2event2_2event_8h_a76b701417f1cd29208019283d1fd1691}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a6ea3ca87057c66fd9f5a9fda9b911f8b}{\#define {\bfseries evtimer\+\_\+add}(ev, tv)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add}((ev), (tv))}\label{libevent2013_2libevent_2include_2event2_2event_8h_a6ea3ca87057c66fd9f5a9fda9b911f8b}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a22f7e7b422e9098d9362626d47b77525}{\#define {\bfseries evtimer\+\_\+del}(ev)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del}(ev)}\label{libevent2013_2libevent_2include_2event2_2event_8h_a22f7e7b422e9098d9362626d47b77525}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a7037bae3f2fb09eb2752e8252b63a5a6}{\#define {\bfseries evtimer\+\_\+pending}(ev, tv)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a49773a4e3e46f60e488ac37fb46950d9}{event\+\_\+pending}((ev), \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a37ef4b6056484f5580f7d72fcf46fccf}{E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T}, (tv))}\label{libevent2013_2libevent_2include_2event2_2event_8h_a7037bae3f2fb09eb2752e8252b63a5a6}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a765c62ada275b4114ca0494e9d1f0047}{\#define {\bfseries evtimer\+\_\+initialized}(ev)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a5be4fbc16d90915a7d1b21ed3bae40c0}{event\+\_\+initialized}(ev)}\label{libevent2013_2libevent_2include_2event2_2event_8h_a765c62ada275b4114ca0494e9d1f0047}

\end{DoxyCompactItemize}
\end{Indent}
\begin{Indent}{\bf evsignal\+\_\+$\ast$ macros}\par
{\em Aliases for working with signal events }\begin{DoxyCompactItemize}
\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a043e61907ad2ae55d61f5c5e109729dd}{\#define {\bfseries evsignal\+\_\+add}(ev, tv)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add}((ev), (tv))}\label{libevent2013_2libevent_2include_2event2_2event_8h_a043e61907ad2ae55d61f5c5e109729dd}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a08eae4d05e8e104b1d72bb73eaf95da4}{\#define {\bfseries evsignal\+\_\+assign}(ev, b, x, cb, arg)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign}((ev), (b), (x), \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a59b7e95284ac1a197969d42ee9441ece}{E\+V\+\_\+\+S\+I\+G\+N\+A\+L}$\vert$\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3c4947a60eb6d09327c61f89135f9f37}{E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T}, cb, (arg))}\label{libevent2013_2libevent_2include_2event2_2event_8h_a08eae4d05e8e104b1d72bb73eaf95da4}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a990ce36ac02fb1033a0cc56df968b4c4}{\#define {\bfseries evsignal\+\_\+new}(b, x, cb, arg)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new}((b), (x), \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a59b7e95284ac1a197969d42ee9441ece}{E\+V\+\_\+\+S\+I\+G\+N\+A\+L}$\vert$\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3c4947a60eb6d09327c61f89135f9f37}{E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T}, (cb), (arg))}\label{libevent2013_2libevent_2include_2event2_2event_8h_a990ce36ac02fb1033a0cc56df968b4c4}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_af2cca0259e62d40d8470e9b574568f74}{\#define {\bfseries evsignal\+\_\+del}(ev)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del}(ev)}\label{libevent2013_2libevent_2include_2event2_2event_8h_af2cca0259e62d40d8470e9b574568f74}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_aee9bcb501fce2f2b7d5bc19e5d53b611}{\#define {\bfseries evsignal\+\_\+pending}(ev, tv)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a49773a4e3e46f60e488ac37fb46950d9}{event\+\_\+pending}((ev), \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a59b7e95284ac1a197969d42ee9441ece}{E\+V\+\_\+\+S\+I\+G\+N\+A\+L}, (tv))}\label{libevent2013_2libevent_2include_2event2_2event_8h_aee9bcb501fce2f2b7d5bc19e5d53b611}

\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_aa39848850017245c2e946c49c5a51a9d}{\#define {\bfseries evsignal\+\_\+initialized}(ev)~\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a5be4fbc16d90915a7d1b21ed3bae40c0}{event\+\_\+initialized}(ev)}\label{libevent2013_2libevent_2include_2event2_2event_8h_aa39848850017245c2e946c49c5a51a9d}

\end{DoxyCompactItemize}
\end{Indent}
\subsection*{Typedefs}
\begin{DoxyCompactItemize}
\item 
typedef void($\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_adbff4d951c4b002b955966f0ab228a76}{event\+\_\+log\+\_\+cb} )(int severity, const char $\ast$msg)
\begin{DoxyCompactList}\small\item\em A callback function used to intercept Libevent's log messages. \end{DoxyCompactList}\item 
typedef void($\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a96cbd560e6fe7cb4ebfa6000e164d752}{event\+\_\+fatal\+\_\+cb} )(int err)
\begin{DoxyCompactList}\small\item\em A function to be called if Libevent encounters a fatal internal error. \end{DoxyCompactList}\item 
typedef void($\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac1bbbe034b87ff78b7a380c0b71064d4}{event\+\_\+callback\+\_\+fn} )(\hyperlink{opal_2mca_2event_2libevent2013_2libevent_2include_2event2_2util_8h_a7ef0023565082a65020f6e56be59fd0b}{evutil\+\_\+socket\+\_\+t}, short, void $\ast$)
\begin{DoxyCompactList}\small\item\em A callback function for an event. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Enumerations}
\begin{DoxyCompactItemize}
\item 
enum \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80}{event\+\_\+method\+\_\+feature} \{ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80ab407cae60af925dba44bd66e56e5f897}{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+E\+T} = 0x01, 
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80a7a6f2de86c09b92aa175f950190bf706}{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+O1} = 0x02, 
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80a2e964e8a8f3033d26d52831fb8eec199}{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+F\+D\+S} = 0x04
 \}
\begin{DoxyCompactList}\small\item\em A flag used to describe which features an \hyperlink{structevent__base}{event\+\_\+base} (must) provide. \end{DoxyCompactList}\item 
enum \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5}{event\+\_\+base\+\_\+config\+\_\+flag} \{ \\*
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5ac1302f72251168137258335e945e2ae5}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+L\+O\+C\+K} = 0x01, 
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5a230574947412d83f2dd19fe8c7d286e7}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+I\+G\+N\+O\+R\+E\+\_\+\+E\+N\+V} = 0x02, 
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5a4ffb2510ab533d7156f412ee4f0c08ea}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+S\+T\+A\+R\+T\+U\+P\+\_\+\+I\+O\+C\+P} = 0x04, 
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5a057dff1977c48174f0a0f0c43ef92ec5}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+\_\+\+C\+A\+C\+H\+E\+\_\+\+T\+I\+M\+E} = 0x08, 
\\*
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5acceb45f3098787247044929f92f4296e}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+E\+P\+O\+L\+L\+\_\+\+U\+S\+E\+\_\+\+C\+H\+A\+N\+G\+E\+L\+I\+S\+T} = 0x10
 \}
\begin{DoxyCompactList}\small\item\em A flag passed to \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac4b2697c7927fcd2167a1749f6602f29}{event\+\_\+config\+\_\+set\+\_\+flag()}. \end{DoxyCompactList}\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3472400b8b1802550df2242673a6da37}{event\+\_\+enable\+\_\+debug\+\_\+mode} (void)
\begin{DoxyCompactList}\small\item\em Enable some relatively expensive debugging checks in Libevent that would normally be turned off. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a286e20009430d6cd9a36d7d4244dcf07}{void {\bfseries event\+\_\+set\+\_\+debug\+\_\+output} (int output)}\label{libevent2013_2libevent_2include_2event2_2event_8h_a286e20009430d6cd9a36d7d4244dcf07}

\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afcc47ab5cc9128202cbe5012c4214a6b}{event\+\_\+debug\+\_\+unassign} (struct \hyperlink{structevent}{event} $\ast$)
\begin{DoxyCompactList}\small\item\em When debugging mode is enabled, informs Libevent that an event should no longer be considered as assigned. \end{DoxyCompactList}\item 
struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a4c16f1203aebc67f94791ae0240b7353}{event\+\_\+base\+\_\+new} (void)
\begin{DoxyCompactList}\small\item\em Create and return a new \hyperlink{structevent__base}{event\+\_\+base} to use with the rest of Libevent. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a7409499a79a59842955928af446fe03d}{event\+\_\+reinit} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$base)
\begin{DoxyCompactList}\small\item\em Reinitialize the event base after a fork. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a01e457364ed5216a8c7bc219033b946f}{event\+\_\+base\+\_\+dispatch} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$)
\begin{DoxyCompactList}\small\item\em Event dispatching loop. \end{DoxyCompactList}\item 
const char $\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a10914a893ed07dc8238d3274a9cbb3fc}{event\+\_\+base\+\_\+get\+\_\+method} (const struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$)
\begin{DoxyCompactList}\small\item\em Get the kernel event notification mechanism used by Libevent. \end{DoxyCompactList}\item 
const char $\ast$$\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_af93a8115c6c8ff28db573cba84d1e488}{event\+\_\+get\+\_\+supported\+\_\+methods} (void)
\begin{DoxyCompactList}\small\item\em Gets all event notification mechanisms supported by Libevent. \end{DoxyCompactList}\item 
struct \hyperlink{structevent__config}{event\+\_\+config} $\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a92e238d51357e3dae6fcdd0b9e83b2d2}{event\+\_\+config\+\_\+new} (void)
\begin{DoxyCompactList}\small\item\em Allocates a new event configuration object. \end{DoxyCompactList}\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a605f44836f97bb031776a7f70d53d719}{event\+\_\+config\+\_\+free} (struct \hyperlink{structevent__config}{event\+\_\+config} $\ast$cfg)
\begin{DoxyCompactList}\small\item\em Deallocates all memory associated with an event configuration object. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a961de3fb39a12ff67ff030bb3caacba2}{event\+\_\+config\+\_\+avoid\+\_\+method} (struct \hyperlink{structevent__config}{event\+\_\+config} $\ast$cfg, const char $\ast$method)
\begin{DoxyCompactList}\small\item\em Enters an event method that should be avoided into the configuration. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a11cb58563e8b5da36f00db2e250d026c}{event\+\_\+base\+\_\+get\+\_\+features} (const struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$base)
\begin{DoxyCompactList}\small\item\em Return a bitmask of the features implemented by an event base. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a2b08f2633e76290117e4a03621940948}{event\+\_\+config\+\_\+require\+\_\+features} (struct \hyperlink{structevent__config}{event\+\_\+config} $\ast$cfg, int feature)
\begin{DoxyCompactList}\small\item\em Enters a required event method feature that the application demands. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac4b2697c7927fcd2167a1749f6602f29}{event\+\_\+config\+\_\+set\+\_\+flag} (struct \hyperlink{structevent__config}{event\+\_\+config} $\ast$cfg, int flag)
\begin{DoxyCompactList}\small\item\em Sets one or more flags to configure what parts of the eventual \hyperlink{structevent__base}{event\+\_\+base} will be initialized, and how they'll work. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_aa12ff91d766988a170cab43c53f66143}{event\+\_\+config\+\_\+set\+\_\+num\+\_\+cpus\+\_\+hint} (struct \hyperlink{structevent__config}{event\+\_\+config} $\ast$cfg, int cpus)
\begin{DoxyCompactList}\small\item\em Records a hint for the number of C\+P\+Us in the system. \end{DoxyCompactList}\item 
struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config} (const struct \hyperlink{structevent__config}{event\+\_\+config} $\ast$)
\begin{DoxyCompactList}\small\item\em Initialize the event A\+P\+I. \end{DoxyCompactList}\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a6e9827de8c3014417b11b48f2fe688ae}{event\+\_\+base\+\_\+free} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$)
\begin{DoxyCompactList}\small\item\em Deallocate all memory associated with an \hyperlink{structevent__base}{event\+\_\+base}, and free the base. \end{DoxyCompactList}\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a87e59ed1dd711ced2b2a1314d3e3c1c7}{event\+\_\+set\+\_\+log\+\_\+callback} (\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_adbff4d951c4b002b955966f0ab228a76}{event\+\_\+log\+\_\+cb} cb)
\begin{DoxyCompactList}\small\item\em Redirect Libevent's log messages. \end{DoxyCompactList}\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a73beabc6626db0da679eb8961ce3f477}{event\+\_\+set\+\_\+fatal\+\_\+callback} (\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a96cbd560e6fe7cb4ebfa6000e164d752}{event\+\_\+fatal\+\_\+cb} cb)
\begin{DoxyCompactList}\small\item\em Override Libevent's behavior in the event of a fatal internal error. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a2efd0ac7e54428d1941f212bc16ed9ce}{event\+\_\+base\+\_\+set} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$, struct \hyperlink{structevent}{event} $\ast$)
\begin{DoxyCompactList}\small\item\em Associate a different event base with an event. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$, int)
\begin{DoxyCompactList}\small\item\em Wait for events to become active, and run their callbacks. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac2c66174ee5f10df65b9a9b62fca7dd9}{event\+\_\+base\+\_\+loopexit} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$, const struct timeval $\ast$)
\begin{DoxyCompactList}\small\item\em Exit the event loop after the specified time. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a07a7599e478e4031fa8cf52e26d8aa1e}{event\+\_\+base\+\_\+loopbreak} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$)
\begin{DoxyCompactList}\small\item\em Abort the active \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop()} immediately. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a4786b2d2cc1dd6e5fdd50e0d7627d495}{event\+\_\+base\+\_\+got\+\_\+exit} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$)
\begin{DoxyCompactList}\small\item\em Checks if the event loop was told to exit by \hyperlink{event__compat_8h_a2e3d894ac7986bb4967ebfe67a2d9977}{event\+\_\+loopexit()}. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a7a2be7762111b00935c1b1f5ea055351}{event\+\_\+base\+\_\+got\+\_\+break} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$)
\begin{DoxyCompactList}\small\item\em Checks if the event loop was told to abort immediately by \hyperlink{event__compat_8h_a3a5c57caea1d97160f6990b3deeb6961}{event\+\_\+loopbreak()}. \end{DoxyCompactList}\item 
struct \hyperlink{structevent}{event} $\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$, \hyperlink{opal_2mca_2event_2libevent2013_2libevent_2include_2event2_2util_8h_a7ef0023565082a65020f6e56be59fd0b}{evutil\+\_\+socket\+\_\+t}, short, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac1bbbe034b87ff78b7a380c0b71064d4}{event\+\_\+callback\+\_\+fn}, void $\ast$)
\begin{DoxyCompactList}\small\item\em Allocate and asssign a new event structure, ready to be added. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign} (struct \hyperlink{structevent}{event} $\ast$, struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$, \hyperlink{opal_2mca_2event_2libevent2013_2libevent_2include_2event2_2util_8h_a7ef0023565082a65020f6e56be59fd0b}{evutil\+\_\+socket\+\_\+t}, short, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac1bbbe034b87ff78b7a380c0b71064d4}{event\+\_\+callback\+\_\+fn}, void $\ast$)
\begin{DoxyCompactList}\small\item\em Prepare a new, already-\/allocated event structure to be added. \end{DoxyCompactList}\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad7fd53b1263bf0fdccd959a6c5a659cc}{event\+\_\+free} (struct \hyperlink{structevent}{event} $\ast$)
\begin{DoxyCompactList}\small\item\em Deallocate a struct event $\ast$ returned by \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()}. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_acddee16b430c037ae061f966dc18eb9d}{event\+\_\+base\+\_\+once} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$, \hyperlink{opal_2mca_2event_2libevent2013_2libevent_2include_2event2_2util_8h_a7ef0023565082a65020f6e56be59fd0b}{evutil\+\_\+socket\+\_\+t}, short, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac1bbbe034b87ff78b7a380c0b71064d4}{event\+\_\+callback\+\_\+fn}, void $\ast$, const struct timeval $\ast$)
\begin{DoxyCompactList}\small\item\em Schedule a one-\/time event. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add} (struct \hyperlink{structevent}{event} $\ast$ev, const struct timeval $\ast$timeout)
\begin{DoxyCompactList}\small\item\em Add an event to the set of pending events. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del} (struct \hyperlink{structevent}{event} $\ast$)
\begin{DoxyCompactList}\small\item\em Remove an event from the set of monitored events. \end{DoxyCompactList}\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3262ae1dc7fe51516b43412d61301e4f}{event\+\_\+active} (struct \hyperlink{structevent}{event} $\ast$ev, int res, short ncalls)
\begin{DoxyCompactList}\small\item\em Make an event active. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a49773a4e3e46f60e488ac37fb46950d9}{event\+\_\+pending} (const struct \hyperlink{structevent}{event} $\ast$ev, short events, struct timeval $\ast$tv)
\begin{DoxyCompactList}\small\item\em Checks if a specific event is pending or scheduled. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a5be4fbc16d90915a7d1b21ed3bae40c0}{event\+\_\+initialized} (const struct \hyperlink{structevent}{event} $\ast$ev)
\begin{DoxyCompactList}\small\item\em Test if an event structure might be initialized. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_aee0c9c3fc7c997e4d4b77bdcdf321ee6}{\hyperlink{opal_2mca_2event_2libevent2013_2libevent_2include_2event2_2util_8h_a7ef0023565082a65020f6e56be59fd0b}{evutil\+\_\+socket\+\_\+t} \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_aee0c9c3fc7c997e4d4b77bdcdf321ee6}{event\+\_\+get\+\_\+fd} (const struct \hyperlink{structevent}{event} $\ast$ev)}\label{libevent2013_2libevent_2include_2event2_2event_8h_aee0c9c3fc7c997e4d4b77bdcdf321ee6}

\begin{DoxyCompactList}\small\item\em Get the socket or signal assigned to an event, or -\/1 if the event has no socket. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ae9763d285fa415e4547a0d5e55cf5b13}{struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ae9763d285fa415e4547a0d5e55cf5b13}{event\+\_\+get\+\_\+base} (const struct \hyperlink{structevent}{event} $\ast$ev)}\label{libevent2013_2libevent_2include_2event2_2event_8h_ae9763d285fa415e4547a0d5e55cf5b13}

\begin{DoxyCompactList}\small\item\em Get the \hyperlink{structevent__base}{event\+\_\+base} associated with an event. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a0123fdd5b9a1c204de5d7ef1a4578387}{short \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a0123fdd5b9a1c204de5d7ef1a4578387}{event\+\_\+get\+\_\+events} (const struct \hyperlink{structevent}{event} $\ast$ev)}\label{libevent2013_2libevent_2include_2event2_2event_8h_a0123fdd5b9a1c204de5d7ef1a4578387}

\begin{DoxyCompactList}\small\item\em Return the events (E\+V\+\_\+\+R\+E\+A\+D, E\+V\+\_\+\+W\+R\+I\+T\+E, etc) assigned to an event. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a6cdb0a8dbf7efa9be7b65914ed5c6821}{\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac1bbbe034b87ff78b7a380c0b71064d4}{event\+\_\+callback\+\_\+fn} \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a6cdb0a8dbf7efa9be7b65914ed5c6821}{event\+\_\+get\+\_\+callback} (const struct \hyperlink{structevent}{event} $\ast$ev)}\label{libevent2013_2libevent_2include_2event2_2event_8h_a6cdb0a8dbf7efa9be7b65914ed5c6821}

\begin{DoxyCompactList}\small\item\em Return the callback assigned to an event. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ab07e87ff7d43ad7205a008f08fbaf0a3}{void $\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab07e87ff7d43ad7205a008f08fbaf0a3}{event\+\_\+get\+\_\+callback\+\_\+arg} (const struct \hyperlink{structevent}{event} $\ast$ev)}\label{libevent2013_2libevent_2include_2event2_2event_8h_ab07e87ff7d43ad7205a008f08fbaf0a3}

\begin{DoxyCompactList}\small\item\em Return the callback argument assigned to an event. \end{DoxyCompactList}\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a2103c3cbf6e3e173419ebf019e29c788}{event\+\_\+get\+\_\+assignment} (const struct \hyperlink{structevent}{event} $\ast$\hyperlink{structevent}{event}, struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$$\ast$base\+\_\+out, \hyperlink{opal_2mca_2event_2libevent2013_2libevent_2include_2event2_2util_8h_a7ef0023565082a65020f6e56be59fd0b}{evutil\+\_\+socket\+\_\+t} $\ast$fd\+\_\+out, short $\ast$events\+\_\+out, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac1bbbe034b87ff78b7a380c0b71064d4}{event\+\_\+callback\+\_\+fn} $\ast$callback\+\_\+out, void $\ast$$\ast$arg\+\_\+out)
\begin{DoxyCompactList}\small\item\em Extract {\itshape all} of arguments given to construct a given event. \end{DoxyCompactList}\item 
size\+\_\+t \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3881f7391324c05bd6f0c291e2682f03}{event\+\_\+get\+\_\+struct\+\_\+event\+\_\+size} (void)
\begin{DoxyCompactList}\small\item\em Return the size of struct event that the Libevent library was compiled with. \end{DoxyCompactList}\item 
const char $\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a43d7feed94477cf0a7e3e062cc17b7e1}{event\+\_\+get\+\_\+version} (void)
\begin{DoxyCompactList}\small\item\em Get the Libevent version. \end{DoxyCompactList}\item 
ev\+\_\+uint32\+\_\+t \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_abd4d1f2b4ca8e11f3bbf022244f01fa9}{event\+\_\+get\+\_\+version\+\_\+number} (void)
\begin{DoxyCompactList}\small\item\em Return a numeric representation of Libevent's version. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a67067fe995561cd36a7f34ef19e030e8}{event\+\_\+base\+\_\+priority\+\_\+init} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$, int)
\begin{DoxyCompactList}\small\item\em Set the number of different event priorities. \end{DoxyCompactList}\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a9984a63f2edcc72bef96a188f569b367}{event\+\_\+priority\+\_\+set} (struct \hyperlink{structevent}{event} $\ast$, int)
\begin{DoxyCompactList}\small\item\em Assign a priority to an event. \end{DoxyCompactList}\item 
const struct timeval $\ast$ \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a23a7796ac6dd37414703dd447db559a1}{event\+\_\+base\+\_\+init\+\_\+common\+\_\+timeout} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$base, const struct timeval $\ast$duration)
\begin{DoxyCompactList}\small\item\em Prepare an \hyperlink{structevent__base}{event\+\_\+base} to use a large number of timeouts with the same duration. \end{DoxyCompactList}\item 
void \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a653e38c4bdd2f3b2d7476fcee95c1a62}{event\+\_\+set\+\_\+mem\+\_\+functions} (void $\ast$($\ast$malloc\+\_\+fn)(size\+\_\+t sz), void $\ast$($\ast$realloc\+\_\+fn)(void $\ast$ptr, size\+\_\+t sz), void($\ast$free\+\_\+fn)(void $\ast$ptr))
\begin{DoxyCompactList}\small\item\em Override the functions that Libevent uses for memory management. \end{DoxyCompactList}\item 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_acd5d691782408e8a55fbfdc08c26e5da}{void {\bfseries event\+\_\+base\+\_\+dump\+\_\+events} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$, F\+I\+L\+E $\ast$)}\label{libevent2013_2libevent_2include_2event2_2event_8h_acd5d691782408e8a55fbfdc08c26e5da}

\item 
int \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad1d2129d47590c53d166f8c09afee865}{event\+\_\+base\+\_\+gettimeofday\+\_\+cached} (struct \hyperlink{structevent__base}{event\+\_\+base} $\ast$base, struct timeval $\ast$tv)
\begin{DoxyCompactList}\small\item\em Sets 'tv' to the current time (as returned by gettimeofday()), looking at the cached value in 'base' if possible, and calling gettimeofday() or clock\+\_\+gettime() as appropriate if there is no cached time. \end{DoxyCompactList}\end{DoxyCompactItemize}


\subsection{Detailed Description}
Core functions for waiting for and receiving events, and using event bases. 



\subsection{Macro Definition Documentation}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a01084abbcdd3a58b4068359548a3ea71}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+\_\+\+E\+T@{E\+V\+\_\+\+E\+T}}
\index{E\+V\+\_\+\+E\+T@{E\+V\+\_\+\+E\+T}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{E\+V\+\_\+\+E\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+\_\+\+E\+T~0x20}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a01084abbcdd3a58b4068359548a3ea71}


Select edge-\/triggered behavior, if supported by the backend. 



Referenced by evmap\+\_\+io\+\_\+add().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a3c4947a60eb6d09327c61f89135f9f37}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T@{E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T}}
\index{E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T@{E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T~0x10}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a3c4947a60eb6d09327c61f89135f9f37}


Persistent event\+: won't get removed automatically when activated. 

When a persistent event with a timeout becomes activated, its timeout is reset to 0. 

Referenced by bufferevent\+\_\+rate\+\_\+limit\+\_\+group\+\_\+new(), bufferevent\+\_\+socket\+\_\+connect(), bufferevent\+\_\+socket\+\_\+new(), evdns\+\_\+add\+\_\+server\+\_\+port\+\_\+with\+\_\+base(), evdns\+\_\+server\+\_\+request\+\_\+respond(), event\+\_\+assign(), event\+\_\+base\+\_\+once(), and evthread\+\_\+make\+\_\+base\+\_\+notifiable().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a37ef4b6056484f5580f7d72fcf46fccf}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T@{E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T}}
\index{E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T@{E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T~0x01}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a37ef4b6056484f5580f7d72fcf46fccf}


Indicates that a timeout has occurred. 

It's not necessary to pass this flag to event\+\_\+for new()/event\+\_\+assign() to get a timeout. 

Referenced by event\+\_\+base\+\_\+loopexit(), event\+\_\+base\+\_\+once(), event\+\_\+loopexit(), and event\+\_\+pending().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ad74f7bf73ff985bfaf61c462cbba022f}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+E\+N\+T\+\_\+\+M\+A\+X\+\_\+\+P\+R\+I\+O\+R\+I\+T\+I\+E\+S@{E\+V\+E\+N\+T\+\_\+\+M\+A\+X\+\_\+\+P\+R\+I\+O\+R\+I\+T\+I\+E\+S}}
\index{E\+V\+E\+N\+T\+\_\+\+M\+A\+X\+\_\+\+P\+R\+I\+O\+R\+I\+T\+I\+E\+S@{E\+V\+E\+N\+T\+\_\+\+M\+A\+X\+\_\+\+P\+R\+I\+O\+R\+I\+T\+I\+E\+S}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{E\+V\+E\+N\+T\+\_\+\+M\+A\+X\+\_\+\+P\+R\+I\+O\+R\+I\+T\+I\+E\+S}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+E\+N\+T\+\_\+\+M\+A\+X\+\_\+\+P\+R\+I\+O\+R\+I\+T\+I\+E\+S~256}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ad74f7bf73ff985bfaf61c462cbba022f}


Largest number of priorities that Libevent can support. 



Referenced by event\+\_\+base\+\_\+priority\+\_\+init().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a10b9c102337d0ece8607c9c01bc4f7c8}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K@{E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K}}
\index{E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K@{E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K~0x02}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a10b9c102337d0ece8607c9c01bc4f7c8}


Do not block\+: see which events are ready now, run the callbacks of the highest-\/priority ones, then exit. 



Referenced by event\+\_\+base\+\_\+loop().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_afab575b1e867dde13a2c7f2f967e0e4e}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E@{E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E}}
\index{E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E@{E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E}]{\setlength{\rightskip}{0pt plus 5cm}\#define E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E~0x01}}\label{libevent2013_2libevent_2include_2event2_2event_8h_afab575b1e867dde13a2c7f2f967e0e4e}


Block until we have an active event, then exit once all active events have had their callbacks run. 



Referenced by event\+\_\+base\+\_\+loop().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_aad00c7d4ddbd6b590c15861a2e767182}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N@{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N}}
\index{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N@{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N}]{\setlength{\rightskip}{0pt plus 5cm}\#define L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N~\+\_\+\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N}}\label{libevent2013_2libevent_2include_2event2_2event_8h_aad00c7d4ddbd6b590c15861a2e767182}


As event\+\_\+get\+\_\+version, but gives the version of Libevent's headers. 

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a8a9c8021651a2d8d7946083281279586}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+N\+U\+M\+B\+E\+R@{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+N\+U\+M\+B\+E\+R}}
\index{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+N\+U\+M\+B\+E\+R@{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+N\+U\+M\+B\+E\+R}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+N\+U\+M\+B\+E\+R}]{\setlength{\rightskip}{0pt plus 5cm}\#define L\+I\+B\+E\+V\+E\+N\+T\+\_\+\+V\+E\+R\+S\+I\+O\+N\+\_\+\+N\+U\+M\+B\+E\+R~\+\_\+\+E\+V\+E\+N\+T\+\_\+\+N\+U\+M\+E\+R\+I\+C\+\_\+\+V\+E\+R\+S\+I\+O\+N}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a8a9c8021651a2d8d7946083281279586}


As event\+\_\+get\+\_\+version\+\_\+number, but gives the version number of Libevent's headers. 



\subsection{Typedef Documentation}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ac1bbbe034b87ff78b7a380c0b71064d4}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+callback\+\_\+fn@{event\+\_\+callback\+\_\+fn}}
\index{event\+\_\+callback\+\_\+fn@{event\+\_\+callback\+\_\+fn}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+callback\+\_\+fn}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ event\+\_\+callback\+\_\+fn)({\bf evutil\+\_\+socket\+\_\+t}, short, void $\ast$)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ac1bbbe034b87ff78b7a380c0b71064d4}


A callback function for an event. 

It receives three arguments\+:


\begin{DoxyParams}{Parameters}
{\em fd} & An fd or signal \\
\hline
{\em events} & One or more E\+V\+\_\+$\ast$ flags \\
\hline
{\em arg} & A user-\/supplied argument.\\
\hline
\end{DoxyParams}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()} 
\end{DoxySeeAlso}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a96cbd560e6fe7cb4ebfa6000e164d752}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+fatal\+\_\+cb@{event\+\_\+fatal\+\_\+cb}}
\index{event\+\_\+fatal\+\_\+cb@{event\+\_\+fatal\+\_\+cb}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+fatal\+\_\+cb}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ event\+\_\+fatal\+\_\+cb)(int err)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a96cbd560e6fe7cb4ebfa6000e164d752}


A function to be called if Libevent encounters a fatal internal error. 

\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a73beabc6626db0da679eb8961ce3f477}{event\+\_\+set\+\_\+fatal\+\_\+callback} 
\end{DoxySeeAlso}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_adbff4d951c4b002b955966f0ab228a76}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+log\+\_\+cb@{event\+\_\+log\+\_\+cb}}
\index{event\+\_\+log\+\_\+cb@{event\+\_\+log\+\_\+cb}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+log\+\_\+cb}]{\setlength{\rightskip}{0pt plus 5cm}typedef void($\ast$ event\+\_\+log\+\_\+cb)(int severity, const char $\ast$msg)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_adbff4d951c4b002b955966f0ab228a76}


A callback function used to intercept Libevent's log messages. 

\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a87e59ed1dd711ced2b2a1314d3e3c1c7}{event\+\_\+set\+\_\+log\+\_\+callback} 
\end{DoxySeeAlso}


\subsection{Enumeration Type Documentation}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+config\+\_\+flag@{event\+\_\+base\+\_\+config\+\_\+flag}}
\index{event\+\_\+base\+\_\+config\+\_\+flag@{event\+\_\+base\+\_\+config\+\_\+flag}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+config\+\_\+flag}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf event\+\_\+base\+\_\+config\+\_\+flag}}}\label{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5}


A flag passed to \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac4b2697c7927fcd2167a1749f6602f29}{event\+\_\+config\+\_\+set\+\_\+flag()}. 

These flags change the behavior of an allocated \hyperlink{structevent__base}{event\+\_\+base}.

\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac4b2697c7927fcd2167a1749f6602f29}{event\+\_\+config\+\_\+set\+\_\+flag()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80}{event\+\_\+method\+\_\+feature} 
\end{DoxySeeAlso}
\begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+L\+O\+C\+K@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+L\+O\+C\+K}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+L\+O\+C\+K@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+L\+O\+C\+K}}\item[{\em 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5ac1302f72251168137258335e945e2ae5}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+L\+O\+C\+K}\label{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5ac1302f72251168137258335e945e2ae5}
}]Do not allocate a lock for the event base, even if we have locking set up. \index{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+I\+G\+N\+O\+R\+E\+\_\+\+E\+N\+V@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+I\+G\+N\+O\+R\+E\+\_\+\+E\+N\+V}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+I\+G\+N\+O\+R\+E\+\_\+\+E\+N\+V@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+I\+G\+N\+O\+R\+E\+\_\+\+E\+N\+V}}\item[{\em 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5a230574947412d83f2dd19fe8c7d286e7}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+I\+G\+N\+O\+R\+E\+\_\+\+E\+N\+V}\label{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5a230574947412d83f2dd19fe8c7d286e7}
}]Do not check the E\+V\+E\+N\+T\+\_\+$\ast$ environment variables when configuring an \hyperlink{structevent__base}{event\+\_\+base}. \index{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+S\+T\+A\+R\+T\+U\+P\+\_\+\+I\+O\+C\+P@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+S\+T\+A\+R\+T\+U\+P\+\_\+\+I\+O\+C\+P}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+S\+T\+A\+R\+T\+U\+P\+\_\+\+I\+O\+C\+P@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+S\+T\+A\+R\+T\+U\+P\+\_\+\+I\+O\+C\+P}}\item[{\em 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5a4ffb2510ab533d7156f412ee4f0c08ea}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+S\+T\+A\+R\+T\+U\+P\+\_\+\+I\+O\+C\+P}\label{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5a4ffb2510ab533d7156f412ee4f0c08ea}
}]Windows only\+: enable the I\+O\+C\+P dispatcher at startup. If this flag is set then \hyperlink{bufferevent_8h_a501557193aa56c9f4923583d9d734395}{bufferevent\+\_\+socket\+\_\+new()} and evconn\+\_\+listener\+\_\+new() will use I\+O\+C\+P-\/backed implementations instead of the usual select-\/based one on Windows. \index{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+\_\+\+C\+A\+C\+H\+E\+\_\+\+T\+I\+M\+E@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+\_\+\+C\+A\+C\+H\+E\+\_\+\+T\+I\+M\+E}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+\_\+\+C\+A\+C\+H\+E\+\_\+\+T\+I\+M\+E@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+\_\+\+C\+A\+C\+H\+E\+\_\+\+T\+I\+M\+E}}\item[{\em 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5a057dff1977c48174f0a0f0c43ef92ec5}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+\_\+\+C\+A\+C\+H\+E\+\_\+\+T\+I\+M\+E}\label{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5a057dff1977c48174f0a0f0c43ef92ec5}
}]Instead of checking the current time every time the event loop is ready to run timeout callbacks, check after each timeout callback. \index{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+E\+P\+O\+L\+L\+\_\+\+U\+S\+E\+\_\+\+C\+H\+A\+N\+G\+E\+L\+I\+S\+T@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+E\+P\+O\+L\+L\+\_\+\+U\+S\+E\+\_\+\+C\+H\+A\+N\+G\+E\+L\+I\+S\+T}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+E\+P\+O\+L\+L\+\_\+\+U\+S\+E\+\_\+\+C\+H\+A\+N\+G\+E\+L\+I\+S\+T@{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+E\+P\+O\+L\+L\+\_\+\+U\+S\+E\+\_\+\+C\+H\+A\+N\+G\+E\+L\+I\+S\+T}}\item[{\em 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5acceb45f3098787247044929f92f4296e}{E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+E\+P\+O\+L\+L\+\_\+\+U\+S\+E\+\_\+\+C\+H\+A\+N\+G\+E\+L\+I\+S\+T}\label{libevent2013_2libevent_2include_2event2_2event_8h_acfef69af45abee54725f40f7f29986c5acceb45f3098787247044929f92f4296e}
}]If we are using the epoll backend, this flag says that it is safe to use Libevent's internal change-\/list code to batch up adds and deletes in order to try to do as few syscalls as possible. Setting this flag can make your code run faster, but it may trigger a Linux bug\+: it is not safe to use this flag if you have any fds cloned by dup() or its variants. Doing so will produce strange and hard-\/to-\/diagnose bugs.

This flag can also be activated by settnig the E\+V\+E\+N\+T\+\_\+\+E\+P\+O\+L\+L\+\_\+\+U\+S\+E\+\_\+\+C\+H\+A\+N\+G\+E\+L\+I\+S\+T environment variable.

This flag has no effect if you wind up using a backend other than epoll. \end{description}
\end{Desc}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+method\+\_\+feature@{event\+\_\+method\+\_\+feature}}
\index{event\+\_\+method\+\_\+feature@{event\+\_\+method\+\_\+feature}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+method\+\_\+feature}]{\setlength{\rightskip}{0pt plus 5cm}enum {\bf event\+\_\+method\+\_\+feature}}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80}


A flag used to describe which features an \hyperlink{structevent__base}{event\+\_\+base} (must) provide. 

Because of O\+S limitations, not every Libevent backend supports every possible feature. You can use this type with \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a2b08f2633e76290117e4a03621940948}{event\+\_\+config\+\_\+require\+\_\+features()} to tell Libevent to only proceed if your \hyperlink{structevent__base}{event\+\_\+base} implements a given feature, and you can receive this type from \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a11cb58563e8b5da36f00db2e250d026c}{event\+\_\+base\+\_\+get\+\_\+features()} to see which features are available. \begin{Desc}
\item[Enumerator]\par
\begin{description}
\index{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+E\+T@{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+E\+T}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+E\+T@{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+E\+T}}\item[{\em 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80ab407cae60af925dba44bd66e56e5f897}{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+E\+T}\label{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80ab407cae60af925dba44bd66e56e5f897}
}]Require an event method that allows edge-\/triggered events with E\+V\+\_\+\+E\+T. \index{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+O1@{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+O1}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+O1@{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+O1}}\item[{\em 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80a7a6f2de86c09b92aa175f950190bf706}{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+O1}\label{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80a7a6f2de86c09b92aa175f950190bf706}
}]Require an event method where having one event triggered among many is \mbox{[}approximately\mbox{]} an O(1) operation. This excludes (for example) select and poll, which are approximately O(\+N) for N equal to the total number of possible events. \index{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+F\+D\+S@{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+F\+D\+S}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+F\+D\+S@{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+F\+D\+S}}\item[{\em 
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80a2e964e8a8f3033d26d52831fb8eec199}{E\+V\+\_\+\+F\+E\+A\+T\+U\+R\+E\+\_\+\+F\+D\+S}\label{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80a2e964e8a8f3033d26d52831fb8eec199}
}]Require an event method that allows file descriptors as well as sockets. \end{description}
\end{Desc}


\subsection{Function Documentation}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a3262ae1dc7fe51516b43412d61301e4f}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+active@{event\+\_\+active}}
\index{event\+\_\+active@{event\+\_\+active}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+active}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+active (
\begin{DoxyParamCaption}
\item[{struct {\bf event} $\ast$}]{ev, }
\item[{int}]{res, }
\item[{short}]{ncalls}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a3262ae1dc7fe51516b43412d61301e4f}


Make an event active. 

You can use this function on a pending or a non-\/pending event to make it active, so that its callback will be run by \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a01e457364ed5216a8c7bc219033b946f}{event\+\_\+base\+\_\+dispatch()} or \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop()}.

One common use in multithreaded programs is to wake the thread running \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop()} from another thread.


\begin{DoxyParams}{Parameters}
{\em ev} & an event to make active. \\
\hline
{\em res} & a set of flags to pass to the event's callback. \\
\hline
{\em ncalls} & an obsolete argument\+: this is ignored. \\
\hline
\end{DoxyParams}


References event\+\_\+base\+::th\+\_\+base\+\_\+lock.



Referenced by bufferevent\+\_\+socket\+\_\+connect().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+add@{event\+\_\+add}}
\index{event\+\_\+add@{event\+\_\+add}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+add}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+add (
\begin{DoxyParamCaption}
\item[{struct {\bf event} $\ast$}]{ev, }
\item[{const struct timeval $\ast$}]{timeout}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}


Add an event to the set of pending events. 

The function \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()} schedules the execution of the ev event when the event specified in \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign()}/event\+\_\+new() occurs, or when the time specified in timeout has elapesed. If atimeout is N\+U\+L\+L, no timeout occurs and the function will only be called if a matching event occurs. The event in the ev argument must be already initialized by \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign()} or \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()} and may not be used in calls to \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign()} until it is no longer pending.

If the event in the ev argument already has a scheduled timeout, calling \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()} replaces the old timeout with the new one, or clears the old timeout if the timeout argument is N\+U\+L\+L.


\begin{DoxyParams}{Parameters}
{\em ev} & an event struct initialized via \hyperlink{event__compat_8h_ace184d66066e9bac013779d8f6921d11}{event\+\_\+set()} \\
\hline
{\em timeout} & the maximum amount of time to wait for the event, or N\+U\+L\+L to wait forever \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, or -\/1 if an error occurred 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()} 
\end{DoxySeeAlso}


References event\+\_\+base\+::th\+\_\+base\+\_\+lock.



Referenced by bufferevent\+\_\+rate\+\_\+limit\+\_\+group\+\_\+new(), bufferevent\+\_\+rate\+\_\+limit\+\_\+group\+\_\+set\+\_\+cfg(), bufferevent\+\_\+set\+\_\+rate\+\_\+limit(), evdns\+\_\+add\+\_\+server\+\_\+port\+\_\+with\+\_\+base(), evdns\+\_\+server\+\_\+request\+\_\+respond(), event\+\_\+base\+\_\+once(), and evthread\+\_\+make\+\_\+base\+\_\+notifiable().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+assign@{event\+\_\+assign}}
\index{event\+\_\+assign@{event\+\_\+assign}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+assign}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+assign (
\begin{DoxyParamCaption}
\item[{struct {\bf event} $\ast$}]{, }
\item[{struct {\bf event\+\_\+base} $\ast$}]{, }
\item[{{\bf evutil\+\_\+socket\+\_\+t}}]{, }
\item[{short}]{, }
\item[{{\bf event\+\_\+callback\+\_\+fn}}]{, }
\item[{void $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}


Prepare a new, already-\/allocated event structure to be added. 

The function \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign()} prepares the event structure ev to be used in future calls to \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()} and \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del()}. Unlike \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()}, it doesn't allocate memory itself\+: it requires that you have already allocated a struct event, probably on the heap. Doing this will typically make your code depend on the size of the event structure, and thereby create incompatibility with future versions of Libevent.

The easiest way to avoid this problem is just to use \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()} and \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad7fd53b1263bf0fdccd959a6c5a659cc}{event\+\_\+free()} instead.

A slightly harder way to future-\/proof your code is to use \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3881f7391324c05bd6f0c291e2682f03}{event\+\_\+get\+\_\+struct\+\_\+event\+\_\+size()} to determine the required size of an event at runtime.

Note that it is N\+O\+T safe to call this function on an event that is active or pending. Doing so W\+I\+L\+L corrupt internal data structures in Libevent, and lead to strange, hard-\/to-\/diagnose bugs. You {\itshape can} use event\+\_\+assign to change an existing event, but only if it is not active or pending!

The arguments for this function, and the behavior of the events that it makes, are as for \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()}.


\begin{DoxyParams}{Parameters}
{\em ev} & an event struct to be modified \\
\hline
{\em base} & the event base to which ev should be attached. \\
\hline
{\em fd} & the file descriptor to be monitored \\
\hline
{\em events} & desired events to monitor; can be E\+V\+\_\+\+R\+E\+A\+D and/or E\+V\+\_\+\+W\+R\+I\+T\+E \\
\hline
{\em callback} & callback function to be invoked when the event occurs \\
\hline
{\em callback\+\_\+arg} & an argument to be passed to the callback function\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if success, or -\/1 on invalid arguments.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_acddee16b430c037ae061f966dc18eb9d}{event\+\_\+base\+\_\+once()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3881f7391324c05bd6f0c291e2682f03}{event\+\_\+get\+\_\+struct\+\_\+event\+\_\+size()} 
\end{DoxySeeAlso}


References E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T, E\+V\+\_\+\+R\+E\+A\+D, E\+V\+\_\+\+S\+I\+G\+N\+A\+L, E\+V\+\_\+\+W\+R\+I\+T\+E, and event\+\_\+base\+::nactivequeues.



Referenced by bufferevent\+\_\+rate\+\_\+limit\+\_\+group\+\_\+new(), bufferevent\+\_\+socket\+\_\+connect(), bufferevent\+\_\+socket\+\_\+new(), evdns\+\_\+add\+\_\+server\+\_\+port\+\_\+with\+\_\+base(), evdns\+\_\+server\+\_\+request\+\_\+respond(), event\+\_\+base\+\_\+once(), event\+\_\+new(), event\+\_\+set(), and evthread\+\_\+make\+\_\+base\+\_\+notifiable().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a01e457364ed5216a8c7bc219033b946f}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+dispatch@{event\+\_\+base\+\_\+dispatch}}
\index{event\+\_\+base\+\_\+dispatch@{event\+\_\+base\+\_\+dispatch}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+dispatch}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+dispatch (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a01e457364ed5216a8c7bc219033b946f}


Event dispatching loop. 

This loop will run the event base until either there are no more added events, or until something calls \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a07a7599e478e4031fa8cf52e26d8aa1e}{event\+\_\+base\+\_\+loopbreak()} or \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac2c66174ee5f10df65b9a9b62fca7dd9}{event\+\_\+base\+\_\+loopexit()}.


\begin{DoxyParams}{Parameters}
{\em base} & the \hyperlink{structevent__base}{event\+\_\+base} structure returned by \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a4c16f1203aebc67f94791ae0240b7353}{event\+\_\+base\+\_\+new()} or \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config()} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, -\/1 if an error occurred, or 1 if no events were registered. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop()} 
\end{DoxySeeAlso}


References event\+\_\+base\+\_\+loop().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a6e9827de8c3014417b11b48f2fe688ae}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+free@{event\+\_\+base\+\_\+free}}
\index{event\+\_\+base\+\_\+free@{event\+\_\+base\+\_\+free}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+base\+\_\+free (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a6e9827de8c3014417b11b48f2fe688ae}


Deallocate all memory associated with an \hyperlink{structevent__base}{event\+\_\+base}, and free the base. 

Note that this function will not close any fds or free any memory passed to event\+\_\+new as the argument to callback.


\begin{DoxyParams}{Parameters}
{\em eb} & an \hyperlink{structevent__base}{event\+\_\+base} to be freed \\
\hline
\end{DoxyParams}


References event\+\_\+base\+::activequeues, event\+\_\+base\+::changelist, event\+\_\+base\+::common\+\_\+timeout\+\_\+queues, event\+\_\+base\+::current\+\_\+event\+\_\+cond, eventop\+::dealloc, event\+\_\+debug\+\_\+unassign(), event\+\_\+del(), event\+\_\+base\+::eventqueue, evmap\+\_\+io\+\_\+clear(), event\+\_\+base\+::evsel, E\+V\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K\+T\+Y\+P\+E\+\_\+\+R\+E\+C\+U\+R\+S\+I\+V\+E, event\+\_\+base\+::io, event\+\_\+base\+::n\+\_\+common\+\_\+timeouts, event\+\_\+base\+::nactivequeues, event\+\_\+base\+::sigmap, event\+\_\+base\+::th\+\_\+base\+\_\+lock, event\+\_\+base\+::th\+\_\+notify, event\+\_\+base\+::th\+\_\+notify\+\_\+fd, and event\+\_\+base\+::timeheap.



Referenced by event\+\_\+base\+\_\+new\+\_\+with\+\_\+config().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a11cb58563e8b5da36f00db2e250d026c}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+get\+\_\+features@{event\+\_\+base\+\_\+get\+\_\+features}}
\index{event\+\_\+base\+\_\+get\+\_\+features@{event\+\_\+base\+\_\+get\+\_\+features}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+get\+\_\+features}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+get\+\_\+features (
\begin{DoxyParamCaption}
\item[{const struct {\bf event\+\_\+base} $\ast$}]{base}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a11cb58563e8b5da36f00db2e250d026c}


Return a bitmask of the features implemented by an event base. 

This will be a bitwise O\+R of one or more of the values of event\+\_\+method\+\_\+feature

\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80}{event\+\_\+method\+\_\+feature} 
\end{DoxySeeAlso}


References event\+\_\+base\+::evsel, and eventop\+::features.

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a10914a893ed07dc8238d3274a9cbb3fc}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+get\+\_\+method@{event\+\_\+base\+\_\+get\+\_\+method}}
\index{event\+\_\+base\+\_\+get\+\_\+method@{event\+\_\+base\+\_\+get\+\_\+method}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+get\+\_\+method}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ event\+\_\+base\+\_\+get\+\_\+method (
\begin{DoxyParamCaption}
\item[{const struct {\bf event\+\_\+base} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a10914a893ed07dc8238d3274a9cbb3fc}


Get the kernel event notification mechanism used by Libevent. 


\begin{DoxyParams}{Parameters}
{\em eb} & the \hyperlink{structevent__base}{event\+\_\+base} structure returned by \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a4c16f1203aebc67f94791ae0240b7353}{event\+\_\+base\+\_\+new()} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a string identifying the kernel event mechanism (kqueue, epoll, etc.) 
\end{DoxyReturn}


References event\+\_\+base\+::evsel, and eventop\+::name.

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ad1d2129d47590c53d166f8c09afee865}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+gettimeofday\+\_\+cached@{event\+\_\+base\+\_\+gettimeofday\+\_\+cached}}
\index{event\+\_\+base\+\_\+gettimeofday\+\_\+cached@{event\+\_\+base\+\_\+gettimeofday\+\_\+cached}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+gettimeofday\+\_\+cached}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+gettimeofday\+\_\+cached (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{base, }
\item[{struct timeval $\ast$}]{tv}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ad1d2129d47590c53d166f8c09afee865}


Sets 'tv' to the current time (as returned by gettimeofday()), looking at the cached value in 'base' if possible, and calling gettimeofday() or clock\+\_\+gettime() as appropriate if there is no cached time. 

Generally, this value will only be cached while actually processing event callbacks, and may be very inaccuate if your callbacks take a long time to execute.

Returns 0 on success, negative on failure. 

References event\+\_\+base\+::tv\+\_\+cache.



Referenced by bufferevent\+\_\+rate\+\_\+limit\+\_\+group\+\_\+new(), and bufferevent\+\_\+set\+\_\+rate\+\_\+limit().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a7a2be7762111b00935c1b1f5ea055351}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+got\+\_\+break@{event\+\_\+base\+\_\+got\+\_\+break}}
\index{event\+\_\+base\+\_\+got\+\_\+break@{event\+\_\+base\+\_\+got\+\_\+break}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+got\+\_\+break}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+got\+\_\+break (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a7a2be7762111b00935c1b1f5ea055351}


Checks if the event loop was told to abort immediately by \hyperlink{event__compat_8h_a3a5c57caea1d97160f6990b3deeb6961}{event\+\_\+loopbreak()}. 

This function will return true for an \hyperlink{structevent__base}{event\+\_\+base} at every point after \hyperlink{event__compat_8h_a3a5c57caea1d97160f6990b3deeb6961}{event\+\_\+loopbreak()} is called, until the event loop is next entered.


\begin{DoxyParams}{Parameters}
{\em eb} & the \hyperlink{structevent__base}{event\+\_\+base} structure returned by \hyperlink{event__compat_8h_a1bf74386dd3725e1538fed2d70c1c113}{event\+\_\+init()} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a07a7599e478e4031fa8cf52e26d8aa1e}{event\+\_\+base\+\_\+loopbreak()} was called on this event base, or 0 otherwise 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a07a7599e478e4031fa8cf52e26d8aa1e}{event\+\_\+base\+\_\+loopbreak()} 

\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a4786b2d2cc1dd6e5fdd50e0d7627d495}{event\+\_\+base\+\_\+got\+\_\+exit()} 
\end{DoxySeeAlso}


References event\+\_\+base\+::event\+\_\+break, and event\+\_\+base\+::th\+\_\+base\+\_\+lock.

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a4786b2d2cc1dd6e5fdd50e0d7627d495}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+got\+\_\+exit@{event\+\_\+base\+\_\+got\+\_\+exit}}
\index{event\+\_\+base\+\_\+got\+\_\+exit@{event\+\_\+base\+\_\+got\+\_\+exit}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+got\+\_\+exit}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+got\+\_\+exit (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a4786b2d2cc1dd6e5fdd50e0d7627d495}


Checks if the event loop was told to exit by \hyperlink{event__compat_8h_a2e3d894ac7986bb4967ebfe67a2d9977}{event\+\_\+loopexit()}. 

This function will return true for an \hyperlink{structevent__base}{event\+\_\+base} at every point after \hyperlink{event__compat_8h_a2e3d894ac7986bb4967ebfe67a2d9977}{event\+\_\+loopexit()} is called, until the event loop is next entered.


\begin{DoxyParams}{Parameters}
{\em eb} & the \hyperlink{structevent__base}{event\+\_\+base} structure returned by \hyperlink{event__compat_8h_a1bf74386dd3725e1538fed2d70c1c113}{event\+\_\+init()} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac2c66174ee5f10df65b9a9b62fca7dd9}{event\+\_\+base\+\_\+loopexit()} was called on this event base, or 0 otherwise 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac2c66174ee5f10df65b9a9b62fca7dd9}{event\+\_\+base\+\_\+loopexit()} 

\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a7a2be7762111b00935c1b1f5ea055351}{event\+\_\+base\+\_\+got\+\_\+break()} 
\end{DoxySeeAlso}


References event\+\_\+base\+::event\+\_\+gotterm, and event\+\_\+base\+::th\+\_\+base\+\_\+lock.

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a23a7796ac6dd37414703dd447db559a1}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+init\+\_\+common\+\_\+timeout@{event\+\_\+base\+\_\+init\+\_\+common\+\_\+timeout}}
\index{event\+\_\+base\+\_\+init\+\_\+common\+\_\+timeout@{event\+\_\+base\+\_\+init\+\_\+common\+\_\+timeout}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+init\+\_\+common\+\_\+timeout}]{\setlength{\rightskip}{0pt plus 5cm}const struct timeval$\ast$ event\+\_\+base\+\_\+init\+\_\+common\+\_\+timeout (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{base, }
\item[{const struct timeval $\ast$}]{duration}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a23a7796ac6dd37414703dd447db559a1}


Prepare an \hyperlink{structevent__base}{event\+\_\+base} to use a large number of timeouts with the same duration. 

Libevent's default scheduling algorithm is optimized for having a large number of timeouts with their durations more or less randomly distributed. But if you have a large number of timeouts that all have the same duration (for example, if you have a large number of connections that all have a 10-\/second timeout), then you can improve Libevent's performance by telling Libevent about it.

To do this, call this function with the common duration. It will return a pointer to a different, opaque timeout value. (Don't depend on its actual contents!) When you use this timeout value in \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()}, Libevent will schedule the event more efficiently.

(This optimization probably will not be worthwhile until you have thousands or tens of thousands of events with the same timeout.) 

References event\+\_\+base\+::common\+\_\+timeout\+\_\+queues, event\+\_\+priority\+\_\+set(), event\+\_\+base\+::n\+\_\+common\+\_\+timeouts, and event\+\_\+base\+::n\+\_\+common\+\_\+timeouts\+\_\+allocated.

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+loop@{event\+\_\+base\+\_\+loop}}
\index{event\+\_\+base\+\_\+loop@{event\+\_\+base\+\_\+loop}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+loop}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+loop (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{, }
\item[{int}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}


Wait for events to become active, and run their callbacks. 

This is a more flexible version of \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a01e457364ed5216a8c7bc219033b946f}{event\+\_\+base\+\_\+dispatch()}.

By default, this loop will run the event base until either there are no more added events, or until something calls \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a07a7599e478e4031fa8cf52e26d8aa1e}{event\+\_\+base\+\_\+loopbreak()} or evenet\+\_\+base\+\_\+loopexit(). You can override this behavior with the 'flags' argument.


\begin{DoxyParams}{Parameters}
{\em eb} & the \hyperlink{structevent__base}{event\+\_\+base} structure returned by \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a4c16f1203aebc67f94791ae0240b7353}{event\+\_\+base\+\_\+new()} or \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config()} \\
\hline
{\em flags} & any combination of E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E $\vert$ E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, -\/1 if an error occurred, or 1 if no events were registered. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac2c66174ee5f10df65b9a9b62fca7dd9}{event\+\_\+base\+\_\+loopexit()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a01e457364ed5216a8c7bc219033b946f}{event\+\_\+base\+\_\+dispatch()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afab575b1e867dde13a2c7f2f967e0e4e}{E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a10b9c102337d0ece8607c9c01bc4f7c8}{E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K} 
\end{DoxySeeAlso}


References eventop\+::dispatch, event\+\_\+base\+::event\+\_\+break, event\+\_\+base\+::event\+\_\+gotterm, event\+\_\+base\+::event\+\_\+tv, E\+V\+L\+O\+O\+P\+\_\+\+N\+O\+N\+B\+L\+O\+C\+K, E\+V\+L\+O\+O\+P\+\_\+\+O\+N\+C\+E, event\+\_\+base\+::evsel, event\+\_\+base\+::running\+\_\+loop, event\+\_\+base\+::sig, and event\+\_\+base\+::th\+\_\+owner\+\_\+id.



Referenced by event\+\_\+base\+\_\+dispatch(), and event\+\_\+loop().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a07a7599e478e4031fa8cf52e26d8aa1e}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+loopbreak@{event\+\_\+base\+\_\+loopbreak}}
\index{event\+\_\+base\+\_\+loopbreak@{event\+\_\+base\+\_\+loopbreak}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+loopbreak}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+loopbreak (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a07a7599e478e4031fa8cf52e26d8aa1e}


Abort the active \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop()} immediately. 

\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop()} will abort the loop after the next event is completed; \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a07a7599e478e4031fa8cf52e26d8aa1e}{event\+\_\+base\+\_\+loopbreak()} is typically invoked from this event's callback. This behavior is analogous to the \char`\"{}break;\char`\"{} statement.

Subsequent invocations of \hyperlink{event__compat_8h_a765c1875642fc730addf04e9433f6448}{event\+\_\+loop()} will proceed normally.


\begin{DoxyParams}{Parameters}
{\em eb} & the \hyperlink{structevent__base}{event\+\_\+base} structure returned by \hyperlink{event__compat_8h_a1bf74386dd3725e1538fed2d70c1c113}{event\+\_\+init()} \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, or -\/1 if an error occurred 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ac2c66174ee5f10df65b9a9b62fca7dd9}{event\+\_\+base\+\_\+loopexit()} 
\end{DoxySeeAlso}


References event\+\_\+base\+::event\+\_\+break, and event\+\_\+base\+::th\+\_\+base\+\_\+lock.



Referenced by event\+\_\+loopbreak().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ac2c66174ee5f10df65b9a9b62fca7dd9}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+loopexit@{event\+\_\+base\+\_\+loopexit}}
\index{event\+\_\+base\+\_\+loopexit@{event\+\_\+base\+\_\+loopexit}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+loopexit}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+loopexit (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{, }
\item[{const struct timeval $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ac2c66174ee5f10df65b9a9b62fca7dd9}


Exit the event loop after the specified time. 

The next \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop()} iteration after the given timer expires will complete normally (handling all queued events) then exit without blocking for events again.

Subsequent invocations of \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad712706e6a763b6662f0eb03b3d8cd80}{event\+\_\+base\+\_\+loop()} will proceed normally.


\begin{DoxyParams}{Parameters}
{\em eb} & the \hyperlink{structevent__base}{event\+\_\+base} structure returned by \hyperlink{event__compat_8h_a1bf74386dd3725e1538fed2d70c1c113}{event\+\_\+init()} \\
\hline
{\em tv} & the amount of time after which the loop should terminate, or N\+U\+L\+L to exit after running all currently active events. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, or -\/1 if an error occurred 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a07a7599e478e4031fa8cf52e26d8aa1e}{event\+\_\+base\+\_\+loopbreak()} 
\end{DoxySeeAlso}


References E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T, and event\+\_\+base\+\_\+once().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a4c16f1203aebc67f94791ae0240b7353}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+new@{event\+\_\+base\+\_\+new}}
\index{event\+\_\+base\+\_\+new@{event\+\_\+base\+\_\+new}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+new}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf event\+\_\+base}$\ast$ event\+\_\+base\+\_\+new (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a4c16f1203aebc67f94791ae0240b7353}


Create and return a new \hyperlink{structevent__base}{event\+\_\+base} to use with the rest of Libevent. 

\begin{DoxyReturn}{Returns}
a new \hyperlink{structevent__base}{event\+\_\+base} on success, or N\+U\+L\+L on failure.
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a6e9827de8c3014417b11b48f2fe688ae}{event\+\_\+base\+\_\+free()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config()} 
\end{DoxySeeAlso}


References event\+\_\+base\+\_\+new\+\_\+with\+\_\+config(), event\+\_\+config\+\_\+free(), and event\+\_\+config\+\_\+new().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+new\+\_\+with\+\_\+config@{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config}}
\index{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config@{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf event\+\_\+base}$\ast$ event\+\_\+base\+\_\+new\+\_\+with\+\_\+config (
\begin{DoxyParamCaption}
\item[{const struct {\bf event\+\_\+config} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}


Initialize the event A\+P\+I. 

Use \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config()} to initialize a new event base, taking the specified configuration under consideration. The configuration object can currently be used to avoid certain event notification mechanisms.


\begin{DoxyParams}{Parameters}
{\em cfg} & the event configuration object \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
an initialized \hyperlink{structevent__base}{event\+\_\+base} that can be used to registering events, or N\+U\+L\+L if no event base can be created with the requested \hyperlink{structevent__config}{event\+\_\+config}. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a4c16f1203aebc67f94791ae0240b7353}{event\+\_\+base\+\_\+new()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a6e9827de8c3014417b11b48f2fe688ae}{event\+\_\+base\+\_\+free()}, \hyperlink{event__compat_8h_a1bf74386dd3725e1538fed2d70c1c113}{event\+\_\+init()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign()} 
\end{DoxySeeAlso}


References event\+\_\+base\+::changelist, event\+\_\+base\+::current\+\_\+event\+\_\+cond, event\+\_\+base\+::defer\+\_\+queue, event\+\_\+base\+::evbase, E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+I\+G\+N\+O\+R\+E\+\_\+\+E\+N\+V, E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+N\+O\+L\+O\+C\+K, E\+V\+E\+N\+T\+\_\+\+B\+A\+S\+E\+\_\+\+F\+L\+A\+G\+\_\+\+S\+T\+A\+R\+T\+U\+P\+\_\+\+I\+O\+C\+P, event\+\_\+base\+\_\+free(), event\+\_\+base\+\_\+priority\+\_\+init(), event\+\_\+base\+::event\+\_\+tv, event\+\_\+base\+::eventqueue, evmap\+\_\+io\+\_\+initmap(), event\+\_\+base\+::evsel, E\+V\+T\+H\+R\+E\+A\+D\+\_\+\+L\+O\+C\+K\+T\+Y\+P\+E\+\_\+\+R\+E\+C\+U\+R\+S\+I\+V\+E, evthread\+\_\+make\+\_\+base\+\_\+notifiable(), event\+\_\+base\+::flags, eventop\+::init, event\+\_\+base\+::io, deferred\+\_\+cb\+\_\+queue\+::lock, eventop\+::name, deferred\+\_\+cb\+\_\+queue\+::notify\+\_\+fn, event\+\_\+base\+::sig, event\+\_\+base\+::sigmap, event\+\_\+base\+::th\+\_\+base\+\_\+lock, event\+\_\+base\+::th\+\_\+notify\+\_\+fd, and event\+\_\+base\+::timeheap.



Referenced by event\+\_\+base\+\_\+new(), and event\+\_\+init().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_acddee16b430c037ae061f966dc18eb9d}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+once@{event\+\_\+base\+\_\+once}}
\index{event\+\_\+base\+\_\+once@{event\+\_\+base\+\_\+once}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+once}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+once (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{, }
\item[{{\bf evutil\+\_\+socket\+\_\+t}}]{, }
\item[{short}]{, }
\item[{{\bf event\+\_\+callback\+\_\+fn}}]{, }
\item[{void $\ast$}]{, }
\item[{const struct timeval $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_acddee16b430c037ae061f966dc18eb9d}


Schedule a one-\/time event. 

The function \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_acddee16b430c037ae061f966dc18eb9d}{event\+\_\+base\+\_\+once()} is similar to \hyperlink{event__compat_8h_ace184d66066e9bac013779d8f6921d11}{event\+\_\+set()}. However, it schedules a callback to be called exactly once, and does not require the caller to prepare an event structure.

Note that in Libevent 2.\+0 and earlier, if the event is never triggered, the internal memory used to hold it will never be freed. This may be fixed in a later version of Libevent.


\begin{DoxyParams}{Parameters}
{\em base} & an \hyperlink{structevent__base}{event\+\_\+base} \\
\hline
{\em fd} & a file descriptor to monitor, or -\/1 for no fd. \\
\hline
{\em events} & \hyperlink{structevent}{event(s)} to monitor; can be any of E\+V\+\_\+\+R\+E\+A\+D $\vert$ E\+V\+\_\+\+W\+R\+I\+T\+E, or E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T \\
\hline
{\em callback} & callback function to be invoked when the event occurs \\
\hline
{\em arg} & an argument to be passed to the callback function \\
\hline
{\em timeout} & the maximum amount of time to wait for the event. N\+U\+L\+L makes an E\+V\+\_\+\+R\+E\+A\+D/\+E\+V\+\_\+\+W\+R\+I\+T\+E event make forever; N\+U\+L\+L makes an E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T event succees immediately. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, or -\/1 if an error occurred 
\end{DoxyReturn}


References E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T, E\+V\+\_\+\+R\+E\+A\+D, E\+V\+\_\+\+S\+I\+G\+N\+A\+L, E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T, E\+V\+\_\+\+W\+R\+I\+T\+E, event\+\_\+add(), and event\+\_\+assign().



Referenced by event\+\_\+base\+\_\+loopexit(), and event\+\_\+once().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a67067fe995561cd36a7f34ef19e030e8}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+priority\+\_\+init@{event\+\_\+base\+\_\+priority\+\_\+init}}
\index{event\+\_\+base\+\_\+priority\+\_\+init@{event\+\_\+base\+\_\+priority\+\_\+init}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+priority\+\_\+init}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+priority\+\_\+init (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{, }
\item[{int}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a67067fe995561cd36a7f34ef19e030e8}


Set the number of different event priorities. 

By default Libevent schedules all active events with the same priority. However, some time it is desirable to process some events with a higher priority than others. For that reason, Libevent supports strict priority queues. Active events with a lower priority are always processed before events with a higher priority.

The number of different priorities can be set initially with the \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a67067fe995561cd36a7f34ef19e030e8}{event\+\_\+base\+\_\+priority\+\_\+init()} function. This function should be called before the first call to \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a01e457364ed5216a8c7bc219033b946f}{event\+\_\+base\+\_\+dispatch()}. The \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a9984a63f2edcc72bef96a188f569b367}{event\+\_\+priority\+\_\+set()} function can be used to assign a priority to an event. By default, Libevent assigns the middle priority to all events unless their priority is explicitly set.

Note that urgent-\/priority events can starve less-\/urgent events\+: after running all urgent-\/priority callbacks, Libevent checks for more urgent events again, before running less-\/urgent events. Less-\/urgent events will not have their callbacks run until there are no events more urgent than them that want to be active.


\begin{DoxyParams}{Parameters}
{\em eb} & the \hyperlink{structevent__base}{event\+\_\+base} structure returned by \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a4c16f1203aebc67f94791ae0240b7353}{event\+\_\+base\+\_\+new()} \\
\hline
{\em npriorities} & the maximum number of priorities \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, or -\/1 if an error occurred 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a9984a63f2edcc72bef96a188f569b367}{event\+\_\+priority\+\_\+set()} 
\end{DoxySeeAlso}


References event\+\_\+base\+::activequeues, E\+V\+E\+N\+T\+\_\+\+M\+A\+X\+\_\+\+P\+R\+I\+O\+R\+I\+T\+I\+E\+S, and event\+\_\+base\+::nactivequeues.



Referenced by event\+\_\+base\+\_\+new\+\_\+with\+\_\+config(), and event\+\_\+priority\+\_\+init().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a2efd0ac7e54428d1941f212bc16ed9ce}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+base\+\_\+set@{event\+\_\+base\+\_\+set}}
\index{event\+\_\+base\+\_\+set@{event\+\_\+base\+\_\+set}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+base\+\_\+set}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+base\+\_\+set (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{, }
\item[{struct {\bf event} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a2efd0ac7e54428d1941f212bc16ed9ce}


Associate a different event base with an event. 

The event to be associated must not be currently active or pending.


\begin{DoxyParams}{Parameters}
{\em eb} & the event base \\
\hline
{\em ev} & the event \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on failure. 
\end{DoxyReturn}


References event\+\_\+base\+::nactivequeues.



Referenced by bufferevent\+\_\+base\+\_\+set().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a961de3fb39a12ff67ff030bb3caacba2}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+config\+\_\+avoid\+\_\+method@{event\+\_\+config\+\_\+avoid\+\_\+method}}
\index{event\+\_\+config\+\_\+avoid\+\_\+method@{event\+\_\+config\+\_\+avoid\+\_\+method}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+config\+\_\+avoid\+\_\+method}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+config\+\_\+avoid\+\_\+method (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+config} $\ast$}]{cfg, }
\item[{const char $\ast$}]{method}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a961de3fb39a12ff67ff030bb3caacba2}


Enters an event method that should be avoided into the configuration. 

This can be used to avoid event mechanisms that do not support certain file descriptor types, or for debugging to avoid certain event mechanisms. An application can make use of multiple event bases to accommodate incompatible file descriptor types.


\begin{DoxyParams}{Parameters}
{\em cfg} & the event configuration object \\
\hline
{\em method} & the name of the event method to avoid \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on failure. 
\end{DoxyReturn}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a605f44836f97bb031776a7f70d53d719}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+config\+\_\+free@{event\+\_\+config\+\_\+free}}
\index{event\+\_\+config\+\_\+free@{event\+\_\+config\+\_\+free}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+config\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+config\+\_\+free (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+config} $\ast$}]{cfg}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a605f44836f97bb031776a7f70d53d719}


Deallocates all memory associated with an event configuration object. 


\begin{DoxyParams}{Parameters}
{\em cfg} & the event configuration object to be freed. \\
\hline
\end{DoxyParams}


Referenced by event\+\_\+base\+\_\+new().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a92e238d51357e3dae6fcdd0b9e83b2d2}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+config\+\_\+new@{event\+\_\+config\+\_\+new}}
\index{event\+\_\+config\+\_\+new@{event\+\_\+config\+\_\+new}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+config\+\_\+new}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf event\+\_\+config}$\ast$ event\+\_\+config\+\_\+new (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a92e238d51357e3dae6fcdd0b9e83b2d2}


Allocates a new event configuration object. 

The event configuration object can be used to change the behavior of an event base.

\begin{DoxyReturn}{Returns}
an \hyperlink{structevent__config}{event\+\_\+config} object that can be used to store configuration, or N\+U\+L\+L if an error is encountered. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a605f44836f97bb031776a7f70d53d719}{event\+\_\+config\+\_\+free()}, \hyperlink{structevent__config}{event\+\_\+config} 
\end{DoxySeeAlso}


Referenced by event\+\_\+base\+\_\+new().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a2b08f2633e76290117e4a03621940948}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+config\+\_\+require\+\_\+features@{event\+\_\+config\+\_\+require\+\_\+features}}
\index{event\+\_\+config\+\_\+require\+\_\+features@{event\+\_\+config\+\_\+require\+\_\+features}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+config\+\_\+require\+\_\+features}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+config\+\_\+require\+\_\+features (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+config} $\ast$}]{cfg, }
\item[{int}]{feature}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a2b08f2633e76290117e4a03621940948}


Enters a required event method feature that the application demands. 

Note that not every feature or combination of features is supported on every platform. Code that requests features should be prepared to handle the case where \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config()} returns N\+U\+L\+L, as in\+: 
\begin{DoxyPre}
  event\_config\_require\_features(cfg, EV\_FEATURE\_ET);
  base = event\_base\_new\_with\_config(cfg);
  if (base == NULL) \{
    // We can't get edge-triggered behavior here.
    event\_config\_require\_features(cfg, 0);
    base = event\_base\_new\_with\_config(cfg);
  \}
\end{DoxyPre}



\begin{DoxyParams}{Parameters}
{\em cfg} & the event configuration object \\
\hline
{\em feature} & a bitfield of one or more event\+\_\+method\+\_\+feature values. Replaces values from previous calls to this function. \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on failure. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ae7da61aef13e27a3047151b696b44c80}{event\+\_\+method\+\_\+feature}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config()} 
\end{DoxySeeAlso}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ac4b2697c7927fcd2167a1749f6602f29}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+config\+\_\+set\+\_\+flag@{event\+\_\+config\+\_\+set\+\_\+flag}}
\index{event\+\_\+config\+\_\+set\+\_\+flag@{event\+\_\+config\+\_\+set\+\_\+flag}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+config\+\_\+set\+\_\+flag}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+config\+\_\+set\+\_\+flag (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+config} $\ast$}]{cfg, }
\item[{int}]{flag}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ac4b2697c7927fcd2167a1749f6602f29}


Sets one or more flags to configure what parts of the eventual \hyperlink{structevent__base}{event\+\_\+base} will be initialized, and how they'll work. 

\begin{DoxySeeAlso}{See also}
event\+\_\+base\+\_\+config\+\_\+flags, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a444afb106c45ba296d847417a3a1ef04}{event\+\_\+base\+\_\+new\+\_\+with\+\_\+config()} 
\end{DoxySeeAlso}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_aa12ff91d766988a170cab43c53f66143}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+config\+\_\+set\+\_\+num\+\_\+cpus\+\_\+hint@{event\+\_\+config\+\_\+set\+\_\+num\+\_\+cpus\+\_\+hint}}
\index{event\+\_\+config\+\_\+set\+\_\+num\+\_\+cpus\+\_\+hint@{event\+\_\+config\+\_\+set\+\_\+num\+\_\+cpus\+\_\+hint}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+config\+\_\+set\+\_\+num\+\_\+cpus\+\_\+hint}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+config\+\_\+set\+\_\+num\+\_\+cpus\+\_\+hint (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+config} $\ast$}]{cfg, }
\item[{int}]{cpus}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_aa12ff91d766988a170cab43c53f66143}


Records a hint for the number of C\+P\+Us in the system. 

This is used for tuning thread pools, etc, for optimal performance. In Libevent 2.\+0, it is only on Windows, and only when I\+O\+C\+P is in use.


\begin{DoxyParams}{Parameters}
{\em cfg} & the event configuration object \\
\hline
{\em cpus} & the number of cpus \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 on success, -\/1 on failure. 
\end{DoxyReturn}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_afcc47ab5cc9128202cbe5012c4214a6b}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+debug\+\_\+unassign@{event\+\_\+debug\+\_\+unassign}}
\index{event\+\_\+debug\+\_\+unassign@{event\+\_\+debug\+\_\+unassign}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+debug\+\_\+unassign}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+debug\+\_\+unassign (
\begin{DoxyParamCaption}
\item[{struct {\bf event} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_afcc47ab5cc9128202cbe5012c4214a6b}


When debugging mode is enabled, informs Libevent that an event should no longer be considered as assigned. 

When debugging mode is not enabled, does nothing.

This function must only be called on a non-\/added event.

\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3472400b8b1802550df2242673a6da37}{event\+\_\+enable\+\_\+debug\+\_\+mode()} 
\end{DoxySeeAlso}


Referenced by event\+\_\+base\+\_\+free(), event\+\_\+reinit(), and evhttp\+\_\+connection\+\_\+free().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+del@{event\+\_\+del}}
\index{event\+\_\+del@{event\+\_\+del}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+del}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+del (
\begin{DoxyParamCaption}
\item[{struct {\bf event} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}


Remove an event from the set of monitored events. 

The function \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del()} will cancel the event in the argument ev. If the event has already executed or has never been added the call will have no effect.


\begin{DoxyParams}{Parameters}
{\em ev} & an event struct to be removed from the working set \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, or -\/1 if an error occurred 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()} 
\end{DoxySeeAlso}


Referenced by bufferevent\+\_\+rate\+\_\+limit\+\_\+group\+\_\+free(), bufferevent\+\_\+set\+\_\+rate\+\_\+limit(), evdns\+\_\+base\+\_\+clear\+\_\+nameservers\+\_\+and\+\_\+suspend(), evdns\+\_\+server\+\_\+request\+\_\+respond(), event\+\_\+base\+\_\+free(), event\+\_\+free(), and evhttp\+\_\+connection\+\_\+free().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a3472400b8b1802550df2242673a6da37}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+enable\+\_\+debug\+\_\+mode@{event\+\_\+enable\+\_\+debug\+\_\+mode}}
\index{event\+\_\+enable\+\_\+debug\+\_\+mode@{event\+\_\+enable\+\_\+debug\+\_\+mode}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+enable\+\_\+debug\+\_\+mode}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+enable\+\_\+debug\+\_\+mode (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a3472400b8b1802550df2242673a6da37}


Enable some relatively expensive debugging checks in Libevent that would normally be turned off. 

Generally, these checks cause code that would otherwise crash mysteriously to fail earlier with an assertion failure. Note that this method M\+U\+S\+T be called before any events or event\+\_\+bases have been created.

Debug mode can currently catch the following errors\+: An event is re-\/assigned while it is added Any function is called on a non-\/assigned event

Note that debugging mode uses memory to track every event that has been initialized (via event\+\_\+assign, event\+\_\+set, or event\+\_\+new) but not yet released (via event\+\_\+free or event\+\_\+debug\+\_\+unassign). If you want to use debug mode, and you find yourself running out of memory, you will need to use event\+\_\+debug\+\_\+unassign to explicitly stop tracking events that are no longer considered set-\/up.

\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afcc47ab5cc9128202cbe5012c4214a6b}{event\+\_\+debug\+\_\+unassign()} 
\end{DoxySeeAlso}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ad7fd53b1263bf0fdccd959a6c5a659cc}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+free@{event\+\_\+free}}
\index{event\+\_\+free@{event\+\_\+free}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+free}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+free (
\begin{DoxyParamCaption}
\item[{struct {\bf event} $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ad7fd53b1263bf0fdccd959a6c5a659cc}


Deallocate a struct event $\ast$ returned by \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()}. 

If the event is pending or active, first make it non-\/pending and non-\/active. 

References event\+\_\+del().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a2103c3cbf6e3e173419ebf019e29c788}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+get\+\_\+assignment@{event\+\_\+get\+\_\+assignment}}
\index{event\+\_\+get\+\_\+assignment@{event\+\_\+get\+\_\+assignment}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+get\+\_\+assignment}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+get\+\_\+assignment (
\begin{DoxyParamCaption}
\item[{const struct {\bf event} $\ast$}]{event, }
\item[{struct {\bf event\+\_\+base} $\ast$$\ast$}]{base\+\_\+out, }
\item[{{\bf evutil\+\_\+socket\+\_\+t} $\ast$}]{fd\+\_\+out, }
\item[{short $\ast$}]{events\+\_\+out, }
\item[{{\bf event\+\_\+callback\+\_\+fn} $\ast$}]{callback\+\_\+out, }
\item[{void $\ast$$\ast$}]{arg\+\_\+out}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a2103c3cbf6e3e173419ebf019e29c788}


Extract {\itshape all} of arguments given to construct a given event. 

The \hyperlink{structevent__base}{event\+\_\+base} is copied into $\ast$base\+\_\+out, the fd is copied into $\ast$fd\+\_\+out, and so on.

If any of the \char`\"{}\+\_\+out\char`\"{} arguments is N\+U\+L\+L, it will be ignored. \hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a3881f7391324c05bd6f0c291e2682f03}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+get\+\_\+struct\+\_\+event\+\_\+size@{event\+\_\+get\+\_\+struct\+\_\+event\+\_\+size}}
\index{event\+\_\+get\+\_\+struct\+\_\+event\+\_\+size@{event\+\_\+get\+\_\+struct\+\_\+event\+\_\+size}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+get\+\_\+struct\+\_\+event\+\_\+size}]{\setlength{\rightskip}{0pt plus 5cm}size\+\_\+t event\+\_\+get\+\_\+struct\+\_\+event\+\_\+size (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a3881f7391324c05bd6f0c291e2682f03}


Return the size of struct event that the Libevent library was compiled with. 

This will be N\+O G\+R\+E\+A\+T\+E\+R than sizeof(struct event) if you're running with the same version of Libevent that your application was built with, but otherwise might not.

Note that it might be S\+M\+A\+L\+L\+E\+R than sizeof(struct event) if some future version of Libevent adds extra padding to the end of struct event. We might do this to help ensure A\+B\+I-\/compatibility between different versions of Libevent. \hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_af93a8115c6c8ff28db573cba84d1e488}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+get\+\_\+supported\+\_\+methods@{event\+\_\+get\+\_\+supported\+\_\+methods}}
\index{event\+\_\+get\+\_\+supported\+\_\+methods@{event\+\_\+get\+\_\+supported\+\_\+methods}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+get\+\_\+supported\+\_\+methods}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$$\ast$ event\+\_\+get\+\_\+supported\+\_\+methods (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_af93a8115c6c8ff28db573cba84d1e488}


Gets all event notification mechanisms supported by Libevent. 

This functions returns the event mechanism in order preferred by Libevent. Note that this list will include all backends that Libevent has compiled-\/in support for, and will not necessarily check your O\+S to see whether it has the required resources.

\begin{DoxyReturn}{Returns}
an array with pointers to the names of support methods. The end of the array is indicated by a N\+U\+L\+L pointer. If an error is encountered N\+U\+L\+L is returned. 
\end{DoxyReturn}


References eventop\+::name.

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a43d7feed94477cf0a7e3e062cc17b7e1}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+get\+\_\+version@{event\+\_\+get\+\_\+version}}
\index{event\+\_\+get\+\_\+version@{event\+\_\+get\+\_\+version}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+get\+\_\+version}]{\setlength{\rightskip}{0pt plus 5cm}const char$\ast$ event\+\_\+get\+\_\+version (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a43d7feed94477cf0a7e3e062cc17b7e1}


Get the Libevent version. 

Note that this will give you the version of the library that you're currently linked against, not the version of the headers that you've compiled against.

\begin{DoxyReturn}{Returns}
a string containing the version number of Libevent 
\end{DoxyReturn}
\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_abd4d1f2b4ca8e11f3bbf022244f01fa9}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+get\+\_\+version\+\_\+number@{event\+\_\+get\+\_\+version\+\_\+number}}
\index{event\+\_\+get\+\_\+version\+\_\+number@{event\+\_\+get\+\_\+version\+\_\+number}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+get\+\_\+version\+\_\+number}]{\setlength{\rightskip}{0pt plus 5cm}ev\+\_\+uint32\+\_\+t event\+\_\+get\+\_\+version\+\_\+number (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_abd4d1f2b4ca8e11f3bbf022244f01fa9}


Return a numeric representation of Libevent's version. 

Note that this will give you the version of the library that you're currently linked against, not the version of the headers you've used to compile.

The format uses one byte each for the major, minor, and patchlevel parts of the version number. The low-\/order byte is unused. For example, version 2.\+0.\+1-\/alpha has a numeric representation of 0x02000100 \hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a5be4fbc16d90915a7d1b21ed3bae40c0}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+initialized@{event\+\_\+initialized}}
\index{event\+\_\+initialized@{event\+\_\+initialized}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+initialized}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+initialized (
\begin{DoxyParamCaption}
\item[{const struct {\bf event} $\ast$}]{ev}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a5be4fbc16d90915a7d1b21ed3bae40c0}


Test if an event structure might be initialized. 

The \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a5be4fbc16d90915a7d1b21ed3bae40c0}{event\+\_\+initialized()} function can be used to check if an event has been initialized.

Warning\+: This function is only useful for distinguishing a a zeroed-\/out piece of memory from an initialized event, it can easily be confused by uninitialized memory. Thus, it should O\+N\+L\+Y be used to distinguish an initialized event from zero.


\begin{DoxyParams}{Parameters}
{\em ev} & an event structure to be tested \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
1 if the structure might be initialized, or 0 if it has not been initialized 
\end{DoxyReturn}


Referenced by bufferevent\+\_\+set\+\_\+rate\+\_\+limit(), and evhttp\+\_\+connection\+\_\+free().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+new@{event\+\_\+new}}
\index{event\+\_\+new@{event\+\_\+new}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+new}]{\setlength{\rightskip}{0pt plus 5cm}struct {\bf event}$\ast$ event\+\_\+new (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{, }
\item[{{\bf evutil\+\_\+socket\+\_\+t}}]{, }
\item[{short}]{, }
\item[{{\bf event\+\_\+callback\+\_\+fn}}]{, }
\item[{void $\ast$}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}


Allocate and asssign a new event structure, ready to be added. 

The function \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ab9a66f828d205eda84b321e32014cbbd}{event\+\_\+new()} returns a new event that can be used in future calls to \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()} and \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del()}. The fd and events arguments determine which conditions will trigger the event; the callback and callback\+\_\+arg arguments tell Libevent what to do when the event becomes active.

If events contains one of E\+V\+\_\+\+R\+E\+A\+D, E\+V\+\_\+\+W\+R\+I\+T\+E, or E\+V\+\_\+\+R\+E\+A\+D$\vert$\+E\+V\+\_\+\+W\+R\+I\+T\+E, then fd is a file descriptor or socket that should get monitored for readiness to read, readiness to write, or readiness for either operation (respectively). If events contains E\+V\+\_\+\+S\+I\+G\+N\+A\+L, then fd is a signal number to wait for. If events contains none of those flags, then the event can be triggered only by a timeout or by manual activation with \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a3262ae1dc7fe51516b43412d61301e4f}{event\+\_\+active()}\+: In this case, fd must be -\/1.

The E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T flag can also be passed in the events argument\+: it makes \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()} persistent until \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del()} is called.

The E\+V\+\_\+\+E\+T flag is compatible with E\+V\+\_\+\+R\+E\+A\+D and E\+V\+\_\+\+W\+R\+I\+T\+E, and supported only by certain backends. It tells Libevent to use edge-\/triggered events.

The E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T flag has no effect here.

It is okay to have multiple events all listening on the same fds; but they must either all be edge-\/triggered, or all not be edge triggerd.

When the event becomes active, the event loop will run the provided callbuck function, with three arguments. The first will be the provided fd value. The second will be a bitfield of the events that triggered\+: E\+V\+\_\+\+R\+E\+A\+D, E\+V\+\_\+\+W\+R\+I\+T\+E, or E\+V\+\_\+\+S\+I\+G\+N\+A\+L. Here the E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T flag indicates that a timeout occurred, and E\+V\+\_\+\+E\+T indicates that an edge-\/triggered event occurred. The third event will be the callback\+\_\+arg pointer that you provide.


\begin{DoxyParams}{Parameters}
{\em base} & the event base to which the event should be attached. \\
\hline
{\em fd} & the file descriptor or signal to be monitored, or -\/1. \\
\hline
{\em events} & desired events to monitor\+: bitfield of E\+V\+\_\+\+R\+E\+A\+D, E\+V\+\_\+\+W\+R\+I\+T\+E, E\+V\+\_\+\+S\+I\+G\+N\+A\+L, E\+V\+\_\+\+P\+E\+R\+S\+I\+S\+T, E\+V\+\_\+\+E\+T. \\
\hline
{\em callback} & callback function to be invoked when the event occurs \\
\hline
{\em callback\+\_\+arg} & an argument to be passed to the callback function\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
a newly allocated struct event that must later be freed with \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad7fd53b1263bf0fdccd959a6c5a659cc}{event\+\_\+free()}. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_ad7fd53b1263bf0fdccd959a6c5a659cc}{event\+\_\+free()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a30a8cb96af49d18388f64de73a2d4258}{event\+\_\+del()}, \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_afade5e4859dee5b85d502e5594a05cf0}{event\+\_\+assign()} 
\end{DoxySeeAlso}


References event\+\_\+assign().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a49773a4e3e46f60e488ac37fb46950d9}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+pending@{event\+\_\+pending}}
\index{event\+\_\+pending@{event\+\_\+pending}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+pending}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+pending (
\begin{DoxyParamCaption}
\item[{const struct {\bf event} $\ast$}]{ev, }
\item[{short}]{events, }
\item[{struct timeval $\ast$}]{tv}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a49773a4e3e46f60e488ac37fb46950d9}


Checks if a specific event is pending or scheduled. 


\begin{DoxyParams}{Parameters}
{\em ev} & an event struct previously passed to \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a44df7b40859b56f2c866adb02dabdd9e}{event\+\_\+add()} \\
\hline
{\em events} & the requested event type; any of E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T$\vert$\+E\+V\+\_\+\+R\+E\+A\+D$\vert$ E\+V\+\_\+\+W\+R\+I\+T\+E$\vert$\+E\+V\+\_\+\+S\+I\+G\+N\+A\+L \\
\hline
{\em tv} & if this field is not N\+U\+L\+L, and the event has a timeout, this field is set to hold the time at which the timeout will expire.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
true if the event is pending on any of the events in 'what', (that is to say, it has been added), or 0 if the event is not added. 
\end{DoxyReturn}


References E\+V\+\_\+\+R\+E\+A\+D, E\+V\+\_\+\+S\+I\+G\+N\+A\+L, E\+V\+\_\+\+T\+I\+M\+E\+O\+U\+T, and E\+V\+\_\+\+W\+R\+I\+T\+E.

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a9984a63f2edcc72bef96a188f569b367}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+priority\+\_\+set@{event\+\_\+priority\+\_\+set}}
\index{event\+\_\+priority\+\_\+set@{event\+\_\+priority\+\_\+set}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+priority\+\_\+set}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+priority\+\_\+set (
\begin{DoxyParamCaption}
\item[{struct {\bf event} $\ast$}]{, }
\item[{int}]{}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a9984a63f2edcc72bef96a188f569b367}


Assign a priority to an event. 


\begin{DoxyParams}{Parameters}
{\em ev} & an event struct \\
\hline
{\em priority} & the new priority to be assigned \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, or -\/1 if an error occurred 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{event__compat_8h_ac98d83bce2fe3e97ac655329fb30fccb}{event\+\_\+priority\+\_\+init()} 
\end{DoxySeeAlso}


References event\+\_\+base\+::nactivequeues.



Referenced by bufferevent\+\_\+priority\+\_\+set(), event\+\_\+base\+\_\+init\+\_\+common\+\_\+timeout(), and evthread\+\_\+make\+\_\+base\+\_\+notifiable().

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a7409499a79a59842955928af446fe03d}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+reinit@{event\+\_\+reinit}}
\index{event\+\_\+reinit@{event\+\_\+reinit}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+reinit}]{\setlength{\rightskip}{0pt plus 5cm}int event\+\_\+reinit (
\begin{DoxyParamCaption}
\item[{struct {\bf event\+\_\+base} $\ast$}]{base}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a7409499a79a59842955928af446fe03d}


Reinitialize the event base after a fork. 

Some event mechanisms do not survive across fork. The event base needs to be reinitialized with the \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a7409499a79a59842955928af446fe03d}{event\+\_\+reinit()} function.


\begin{DoxyParams}{Parameters}
{\em base} & the event base that needs to be re-\/initialized \\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
0 if successful, or -\/1 if some events could not be re-\/added. 
\end{DoxyReturn}
\begin{DoxySeeAlso}{See also}
\hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a4c16f1203aebc67f94791ae0240b7353}{event\+\_\+base\+\_\+new()} 
\end{DoxySeeAlso}


References event\+\_\+base\+::changelist, eventop\+::dealloc, E\+V\+\_\+\+R\+E\+A\+D, E\+V\+\_\+\+S\+I\+G\+N\+A\+L, E\+V\+\_\+\+W\+R\+I\+T\+E, event\+\_\+base\+::evbase, event\+\_\+debug\+\_\+unassign(), event\+\_\+base\+::eventqueue, evmap\+\_\+io\+\_\+add(), evmap\+\_\+io\+\_\+clear(), event\+\_\+base\+::evsel, evthread\+\_\+make\+\_\+base\+\_\+notifiable(), eventop\+::init, event\+\_\+base\+::io, eventop\+::need\+\_\+reinit, event\+\_\+base\+::sig, event\+\_\+base\+::sigmap, event\+\_\+base\+::th\+\_\+notify, and event\+\_\+base\+::th\+\_\+notify\+\_\+fd.

\hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a73beabc6626db0da679eb8961ce3f477}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+set\+\_\+fatal\+\_\+callback@{event\+\_\+set\+\_\+fatal\+\_\+callback}}
\index{event\+\_\+set\+\_\+fatal\+\_\+callback@{event\+\_\+set\+\_\+fatal\+\_\+callback}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+set\+\_\+fatal\+\_\+callback}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+set\+\_\+fatal\+\_\+callback (
\begin{DoxyParamCaption}
\item[{{\bf event\+\_\+fatal\+\_\+cb}}]{cb}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a73beabc6626db0da679eb8961ce3f477}


Override Libevent's behavior in the event of a fatal internal error. 

By default, Libevent will call exit(1) if a programming error makes it impossible to continue correct operation. This function allows you to supply another callback instead. Note that if the function is ever invoked, something is wrong with your program, or with Libevent\+: any subsequent calls to Libevent may result in undefined behavior.

Libevent will (almost) always log an \+\_\+\+E\+V\+E\+N\+T\+\_\+\+L\+O\+G\+\_\+\+E\+R\+R message before calling this function; look at the last log message to see why Libevent has died. \hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a87e59ed1dd711ced2b2a1314d3e3c1c7}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+set\+\_\+log\+\_\+callback@{event\+\_\+set\+\_\+log\+\_\+callback}}
\index{event\+\_\+set\+\_\+log\+\_\+callback@{event\+\_\+set\+\_\+log\+\_\+callback}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+set\+\_\+log\+\_\+callback}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+set\+\_\+log\+\_\+callback (
\begin{DoxyParamCaption}
\item[{{\bf event\+\_\+log\+\_\+cb}}]{cb}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a87e59ed1dd711ced2b2a1314d3e3c1c7}


Redirect Libevent's log messages. 


\begin{DoxyParams}{Parameters}
{\em cb} & a function taking two arguments\+: an integer severity between \+\_\+\+E\+V\+E\+N\+T\+\_\+\+L\+O\+G\+\_\+\+D\+E\+B\+U\+G and \+\_\+\+E\+V\+E\+N\+T\+\_\+\+L\+O\+G\+\_\+\+E\+R\+R, and a string. If cb is N\+U\+L\+L, then the default log is used.\\
\hline
\end{DoxyParams}
N\+O\+T\+E\+: The function you provide {\itshape must not} call any other libevent functionality. Doing so can produce undefined behavior. \hypertarget{libevent2013_2libevent_2include_2event2_2event_8h_a653e38c4bdd2f3b2d7476fcee95c1a62}{\index{libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}!event\+\_\+set\+\_\+mem\+\_\+functions@{event\+\_\+set\+\_\+mem\+\_\+functions}}
\index{event\+\_\+set\+\_\+mem\+\_\+functions@{event\+\_\+set\+\_\+mem\+\_\+functions}!libevent2013/libevent/include/event2/event.\+h@{libevent2013/libevent/include/event2/event.\+h}}
\subsubsection[{event\+\_\+set\+\_\+mem\+\_\+functions}]{\setlength{\rightskip}{0pt plus 5cm}void event\+\_\+set\+\_\+mem\+\_\+functions (
\begin{DoxyParamCaption}
\item[{void $\ast$($\ast$)(size\+\_\+t sz)}]{malloc\+\_\+fn, }
\item[{void $\ast$($\ast$)(void $\ast$ptr, size\+\_\+t sz)}]{realloc\+\_\+fn, }
\item[{void($\ast$)(void $\ast$ptr)}]{free\+\_\+fn}
\end{DoxyParamCaption}
)}}\label{libevent2013_2libevent_2include_2event2_2event_8h_a653e38c4bdd2f3b2d7476fcee95c1a62}


Override the functions that Libevent uses for memory management. 

Usually, Libevent uses the standard libc functions malloc, realloc, and free to allocate memory. Passing replacements for those functions to \hyperlink{libevent2013_2libevent_2include_2event2_2event_8h_a653e38c4bdd2f3b2d7476fcee95c1a62}{event\+\_\+set\+\_\+mem\+\_\+functions()} overrides this behavior.

Note that all memory returned from Libevent will be allocated by the replacement functions rather than by malloc() and realloc(). Thus, if you have replaced those functions, it will not be appropriate to free() memory that you get from Libevent. Instead, you must use the free\+\_\+fn replacement that you provided.

Note also that if you are going to call this function, you should do so before any call to any Libevent function that does allocation. Otherwise, those funtions will allocate their memory using malloc(), but then later free it using your provided free\+\_\+fn.


\begin{DoxyParams}{Parameters}
{\em malloc\+\_\+fn} & A replacement for malloc. \\
\hline
{\em realloc\+\_\+fn} & A replacement for realloc \\
\hline
{\em free\+\_\+fn} & A replacement for free. \\
\hline
\end{DoxyParams}
