From: rob Date: Thu, 26 Jul 2018 12:50:04 +0000 (+0000) Subject: Mention some missing libevent macros. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=9f28997702339f64dc3fb0ef286f7e97b0b8de65;p=openbsd Mention some missing libevent macros. ok jmc@, benno@, "yes" deraadt@ --- diff --git a/lib/libevent/evbuffer_new.3 b/lib/libevent/evbuffer_new.3 index 202fb67be74..364f67bb00b 100644 --- a/lib/libevent/evbuffer_new.3 +++ b/lib/libevent/evbuffer_new.3 @@ -1,4 +1,4 @@ -.\" $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 .\" @@ -14,7 +14,7 @@ .\" 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 @@ -33,7 +33,8 @@ .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 @@ -77,6 +78,8 @@ .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. @@ -259,6 +262,11 @@ on failure. .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 , diff --git a/lib/libevent/event.3 b/lib/libevent/event.3 index 0167ed86f98..c48ec8ed7b1 100644 --- a/lib/libevent/event.3 +++ b/lib/libevent/event.3 @@ -1,4 +1,4 @@ -.\" $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 .\" All rights reserved. @@ -23,7 +23,7 @@ .\" 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 @@ -67,7 +67,9 @@ .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 @@ -154,6 +156,10 @@ .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 @@ -507,6 +513,17 @@ If multiple bases are in use, .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