diff options
author | hattenberger | 2013-05-01 22:48:44 +0000 |
---|---|---|
committer | hattenberger | 2013-05-01 22:48:44 +0000 |
commit | d567e908db2e1acec01d0798bd7e8af6c084dba4 (patch) | |
tree | 6b6eb46c9ea53360eda9127e54efb22acd857bbe /trunk/civyloop.c | |
parent | 7fae936e59d5c4a446e0c1e92e6d2df4fac5c37d (diff) | |
download | ivy-ocaml-d567e908db2e1acec01d0798bd7e8af6c084dba4.zip ivy-ocaml-d567e908db2e1acec01d0798bd7e8af6c084dba4.tar.gz ivy-ocaml-d567e908db2e1acec01d0798bd7e8af6c084dba4.tar.bz2 ivy-ocaml-d567e908db2e1acec01d0798bd7e8af6c084dba4.tar.xz |
remove accidental trunk dir
Diffstat (limited to 'trunk/civyloop.c')
-rw-r--r-- | trunk/civyloop.c | 70 |
1 files changed, 0 insertions, 70 deletions
diff --git a/trunk/civyloop.c b/trunk/civyloop.c deleted file mode 100644 index 083b104..0000000 --- a/trunk/civyloop.c +++ /dev/null @@ -1,70 +0,0 @@ -#include <stdlib.h> -#include <string.h> -#include <stdio.h> -#include <getopt.h> -#include <Ivy/ivy.h> -#include <Ivy/ivyloop.h> -#include <Ivy/timer.h> -#include <Ivy/version.h> -#include <caml/mlvalues.h> -#include <caml/fail.h> -#include <caml/callback.h> -#include <caml/memory.h> -#include <caml/alloc.h> - -value ivy_mainLoop(value unit) -{ -#if IVYMINOR_VERSION == 8 - IvyMainLoop (NULL,NULL); -#else - IvyMainLoop (); -#endif - return Val_unit; -} - -void timer_cb(TimerId id, void *data, unsigned long delta) -{ - value closure = *(value*)data; - callback(closure, Val_long(id)); -} - -value ivy_timerRepeatafter(value nb_ticks,value delay, value closure_name) -{ - value * closure = caml_named_value(String_val(closure_name)); - TimerId id = TimerRepeatAfter(Int_val(nb_ticks), Int_val(delay), timer_cb, (void*)closure); - return Val_int(id); -} - -/* Data associated to Channel callbacks is the couple of delete and -read closures */ - -extern void cb_delete_channel(void *delete_read); -extern void cb_read_channel(Channel ch, IVY_HANDLE fd, void *closure); -extern void cb_write_channel(Channel ch, IVY_HANDLE fd, void *closure); - - -value ivy_channelSetUp(value fd, value closure_name) -{ - Channel c; - value * closure = caml_named_value(String_val(closure_name)); - -#if IVYMINOR_VERSION == 8 - c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); -#else - c = IvyChannelAdd((IVY_HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel, cb_write_channel); -#endif - return Val_int(c); -} - -value ivy_timerRemove(value t) -{ - TimerRemove((TimerId)Long_val(t)); - return Val_unit; -} - - -value ivy_channelClose(value ch) -{ - IvyChannelRemove((Channel)Long_val(ch)); - return Val_unit; -} |