-.\" $OpenBSD: evbuffer_new.3,v 1.13 2017/08/01 14:57:03 schwarze Exp $
+.\" $OpenBSD: evbuffer_new.3,v 1.14 2018/07/26 12:50:04 rob Exp $
.\"
.\" Copyright (c) 2014 David Gwynne <dlg@openbsd.org>
.\"
.\" ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
.\" OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
.\"
-.Dd $Mdocdate: August 1 2017 $
+.Dd $Mdocdate: July 26 2018 $
.Dt EVBUFFER_NEW 3
.Os
.Sh NAME
.Nm evbuffer_find ,
.Nm evbuffer_readline ,
.Nm evbuffer_readln ,
-.Nm EVBUFFER_LENGTH
+.Nm EVBUFFER_LENGTH ,
+.Nm EVBUFFER_DATA
.Nd libevent utility API for buffered input/output
.Sh SYNOPSIS
.In event.h
.Fc
.Ft size_t
.Fn "EVBUFFER_LENGTH" "const struct evbuffer *buf"
+.Ft "u_char *"
+.Fn "EVBUFFER_DATA" "const struct evbuffer *buf"
.Sh DESCRIPTION
The evbuffer API provides an implementation of buffering for use with
libevent.
.Pp
.Fn EVBUFFER_LENGTH
returns the number of bytes available in the evbuffer.
+.Pp
+.Fn EVBUFFER_DATA
+returns a pointer to the evbuffer
+.Fa buf
+on success.
.Sh SEE ALSO
.Xr errno 2 ,
.Xr event 3 ,
-.\" $OpenBSD: event.3,v 1.53 2017/06/29 01:25:59 dlg Exp $
+.\" $OpenBSD: event.3,v 1.54 2018/07/26 12:50:04 rob Exp $
.\"
.\" Copyright (c) 2000 Artur Grabowski <art@openbsd.org>
.\" All rights reserved.
.\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
.\" ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
-.Dd $Mdocdate: June 29 2017 $
+.Dd $Mdocdate: July 26 2018 $
.Dt EVENT_INIT 3
.Os
.Sh NAME
.Nm bufferevent_read ,
.Nm bufferevent_enable ,
.Nm bufferevent_disable ,
-.Nm bufferevent_settimeout
+.Nm bufferevent_settimeout ,
+.Nm EVBUFFER_INPUT ,
+.Nm EVBUFFER_OUTPUT
.Nd execute a function when a specific event occurs
.Sh SYNOPSIS
.In sys/time.h
.Fn "bufferevent_disable" "struct bufferevent *bufev" "short event"
.Ft void
.Fn "bufferevent_settimeout" "struct bufferevent *bufev" "int timeout_read" "int timeout_write"
+.Ft "struct evbuffer *"
+.Fn "EVBUFFER_INPUT" "struct bufferevent *bufev"
+.Ft "struct evbuffer *"
+.Fn "EVBUFFER_OUTPUT" "struct bufferevent *bufev"
.Sh DESCRIPTION
The
.Nm event
.Fn bufferevent_base_set
must be called before
enabling the bufferevent for the first time.
+.Pp
+The
+.Fn EVBUFFER_INPUT
+and
+.Fn EVBUFFER_OUTPUT
+macros return a pointer to evbuffer
+.Fa input
+and
+.Fa output
+respectively for the specified bufferevent
+.Fa bufev .
.Sh ADDITIONAL NOTES
It is possible to disable support for
.Va kqueue , poll