Revision history for libev, a high-performance and full-featured event loop.
TODO: ABI??? API????? Changes???
+TODO: win32 write() to socket for signal handling
- ev_embed_stop did not correctly stop the watcher (very good
testcase by Vladimir Timofeev).
- applied win32 fixes by Michael Lenaghan (also James Mansion).
- new EV_CHILD_ENABLE and EV_SIGNAL_ENABLE configurable settings.
- update libev.m4 HAVE_CLOCK_SYSCALL test for newwer glibcs.
- add section on accept() problems to the manpage.
+ - rename EV_TIMEOUT to EV_TIMER.
+ - switch to two-digit minor version.
3.9 Thu Dec 31 07:59:59 CET 2009
- signalfd is no longer used by default and has to be requested
AUTOMAKE_OPTIONS = foreign no-dependencies
-VERSION_INFO = 3:0
+VERSION_INFO = 4:0
EXTRA_DIST = LICENSE Changes libev.m4 autogen.sh \
ev_vars.h ev_wrap.h \
AC_INIT
AC_CONFIG_SRCDIR([ev_epoll.c])
-AM_INIT_AUTOMAKE(libev,3.9) dnl also update ev.h!
+AM_INIT_AUTOMAKE(libev,4.00) dnl also update ev.h!
AC_CONFIG_HEADERS([config.h])
AM_MAINTAINER_MODE
/*****************************************************************************/
#ifndef EV_FEATURES
-# define EV_FEATURES 0x3f
+# define EV_FEATURES 0x7f
#endif
#define EV_FEATURE_CODE ((EV_FEATURES) & 1)
#define EV_FEATURE_BACKENDS ((EV_FEATURES) & 32)
#define EV_FEATURE_OS ((EV_FEATURES) & 64)
-/* these priorities are inclusive, higher priorities will be called earlier */
+/* these priorities are inclusive, higher priorities will be invoked earlier */
#ifndef EV_MINPRI
# define EV_MINPRI (EV_FEATURE_CONFIG ? -2 : 0)
#endif
# define EV_INLINE static
#endif
+#ifndef EV_PROTOTYPES
+# define EV_PROTOTYPES 1
+#endif
+
/*****************************************************************************/
+#define EV_VERSION_MAJOR 4
+#define EV_VERSION_MINOR 0
+
/* eventmask, revents, events... */
#define EV_UNDEF -1 /* guaranteed to be invalid */
#define EV_NONE 0x00 /* no events */
#ifndef EV_COMMON
# define EV_COMMON void *data;
#endif
-#ifndef EV_PROTOTYPES
-# define EV_PROTOTYPES 1
-#endif
-
-#define EV_VERSION_MAJOR 3
-#define EV_VERSION_MINOR 9
#ifndef EV_CB_DECLARE
# define EV_CB_DECLARE(type) void (*cb)(EV_P_ struct type *w, int revents);
# define EV_CB_INVOKE(watcher,revents) (watcher)->cb (EV_A_ (watcher), (revents))
#endif
+/* not official, do not use */
+#define EV_CB(type,name) void name (EV_P_ struct ev_ ## type *w, int revents)
+
/*
* struct member types:
* private: you may look at them, but not change them,
#if EV_MINPRI == EV_MAXPRI
# define EV_DECL_PRIORITY
-#else
+#elif !defined (EV_DECL_PRIORITY)
# define EV_DECL_PRIORITY int priority;
#endif
The file descriptor in the C<ev_io> watcher has become readable and/or
writable.
-=item C<EV_TIMEOUT>
+=item C<EV_TIMER>
The C<ev_timer> watcher has timed out.
ev_init (timer, callback);
last_activity = ev_now (loop);
- callback (loop, timer, EV_TIMEOUT);
+ callback (loop, timer, EV_TIMER);
And when there is some activity, simply store the current time in
C<last_activity>, no libev calls at all:
started. Otherwise an C<ev_timer> watcher with after = C<timeout> (and
repeat = 0) will be started. C<0> is a valid timeout.
-The callback has the type C<void (*cb)(int revents, void *arg)> and gets
+The callback has the type C<void (*cb)(int revents, void *arg)> and is
passed an C<revents> set like normal event callbacks (a combination of
-C<EV_ERROR>, C<EV_READ>, C<EV_WRITE> or C<EV_TIMEOUT>) and the C<arg>
+C<EV_ERROR>, C<EV_READ>, C<EV_WRITE> or C<EV_TIMER>) and the C<arg>
value passed to C<ev_once>. Note that it is possible to receive I<both>
a timeout and an io event at the same time - you probably should give io
events precedence.
{
if (revents & EV_READ)
/* stdin might have data for us, joy! */;
- else if (revents & EV_TIMEOUT)
+ else if (revents & EV_TIMER)
/* doh, nothing entered */;
}
=back
+=head1 PORTING FROM 3.X TO 4.X
+
+The major version 4 introduced some minor incompatible changes to the API.
+
+=over 4
+
+=item C<EV_TIMEOUT> replaced by C<EV_TIMER> in C<revents>
+
+This is a simple rename - all other watcher types use their name
+as revents flag, and now C<ev_timer> does, too.
+
+Both C<EV_TIMER> and C<EV_TIMEOUT> symbols were present in 3.x versions
+and continue to be present for the forseeable future, so this is mostly a
+documentation change.
+
+=item C<EV_MINIMAL> mechanism replaced by C<EV_FEATURES>
+
+The preprocessor symbol C<EV_MINIMAL> has been replaced by a different
+mechanism, C<EV_FEATURES>. Programs using C<EV_MINIMAL> usually compile
+and work, but the library code will of course be larger.
+
+=back
+
+
=head1 GLOSSARY
=over 4
any other events happening anymore.
In libev, events are represented as single bits (such as C<EV_READ> or
-C<EV_TIMEOUT>).
+C<EV_TIMER>).
=item event library