1 --- libevent-1.4.14b-stable/event.3 po lis 21 06:43:10 2011
2 +++ libevent-1.4.14b-stable/event.3 po lis 21 09:31:12 2011
4 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
5 .\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
15 -.Nm event_loopbreak ,
17 -.Nm event_base_dispatch ,
18 -.Nm event_base_loop ,
19 -.Nm event_base_loopexit ,
20 -.Nm event_base_loopbreak ,
22 -.Nm event_base_free ,
26 -.Nm event_base_once ,
28 -.Nm event_initialized ,
29 -.Nm event_priority_init ,
30 -.Nm event_priority_set ,
34 -.Nm evtimer_pending ,
35 -.Nm evtimer_initialized ,
40 -.Nm signal_initialized ,
41 -.Nm bufferevent_new ,
42 -.Nm bufferevent_free ,
43 -.Nm bufferevent_write ,
44 -.Nm bufferevent_write_buffer ,
45 -.Nm bufferevent_read ,
46 -.Nm bufferevent_enable ,
47 -.Nm bufferevent_disable ,
48 -.Nm bufferevent_settimeout ,
49 -.Nm bufferevent_base_set ,
53 -.Nm evbuffer_add_buffer ,
54 -.Nm evbuffer_add_printf ,
55 -.Nm evbuffer_add_vprintf ,
60 -.Nm evbuffer_readline ,
62 -.Nm evhttp_bind_socket ,
64 -.Nd execute a function when a specific event occurs
66 -.Fd #include <sys/time.h>
67 -.Fd #include <event.h>
68 -.Ft "struct event_base *"
69 -.Fn "event_init" "void"
71 -.Fn "event_dispatch" "void"
73 -.Fn "event_loop" "int flags"
75 -.Fn "event_loopexit" "struct timeval *tv"
77 -.Fn "event_loopbreak" "void"
79 -.Fn "event_set" "struct event *ev" "int fd" "short event" "void (*fn)(int, short, void *)" "void *arg"
81 -.Fn "event_base_dispatch" "struct event_base *base"
83 -.Fn "event_base_loop" "struct event_base *base" "int flags"
85 -.Fn "event_base_loopexit" "struct event_base *base" "struct timeval *tv"
87 -.Fn "event_base_loopbreak" "struct event_base *base"
89 -.Fn "event_base_set" "struct event_base *base" "struct event *"
91 -.Fn "event_base_free" "struct event_base *base"
93 -.Fn "event_add" "struct event *ev" "struct timeval *tv"
95 -.Fn "event_del" "struct event *ev"
97 -.Fn "event_once" "int fd" "short event" "void (*fn)(int, short, void *)" "void *arg" "struct timeval *tv"
99 -.Fn "event_base_once" "struct event_base *base" "int fd" "short event" "void (*fn)(int, short, void *)" "void *arg" "struct timeval *tv"
101 -.Fn "event_pending" "struct event *ev" "short event" "struct timeval *tv"
103 -.Fn "event_initialized" "struct event *ev"
105 -.Fn "event_priority_init" "int npriorities"
107 -.Fn "event_priority_set" "struct event *ev" "int priority"
109 -.Fn "evtimer_set" "struct event *ev" "void (*fn)(int, short, void *)" "void *arg"
111 -.Fn "evtimer_add" "struct event *ev" "struct timeval *"
113 -.Fn "evtimer_del" "struct event *ev"
115 -.Fn "evtimer_pending" "struct event *ev" "struct timeval *tv"
117 -.Fn "evtimer_initialized" "struct event *ev"
119 -.Fn "signal_set" "struct event *ev" "int signal" "void (*fn)(int, short, void *)" "void *arg"
121 -.Fn "signal_add" "struct event *ev" "struct timeval *"
123 -.Fn "signal_del" "struct event *ev"
125 -.Fn "signal_pending" "struct event *ev" "struct timeval *tv"
127 -.Fn "signal_initialized" "struct event *ev"
128 -.Ft "struct bufferevent *"
129 -.Fn "bufferevent_new" "int fd" "evbuffercb readcb" "evbuffercb writecb" "everrorcb" "void *cbarg"
131 -.Fn "bufferevent_free" "struct bufferevent *bufev"
133 -.Fn "bufferevent_write" "struct bufferevent *bufev" "void *data" "size_t size"
135 -.Fn "bufferevent_write_buffer" "struct bufferevent *bufev" "struct evbuffer *buf"
137 -.Fn "bufferevent_read" "struct bufferevent *bufev" "void *data" "size_t size"
139 -.Fn "bufferevent_enable" "struct bufferevent *bufev" "short event"
141 -.Fn "bufferevent_disable" "struct bufferevent *bufev" "short event"
143 -.Fn "bufferevent_settimeout" "struct bufferevent *bufev" "int timeout_read" "int timeout_write"
145 -.Fn "bufferevent_base_set" "struct event_base *base" "struct bufferevent *bufev"
146 -.Ft "struct evbuffer *"
147 -.Fn "evbuffer_new" "void"
149 -.Fn "evbuffer_free" "struct evbuffer *buf"
151 -.Fn "evbuffer_add" "struct evbuffer *buf" "const void *data" "size_t size"
153 -.Fn "evbuffer_add_buffer" "struct evbuffer *dst" "struct evbuffer *src"
155 -.Fn "evbuffer_add_printf" "struct evbuffer *buf" "const char *fmt" "..."
157 -.Fn "evbuffer_add_vprintf" "struct evbuffer *buf" "const char *fmt" "va_list ap"
159 -.Fn "evbuffer_drain" "struct evbuffer *buf" "size_t size"
161 -.Fn "evbuffer_write" "struct evbuffer *buf" "int fd"
163 -.Fn "evbuffer_read" "struct evbuffer *buf" "int fd" "int size"
165 -.Fn "evbuffer_find" "struct evbuffer *buf" "const u_char *data" "size_t size"
167 -.Fn "evbuffer_readline" "struct evbuffer *buf"
168 -.Ft "struct evhttp *"
169 -.Fn "evhttp_new" "struct event_base *base"
171 -.Fn "evhttp_bind_socket" "struct evhttp *http" "const char *address" "u_short port"
173 -.Fn "evhttp_free" "struct evhttp *http"
175 -.Fa (*event_sigcb)(void) ;
176 -.Ft volatile sig_atomic_t
179 +.TH EVENT 3 "21 November 2011" "libevent 1.4.14b" "libevent Manual"
187 +event_base_dispatch,
189 +event_base_loopexit,
190 +event_base_loopbreak,
199 +event_priority_init,
205 +evtimer_initialized,
214 +bufferevent_write_buffer,
217 +bufferevent_disable,
218 +bufferevent_settimeout,
219 +bufferevent_base_set,
223 +evbuffer_add_buffer,
224 +evbuffer_add_printf,
225 +evbuffer_add_vprintf,
234 +\- execute a function when a specific event occurs
236 +The libevent library (libevent, -levent)
241 +\fB#include <sys/time.h>\fP
242 +\fB#include <event.h>\fP
244 +\fBstruct event_base* \fBevent_init\fR\fR(\fBvoid\fP\fR);
246 +\fBint \fBevent_dispatch\fR\fR(\fBvoid\fP\fR);
248 +\fBint \fBevent_loop\fR\fR(\fBint \fIflags\fP\fR);
250 +\fBint \fBevent_loopexit\fR\fR(\fBstruct timeval* \fItv\fP\fR);
252 +\fBint \fBevent_loopbreak\fR\fR(\fBvoid\fP\fR);
254 +\fBvoid \fBevent_set\fR\fR(\fBstruct event* \fIev\fP\fR, \fBint \fIfd \fP\fR, \fBshort \fIevent\fP\fR, \fBvoid \fI(*fn)(\fBint, short, void *\fP\fR), \fBvoid* \fIarg\fP\fR);
256 +\fBint \fBevent_base_dispatch\fR\fR(\fBstruct event_base* \fIbase\fP\fR);
258 +\fBint \fBevent_base_loop\fR\fR(\fBstruct event_base* \fIbase\fP\fR, \fBint \fIflags\fP\fR);
260 +\fBint \fBevent_base_loopexit\fR\fR(\fBstruct event_base* \fIbase\fP\fR, \fBstruct timeval* \fItv\fP\fR);
262 +\fBint \fBevent_base_loopbreak\fR\fR(\fBstruct event_base* \fIbase\fP\fR);
264 +\fBint \fBevent_base_set\fR\fR(\fBstruct event_base* \fIbase\fP\fR, \fBstruct event* \fIev\fP\fR);
266 +\fBvoid \fBevent_base_free\fR\fR(\fBstruct event_base* \fIbase\fP\fR);
268 +\fBint \fBevent_add\fR\fR(\fBstruct event* \fIev\fP\fR, \fBstruct timeval* \fItv\fP\fR);
270 +.\fBint \fBevent_del\fR\fR(struct event* \fIev\fP\fR);
272 +\fBint \fBevent_once\fR\fR(\fBint \fIfd\fP\fR, \fBshort \fIevent\fP\fR, \fBvoid \fI(*fn)(\fBint, short, void*\fB\fR), \fBstruct timeval* \fItv\fP\fR);
274 +\fBint \fBevent_base_once\fR\fR(\fBstruct event_base* \fIbase\fP\fR, \fBint \fIfd\fB\fR, \fBshort \fIevent\fB\fR, \fBvoid \fI(*fn)(\fBint, short, void*\fB\fR), \fBvoid* \fIarg\fB\fR, \fBstruct timeval* \fItv\fP\fR);
276 +\fBint \fBevent_pending\fR\fR(\fBstruct event* \fIev\fP\fR, \fBshort \fIevent\fB\fR, \fBstruct timeval* \fItv\fP\fR);
278 +\fBint \fBevent_initialized\fR\fR(\fBstruct event* \fIev\fP\fR);
280 +\fBint \fBevent_priority_init\fR\fR (\fBint \fInpriorities\fP\fR);
282 +\fBint \fBevent_priority_set\fR\fR (\fBstruct event* \fIev\fP\fR, \fBint \fIpriority\fP\fR);
284 +\fBvoid \fBevtimer_set\fR\fR (\fBstruct event* \fIev\fP\fR, \fBvoid \fI(*fn)(\fBint, short, void*\fB\fR), \fBvoid* \fIarg\fP\fR);
286 +\fBvoid \fBevtimer_add\fR\fR (\fBstruct event* \fIev\fP\fR, \fBstruct timeval* \fItv\fP\fR);
288 +\fBvoid \fBevtimer_del\fR\fR (\fBstruct event* \fIev\fP\fR);
290 +\fBint \fBevtimer_pending\fR\fR (\fBstruct event* \fIev\fP\fR, \fBstruct timeval* \fItv\fP\fR);
292 +\fBint \fBevtimer_initialized\fR\fR(\fBstruct event* \fIev\fP\fR);
294 +\fBvoid \fBsignal_set\fR\fR (\fBstruct event* \fIev\fP\fR, \fBint \fIsignal\fP\fR, \fBvoid \fI(*fn)(\fBint, short, void*\fP\fR), \fBvoid* \fIarg\fP\fR);
296 +\fBvoid \fBsignal_add\fR\fR (\fBstruct event* \fIev\fP\fR, \fBstruct timeval* \fItv\fP\fR);
298 +\fBvoid \fBsignal_del\fR\fR (\fBstruct event* \fIev\fP\fR);
300 +\fBint \fBsignal_pending\fR\fR(\fBstruct event* \fIev\fP\fR, \fBstruct timeval* \fItv\fP\fR);
302 +\fBint \fBsignal_initialized\fR\fR(\fBstruct event* \fIev\fP\fR);
304 +\fBstruct bufferevent* \fBbufferevent_new\fR\fR(\fBint \fIfd\fP\fR, \fBevbuffercb \fIreadcb\fP\fR, \fBevbuffercb \fIwritecb\fP\fR, \fBeverrorcb \fIerrorcb\fP\fR, \fBvoid* \fIcbarg\fP\fR);
306 +\fBvoid \fBbufferevent_free\fR\fR(\fBstruct bufferevent* \fIbufev\fP\fR);
308 +\fBint \fBbufferevent_write\fR\fR(\fBstruct bufferevent* \fIbufev\fP\fR, \fBvoid* \fIdata\fP\fR, \fBsize_t \fIsize\fP\fR);
310 +\fBint \fBbufferevent_write_buffer\fR\fR(\fBstruct bufferevent* \fIbufev\fP\fR, \fBstruct evbuffer* \fIbuf\fP\fR);
312 +\fBsize_t \fBbufferevent_read\fR\fR(\fBstruct bufferevent* \fIbufev\fP\fR, \fBvoid* \fIdata\fP\fR, \fBsize_t \fIsize\fP\fR);
314 +\fBint \fBbufferevent_enable\fR\fR(\fBstruct bufferevent* \fIbufev\fP\fR, \fBshort \fIevent\fP\fR);
316 +\fBint \fBbufferevent_disable\fR\fR(\fBstruct bufferevent* \fIbufev\fP\fR, \fBshort \fIeven\fP\fR);
318 +\fBvoid \fBbufferevent_settimeout\fR\fR(\fBstruct bufferevent* \fIbufev\fP\fR, \fBint \fItimeout_read\fP\fR, \fBint \fItimeout_write\fP\fR);
320 +\fBint \fBbufferevent_base_set\fR\fR(\fBstruct event_base* \fIbase\fP\fR, \fBstruct bufferevent* \fIbufev\fP\fR);
322 +\fBstruct evbuffer* \fBevbuffer_new (\fBvoid\fP\fR);
324 +\fBvoid \fBevbuffer_free\fR\fR(\fBstruct evbuffer* \fIbuf\fP\fR);
326 +\fBint \fBevbuffer_add\fR\fR(\fBstruct evbuffer* \fIbuf\fP\fR, \fBconst void* \fIdata\fP\fR, \fBsize_t \fIsize\fP\fR);
328 +\fBint \fBevbuffer_add_buffer\fR\fR(\fBstruct evbuffer* \fIdst\fP\fR, \fBstruct evbuffer* \fIsrc\fP\fR);
330 +\fBint \fBevbuffer_add_printf\fR\fR(\fBstruct evbuffer* \fIbuf\fP\fR, \fBconst char* \fIfmt\fP\fR, \fB...\fP\fR);
332 +\fBint \fBevbuffer_add_vprintf\fR\fR(\fBstruct evbuffer* \fIbuf\fP\fR, \fBconst char* \fIfmt\fP\fR, \fBva_list \fIap\fP\fR);
334 +\fBvoid \fBevbuffer_drain\fR\fR(\fBstruct evbuffer* \fIbuf\fP\fR, \fBsize_t \fIsize\fP\fR);
336 +\fBint \fBevbuffer_write\fR\fR(\fBstruct evbuffer* \fIbuf\fP\fR, \fBint \fIfd\fP\fR);
338 +\fBint \fBevbuffer_read\fR\fR(\fBstruct evbuffer* \fIbuf\fP\fR, \fBint \fIfd\fP\fR, \fBint \fIsize\fP\fR);
340 +\fBu_char* \fBevbuffer_find\fR\fR(\fBstruct evbuffer* \fIbuf\fP\fR, \fBconst u_char* \fIdata\fP\fR, \fBsize_t \fIsize\fP\fR);
342 +\fBchar* \fBevbuffer_readline\fR\fR(\fBstruct evbuffer* \fIbuf\fP\fR);
344 +\fBstruct evhttp * \fBevhttp_new\fR\fR(\fBstruct event_base* \fIbase\fP\fR);
346 +\fBint \fBevhttp_bind_socket\fR\fR(\fBstruct evhttp* \fIhttp\fP\fR, \fBconst char* \fIaddress\fP\fR, \fBu_short \fIport\fP\fR);
348 +\fBvoid \fBevhttp_free\fR\fR(\fBstruct evhttp* \fIhttp\fP\fR);
350 +\fBint \fI(*event_sigcb)\fP\fR\fI(\fBvoid\fP\fR);
352 +\fBvolatile sig_atomic_t \fR\fRevent_gotsig\fP\fR;
359 API provides a mechanism to execute a function when a specific event
360 on a file descriptor occurs or after a given time has passed.
366 API needs to be initialized with
369 before it can be used.
372 In order to process events, an application needs to call
373 -.Fn event_dispatch .
374 +\fBevent_dispatch\fP\fR.
375 This function only returns on error, and should replace the event core
376 of the application program.
382 prepares the event structure
385 to be used in future calls to
390 +\fBevent_del\fP\fR .
391 The event will be prepared to call the function specified by the
397 argument indicating the file descriptor, a
400 argument indicating the type of event, and a
403 argument given in the
410 indicates the file descriptor that should be monitored for events.
411 -The events can be either
415 +The events can be either EV_READ, EV_WRITE , or both,
416 indicating that an application can read or write from the file descriptor
417 respectively without blocking.
423 will be called with the file descriptor that triggered the event and
424 the type of event which will be either
434 Additionally, an event which has registered interest in more than one of the
435 preceeding events, via bitwise-OR to
438 can provide its callback function with a bitwise-OR of more than one triggered
452 Once initialized, the
455 structure can be used repeatedly with
461 and does not need to be reinitialized unless the function called and/or
462 the argument to it are to be changed.
466 structure has been added to libevent using
469 the structure must persist until the event occurs (assuming
472 is not set) or is removed
476 You may not reuse the same
479 structure for multiple monitored descriptors; each descriptor
488 schedules the execution of the
491 event when the event specified in
494 occurs or in at least the time specified in the
503 no timeout occurs and the function will only be called
504 if a matching event occurs on the file descriptor.
508 argument must be already initialized by
511 and may not be used in calls to
514 until it has timed out or been removed with
520 argument already has a scheduled timeout, the old timeout will be
521 replaced by the new one.
527 will cancel the event in the argument
530 If the event has already executed or has never been added
531 the call will have no effect.
538 -.Fn evtimer_initialized ,
539 +\fBevtimer_set\fP\fR,
540 +\fBevtimer_add\fP\fR,
541 +\fBevtimer_del\fP\fR,
542 +\fBevtimer_initialized\fP\fR,
545 +\fBevtimer_pending\fP\fR
546 are abbreviations for common situations where only a timeout is required.
547 The file descriptor passed will be \-1, and the event type will be
556 -.Fn signal_initialized ,
557 +\fBsignal_set\fP\fR,
558 +\fBsignal_add\fP\fR,
559 +\fBsignal_del\fP\fR,
560 +\fBsignal_initialized\fP\fR,
563 +\fBsignal_pending\fP\fR
565 The event type will be a persistent
576 In order to avoid races in signal handlers, the
579 API provides two variables:
581 +\fBevent_sigcb\fP\fR
584 +\fBevent_gotsig\fP\fR.
588 +\fBevent_gotsig\fP\fR
589 to indicate that a signal has been received.
592 +\fBevent_sigcb\fP\fR
593 to a callback function.
594 After the signal handler sets
597 +\fBevent_gotsig\fP\fR,
598 +\fBevent_dispatch()\fP\fR
599 will execute the callback function to process received signals.
600 The callback returns 1 when no events are registered any more.
601 It can return \-1 to indicate an error to the
606 +\fBevent_dispatch\fP\fR
621 However, it schedules a callback to be called exactly once and does not
622 require the caller to prepare an
626 This function supports
638 +\fBevent_pending\fP\fR
639 function can be used to check if the event specified by
652 the expiration time of the event will be returned in
658 -.Fn event_initialized
659 +\fBevent_initialized\fP\fR
660 macro can be used to check if an event has been initialized.
666 function provides an interface for single pass execution of pending
677 +\fBevent_loopexit\fP\fR
678 function exits from the event loop. The next
682 given timer expires will complete normally (handling all queued events) then
683 exit without blocking for events again. Subsequent invocations of
686 will proceed normally.
689 +\fBevent_loopbreak\fP\fR
690 function exits from the event loop immediately.
693 will abort after the next event is completed;
695 +\fBevent_loopbreak\fP\fR
696 is typically invoked from this event's callback. This behavior is analogous
697 to the "break;" statement. Subsequent invocations of
700 will proceed normally.
703 It is the responsibility of the caller to provide these functions with
704 pre-allocated event structures.
706 -.Sh EVENT PRIORITIES
708 +.SH EVENT PRIORITIES
712 schedules all active events with the same priority.
713 However, sometimes it is desirable to process some events with a higher
714 priority than others.
718 supports strict priority queues.
719 Active events with a lower priority are always processed before events
720 with a higher priority.
723 The number of different priorities can be set initially with the
724 -.Fn event_priority_init
725 +\fBevent_priority_init\fP\fR
727 This function should be called before the first call to
728 -.Fn event_dispatch .
729 +\fBevent_dispatch\fP\fR.
731 -.Fn event_priority_set
732 +\fBevent_priority_set\fP\fR
733 function can be used to assign a priority to an event.
737 assigns the middle priority to all events unless their priority
739 -.Sh THREAD SAFE EVENTS
741 +.SH THREAD SAFE EVENTS
743 has experimental support for thread-safe events.
744 When initializing the library via
746 an event base is returned.
747 This event base can be used in conjunction with calls to
748 -.Fn event_base_set ,
749 -.Fn event_base_dispatch ,
750 -.Fn event_base_loop ,
751 -.Fn event_base_loopexit ,
752 -.Fn bufferevent_base_set
753 +\fBevent_base_set()\fP\fR,
754 +\fBevent_base_dispatch()\fP\fR,
755 +\fBevent_base_loop()\fP\fR,
756 +\fBevent_base_loopexit()\fP\fR,
757 +\fBbufferevent_base_set()\fP\fR
759 -.Fn event_base_free .
761 +\fBevent_base_free()\fP\fR.
762 +\fBevent_base_set()\fP\fR
763 should be called after preparing an event with
765 +\fBevent_set()\fP\fR,
768 +\fBevent_set()\fP\fR,
769 assigns the provided event to the most recently created event base.
770 -.Fn bufferevent_base_set
771 +\fBbufferevent_base_set()\fP\fR
772 should be called after preparing a bufferevent with
773 -.Fn bufferevent_new .
775 +\fBbufferevent_new()\fP\fR.
776 +\fBevent_base_free()\fP\fR
777 should be used to free memory associated with the event base
778 when it is no longer needed.
783 provides an abstraction on top of the regular event callbacks.
784 This abstraction is called a
785 -.Va "buffered event" .
786 +\fB"buffered event"\fP\fR.
787 A buffered event provides input and output buffers that get filled
788 and drained automatically.
789 The user of a buffered event no longer deals directly with the IO,
790 but instead is reading from input and writing to output buffers.
793 A new bufferevent is created by
794 -.Fn bufferevent_new .
795 +\fBbufferevent_new()\fP\fR.
799 specifies the file descriptor from which data is read and written to.
800 This file descriptor is not allowed to be a
803 The next three parameters are callbacks.
804 The read and write callback have the following form:
806 -.Fn "(*cb)" "struct bufferevent *bufev" "void *arg" .
807 +\fBvoid \fB(*cb)\fR\fR(\fBstruct bufferevent* \fIbufev\fP\fR, \fBvoid* \fIarg\fP\fR).
808 The error callback has the following form:
810 -.Fn "(*cb)" "struct bufferevent *bufev" "short what" "void *arg" .
811 +\fBvoid \fB(*cb)\fR\fR(\fBstruct bufferevent* \fIbufev\fP\fR, \fBshort \fIwhat\fP\fR, \fBvoid* \fIarg\fP\fR).
812 The argument is specified by the fourth parameter
816 -.Fa bufferevent struct
817 -pointer is returned on success, NULL on error.
818 -Both the read and the write callback may be NULL.
819 +\fBstruct bufferevent\fP\fR
820 +pointer is returned on success, \fINULL\fP\fR on error.
821 +Both the read and the write callback may be \fINULL\fP\fR.
822 The error callback has to be always provided.
825 Once initialized, the bufferevent structure can be used repeatedly with
826 bufferevent_enable() and bufferevent_disable().
827 The flags parameter can be a combination of
833 When read enabled the bufferevent will try to read from the file
834 descriptor and call the read callback.
835 The write callback is executed
836 whenever the output buffer is drained below the write low watermark,
844 -.Fn bufferevent_write
845 +\fBbufferevent_write()\fP\fR
846 function can be used to write data to the file descriptor.
847 The data is appended to the output buffer and written to the descriptor
848 automatically as it becomes available for writing.
849 -.Fn bufferevent_write
850 +\fBbufferevent_write()\fP\fR
851 returns 0 on success or \-1 on failure.
853 -.Fn bufferevent_read
854 +\fBbufferevent_read()\fP\fR
855 function is used to read data from the input buffer,
856 returning the amount of data read.
859 If multiple bases are in use, bufferevent_base_set() must be called before
860 enabling the bufferevent for the first time.
861 .Sh NON-BLOCKING HTTP SUPPORT
862 @@ -549,74 +550,74 @@
864 If multiple bases are in use, bufferevent_base_set() must be called before
865 enabling the bufferevent for the first time.
866 -.Sh NON-BLOCKING HTTP SUPPORT
868 +.SH NON-BLOCKING HTTP SUPPORT
870 provides a very thin HTTP layer that can be used both to host an HTTP
871 server and also to make HTTP requests.
872 An HTTP server can be created by calling
874 +\fBevhttp_new\fP\fR.
875 It can be bound to any port and address with the
876 -.Fn evhttp_bind_socket
877 +\fBevhttp_bind_socket\fP\fR
879 When the HTTP server is no longer used, it can be freed via
882 +\fBevhttp_free\fP\fR.
884 To be notified of HTTP requests, a user needs to register callbacks with the
886 This can be done by calling
888 +\fBevhttp_set_cb\fP\fR.
889 The second argument is the URI for which a callback is being registered.
890 The corresponding callback will receive an
891 -.Va struct evhttp_request
892 +\fIstruct evhttp_request\fP\fR
893 object that contains all information about the request.
896 This section does not document all the possible function calls; please
900 for the public interfaces.
901 -.Sh ADDITIONAL NOTES
902 +.SH ADDITIONAL NOTES
903 It is possible to disable support for
904 -.Va epoll , kqueue , devpoll , poll
905 +\fBepoll , kqueue , devpoll , poll\fP\fR
909 by setting the environment variable
910 -.Va EVENT_NOEPOLL , EVENT_NOKQUEUE , EVENT_NODEVPOLL , EVENT_NOPOLL
911 +EVENT_NOEPOLL, EVENT_NOKQUEUE, EVENT_NODEVPOLL, EVENT_NOPOLL
913 -.Va EVENT_NOSELECT ,
916 By setting the environment variable
917 -.Va EVENT_SHOW_METHOD ,
921 displays the kernel notification method that it uses.
924 Upon successful completion
931 Otherwise, \-1 is returned and the global variable errno is
932 set to indicate the error.
943 +\fBport_create(3C)\fR,
950 API manpage is based on the
953 manpage by Artur Grabowski.
957 to Windows is due to Michael A. Davis.
958 Support for real-time signals is due to Taral.
964 library was written by Niels Provos.
967 This documentation is neither complete nor authoritative.
968 If you are in doubt about the usage of this API then
969 check the source code to find out how it works, write