mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-07 11:20:16 -04:00
event_self_cbarg() works with event_assign() for consistency with event_new().
This commit is contained in:
parent
fa931bb348
commit
09a1906a2c
2
event.c
2
event.c
@ -1846,6 +1846,8 @@ event_assign(struct event *ev, struct event_base *base, evutil_socket_t fd, shor
|
||||
{
|
||||
if (!base)
|
||||
base = current_base;
|
||||
if (arg == &event_self_cbarg_ptr_)
|
||||
arg = ev;
|
||||
|
||||
event_debug_assert_not_added_(ev);
|
||||
|
||||
|
@ -859,8 +859,13 @@ typedef void (*event_callback_fn)(evutil_socket_t, short, void *);
|
||||
struct event *ev = event_new(base, sock, events, callback, %event_self_cbarg());
|
||||
</pre>
|
||||
|
||||
@return a value to be passed as the callback argument to event_new().
|
||||
@see event_new()
|
||||
For consistency with event_new(), it is possible to pass the return value
|
||||
of this function as the callback argument for event_assign() – this
|
||||
achieves the same result as passing the event in directly.
|
||||
|
||||
@return a value to be passed as the callback argument to event_new() or
|
||||
event_assign().
|
||||
@see event_new(), event_assign()
|
||||
*/
|
||||
void *event_self_cbarg(void);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user