]> git.llucax.com Git - software/ev.d.git/blobdiff - test.d
Bugfix: explicit cast functions returning bool.
[software/ev.d.git] / test.d
diff --git a/test.d b/test.d
index 98ea1ecdd7c76889580e10d0c94798125db2eb50..aede490f04d0c7afcf50771d90769a6d2a59e550 100644 (file)
--- a/test.d
+++ b/test.d
@@ -10,7 +10,7 @@
  +/
 
 import io = std.stdio;
  +/
 
 import io = std.stdio;
-import ev;
+import ev.c;
 
 extern (C)
 {
 
 extern (C)
 {
@@ -20,12 +20,12 @@ extern (C)
                char[] ln = io.readln();
                io.writef("read %d bytes: %s", ln.length, ln);
                ev_io_stop(loop, w); // just a syntax example
                char[] ln = io.readln();
                io.writef("read %d bytes: %s", ln.length, ln);
                ev_io_stop(loop, w); // just a syntax example
-               ev_unloop(loop, how.ALL); // leave all loop calls
+               ev_unloop(loop, EVUNLOOP_ALL); // leave all loop calls
        }
        static void timeout_cb(ev_loop_t* loop, ev_timer *w, int revents)
        {
                io.writefln("timeout");
        }
        static void timeout_cb(ev_loop_t* loop, ev_timer *w, int revents)
        {
                io.writefln("timeout");
-               ev_unloop(loop, how.ONE); // leave one loop call
+               ev_unloop(loop, EVUNLOOP_ONE); // leave one loop call
        }
 }
 
        }
 }
 
@@ -37,7 +37,7 @@ void main()
        auto loop = ev_default_loop();
 
        /* initialise an io watcher, then start it */
        auto loop = ev_default_loop();
 
        /* initialise an io watcher, then start it */
-       ev_io_init(&stdin_watcher, &stdin_cb, /*STDIN_FILENO*/ 0, READ);
+       ev_io_init(&stdin_watcher, &stdin_cb, /*STDIN_FILENO*/ 0, EV_READ);
        ev_io_start(loop, &stdin_watcher);
 
        /* simple non-repeating 5.5 second timeout */
        ev_io_start(loop, &stdin_watcher);
 
        /* simple non-repeating 5.5 second timeout */