[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [Libevent-users] struct evbuffer is internal which will cause "error C2037: left of 'parent' specifies undefined struct/union 'evbuffer'"



Got, Thank you.

2011/11/25 Nick Mathewson <nickm@xxxxxxxxxxxxx>
On Thu, Nov 24, 2011 at 8:49 PM, 李永平 <lypkiller@xxxxxxxxx> wrote:
> Hi all,
>   I found a blemish in the struct evbuffer, which has a member: parent. The
> testing libevent is 2.0.15.
>   when i tried to get the "parent" bufferevent from evbuffer, like below:
>       #include "event2/event.h"
>       #include "event2/buffer.h"
>       #include "event2/bufferevent.h"
>      //...ship something....
>      struct evbuffer test;
>      struct bufferevent *bev = test.parent.

This is just plain unsupported.  The definition of struct evbuffer is
an implementation detail; programs shouldn't need to access it (or to
allocate struct evbuffer on the stack, for that matter).

Any program that includes one of the "...-internal.h" headers, or that
accesses a field of a struct defined only in one of those headers,
should not expect to work with future versions of libevent -- those
are not public, supported APIs.

--
Nick
***********************************************************************
To unsubscribe, send an e-mail to majordomo@xxxxxxxxxxxxx with
unsubscribe libevent-users    in the body.