-/*****************************************************************************/
-
-#if 0
-
-struct ev_io wio;
-
-static void
-sin_cb (struct ev_io *w, int revents)
-{
- fprintf (stderr, "sin %d, revents %d\n", w->fd, revents);
-}
-
-static void
-ocb (struct ev_timer *w, int revents)
-{
- //fprintf (stderr, "timer %f,%f (%x) (%f) d%p\n", w->at, w->repeat, revents, w->at - ev_time (), w->data);
- evtimer_stop (w);
- evtimer_start (w);
-}
-
-static void
-scb (struct ev_signal *w, int revents)
-{
- fprintf (stderr, "signal %x,%d\n", revents, w->signum);
- evio_stop (&wio);
- evio_start (&wio);
-}
-
-static void
-gcb (struct ev_signal *w, int revents)
-{
- fprintf (stderr, "generic %x\n", revents);
-
-}
-
-int main (void)
-{
- ev_init (0);
-
- evio_init (&wio, sin_cb, 0, EV_READ);
- evio_start (&wio);
-
- struct ev_timer t[10000];
-
-#if 0
- int i;
- for (i = 0; i < 10000; ++i)
- {
- struct ev_timer *w = t + i;
- evw_init (w, ocb, i);
- evtimer_init_abs (w, ocb, drand48 (), 0.99775533);
- evtimer_start (w);
- if (drand48 () < 0.5)
- evtimer_stop (w);
- }
-#endif
-
- struct ev_timer t1;
- evtimer_init (&t1, ocb, 5, 10);
- evtimer_start (&t1);
-
- struct ev_signal sig;
- evsignal_init (&sig, scb, SIGQUIT);
- evsignal_start (&sig);
-
- struct ev_check cw;
- evcheck_init (&cw, gcb);
- evcheck_start (&cw);
-
- struct ev_idle iw;
- evidle_init (&iw, gcb);
- evidle_start (&iw);
-
- ev_loop (0);
-
- return 0;