--- libev/ev.pod 2010/10/18 07:36:05 1.306 +++ libev/ev.pod 2010/10/21 09:23:21 1.309 @@ -956,7 +956,7 @@ C callbacks described above, but of course can be (ab-)used for any other purpose as well. -=item ev_loop_verify (loop) +=item ev_verify (loop) This function only does something when C support has been compiled in, which is the default for non-minimal builds. It tries to go @@ -3393,16 +3393,22 @@ =item w->set ([arguments]) -Basically the same as C, with the same arguments. Must be -called at least once. Unlike the C counterpart, an active watcher gets -automatically stopped and restarted when reconfiguring it with this -method. +Basically the same as C, with the same arguments. Either this +method or a suitable start method must be called at least once. Unlike the +C counterpart, an active watcher gets automatically stopped and restarted +when reconfiguring it with this method. =item w->start () Starts the watcher. Note that there is no C argument, as the constructor already stores the event loop. +=item w->start ([arguments]) + +Instead of calling C and C methods separately, it is often +convenient to wrap them in one call. Uses the same type of arguments as +the configure C method of the watcher. + =item w->stop () Stops the watcher if it is active. Again, no C argument. @@ -3424,20 +3430,25 @@ =back -Example: Define a class with an IO and idle watcher, start one of them in -the constructor. +Example: Define a class with two I/O and idle watchers, start the I/O +watchers in the constructor. class myclass { ev::io io ; void io_cb (ev::io &w, int revents); + ev::io2 io2 ; void io2_cb (ev::io &w, int revents); ev::idle idle; void idle_cb (ev::idle &w, int revents); myclass (int fd) { io .set (this); + io2 .set (this); idle.set (this); - io.start (fd, ev::READ); + io.set (fd, ev::WRITE); // configure the watcher + io.start (); // start it whenever convenient + + io2.start (fd, ev::READ); // set + start in one call } }; @@ -4031,7 +4042,7 @@ =item EV_VERIFY -Controls how much internal verification (see C) will +Controls how much internal verification (see C) will be done: If set to C<0>, no internal verification code will be compiled in. If set to C<1>, then verification code will be compiled in, but not called. If set to C<2>, then the internal verification code will be @@ -4628,11 +4639,11 @@ =item C must hold a time value in seconds with enough accuracy The type C is used to represent timestamps. It is required to -have at least 51 bits of mantissa (and 9 bits of exponent), which is good -enough for at least into the year 4000. This requirement is fulfilled by -implementations implementing IEEE 754, which is basically all existing -ones. With IEEE 754 doubles, you get microsecond accuracy until at least -2200. +have at least 51 bits of mantissa (and 9 bits of exponent), which is +good enough for at least into the year 4000 with millisecond accuracy +(the design goal for libev). This requirement is overfulfilled by +implementations using IEEE 754, which is basically all existing ones. With +IEEE 754 doubles, you get microsecond accuracy until at least 2200. =back