From 22c1e6dbe7cf74936e5ca29eadeff81312ccc506 Mon Sep 17 00:00:00 2001 From: buisson Date: Fri, 29 Apr 2005 09:35:43 +0000 Subject: Initial revision --- ctkivy.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 ctkivy.c (limited to 'ctkivy.c') diff --git a/ctkivy.c b/ctkivy.c new file mode 100644 index 0000000..ae31560 --- /dev/null +++ b/ctkivy.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include "ivytcl.h" + +extern void cb_delete_channel(void *delete_read); +extern void cb_read_channel(Channel ch, HANDLE fd, void *closure); + +value ivy_TclmainLoop(value unit) +{ + Tk_MainLoop(); + return Val_unit; +} + + +value ivy_TclchannelSetUp(value fd, value closure_name) +{ + Channel c; + value * closure = caml_named_value(String_val(closure_name)); + + c = IvyTclChannelSetUp((HANDLE)Int_val(fd), (void*)closure, cb_delete_channel, cb_read_channel); + return Val_int(c); +} + +value ivy_TclchannelClose(value ch) +{ + IvyTclChannelClose((Channel)Int_val(ch)); + return Val_unit; +} -- cgit v1.1