Commits


ev_timer_cancel: return -1 when not found


ev: fix/improve cancel_timer and ev_timer_cancel we only reach cancel_timer() for timers in the hap, so delete the unreachable code, and improve what we have. When deleting from the reserve space, just move the last element in the place of the removed one, no need to move everything. It'll be heapified later anyway.


ev: fix corruption in bubbledown tmp is of the wrong size, so we memcpy the wrong values. fun.


ev: fix two off-by-one in bubbledown


ev: fix registering timers from timers callbacks We can't add items to the heap while we've iterating it, so we can't directly insert new times from a timer' callback. Instead, add them to a ``reserve'' space after the end of the heap, and merge them back inside the heap after all events have been processed.


ev: fix invalid fd check


ev: define EV_* constants instead of reusing POLL{IN,OUT} Dissociate us a bit from poll(2) so that we may even run on top of something else, and also allows to provide specific values for signal (EV_SIGNAL) and timers (EV_TIMEOUT).


import ev.[ch] from syncparty and amused; locally tweaked to support an arbitrary number of timers.