From 636748a2a3a016e1ffa3e6cf739fe23db3eaf243 Mon Sep 17 00:00:00 2001 From: Niels Provos Date: Fri, 12 Jul 2002 18:50:49 +0000 Subject: change timeout_ API to evtimer_ API; avoiding clashes with kernel include files. okay mickey@ --- lib/libevent/event.3 | 32 ++++++++++++++++---------------- lib/libevent/event.h | 17 ++++++----------- 2 files changed, 22 insertions(+), 27 deletions(-) (limited to 'lib') diff --git a/lib/libevent/event.3 b/lib/libevent/event.3 index ebfadf0f3fd..29ab4c99b50 100644 --- a/lib/libevent/event.3 +++ b/lib/libevent/event.3 @@ -1,4 +1,4 @@ -.\" $OpenBSD: event.3,v 1.3 2002/07/05 20:04:39 provos Exp $ +.\" $OpenBSD: event.3,v 1.4 2002/07/12 18:50:48 provos Exp $ .\" .\" Copyright (c) 2000 Artur Grabowski .\" All rights reserved. @@ -38,11 +38,11 @@ .Nm event_del , .Nm event_pending , .Nm event_initialized , -.Nm timeout_set , -.Nm timeout_add , -.Nm timeout_del -.Nm timeout_pending , -.Nm timeout_initialized , +.Nm evtimer_set , +.Nm evtimer_add , +.Nm evtimer_del +.Nm evtimer_pending , +.Nm evtimer_initialized , .Nm signal_set , .Nm signal_add , .Nm signal_del @@ -69,15 +69,15 @@ .Ft int .Fn "event_initialized" "struct event *ev" .Ft void -.Fn "timeout_set" "struct event *ev" "void (*fn)(int, short, void *)" "void *arg" +.Fn "evtimer_set" "struct event *ev" "void (*fn)(int, short, void *)" "void *arg" .Ft void -.Fn "timeout_add" "struct event *ev" "struct timeval *" +.Fn "evtimer_add" "struct event *ev" "struct timeval *" .Ft void -.Fn "timeout_del" "struct event *ev" +.Fn "evtimer_del" "struct event *ev" .Ft int -.Fn "timeout_pending" "struct event *ev" "struct timeval *tv" +.Fn "evtimer_pending" "struct event *ev" "struct timeval *tv" .Ft int -.Fn "timeout_initialized" "struct event *ev" +.Fn "evtimer_initialized" "struct event *ev" .Ft void .Fn "signal_set" "struct event *ev" "int signal" "void (*fn)(int, short, void *)" "void *arg" .Ft void @@ -253,12 +253,12 @@ The macro can be used to check if an event has been initialized. .Pp The functions -.Fn timeout_set , -.Fn timeout_add , -.Fn timeout_del , -.Fn timeout_initialized , +.Fn evtimer_set , +.Fn evtimer_add , +.Fn evtimer_del , +.Fn evtimer_initialized , and -.Fn timeout_pending +.Fn evtimer_pending are abbreviations for common situations where only a timeout is required. The file descriptor passed will be 0, and the event type will be .Va EV_TIMEOUT . diff --git a/lib/libevent/event.h b/lib/libevent/event.h index 1cea4492534..e50050e2fe1 100644 --- a/lib/libevent/event.h +++ b/lib/libevent/event.h @@ -1,4 +1,4 @@ -/* $OpenBSD: event.h,v 1.3 2002/06/25 19:46:29 mickey Exp $ */ +/* $OpenBSD: event.h,v 1.4 2002/07/12 18:50:48 provos Exp $ */ /* * Copyright 2000-2002 Niels Provos @@ -127,16 +127,11 @@ int timeout_next(struct timeval *); void timeout_correct(struct timeval *); void timeout_process(void); -#undef timeout_add -#undef timeout_set -#undef timeout_del -#undef timeout_pending -#undef timeout_initialized -#define timeout_add(ev, tv) event_add(ev, tv) -#define timeout_set(ev, cb, arg) event_set(ev, -1, 0, cb, arg) -#define timeout_del(ev) event_del(ev) -#define timeout_pending(ev, tv) event_pending(ev, EV_TIMEOUT, tv) -#define timeout_initialized(ev) ((ev)->ev_flags & EVLIST_INIT) +#define evtimer_add(ev, tv) event_add(ev, tv) +#define evtimer_set(ev, cb, arg) event_set(ev, -1, 0, cb, arg) +#define evtimer_del(ev) event_del(ev) +#define evtimer_pending(ev, tv) event_pending(ev, EV_TIMEOUT, tv) +#define evtimer_initialized(ev) ((ev)->ev_flags & EVLIST_INIT) #define signal_add(ev, tv) event_add(ev, tv) #define signal_set(ev, x, cb, arg) \ -- cgit v1.2.3