Date: Thu, 12 Nov 1998 14:10:52 +0100
From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: frouaix@liquidmarket.com, Brian Rogoff <bpr@best.com>
Subject: Re: Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows?
In-Reply-To: <199811120006.QAA19057@fiji01.liquidmarket.com>; from Francois Rouaix on Wed, Nov 11, 1998 at 04:06:43PM -0800
> The proper fix would be to use
> Tcl_CreateChannelHandler (Tcl_MakeFileChannel (some_descriptor))
> where some_descriptor is the file descriptor under Unix, and a HANDLE under
> Windows.
> Unfortunately, I didn't have time to look into the Windows version of
> our libunix library to see what notion of file descriptor/handle we are
> using there, and if it fits our purpose. You might want to check that
> with Xavier, who is the main perpetrator of this library.
^^^^^^^^^^^
Well, Win32 programming is not a crime; a misdemeanor, perhaps...
At any rate, the Windows version of libunix uses Win32 native HANDLE
to represent the type Unix.file_descriptor. (Initially, we used
Visual C++'s emulation of Unix file descriptors, but it was too buggy.)
So, it should work with Tcl_MakeFileChannel.
To extract the HANDLE from a Caml value of type Unix.file_descriptor,
just use the following handy macro (found in
otherlibs/win32unix/unixsupport.h):
#define Handle_val(v) (*((HANDLE *)(v)))
If anyone gets Tk 8.0 to work under Windows, please send us the
patches.
Best regards,
- Xavier Leroy
This archive was generated by hypermail 2b29 : Sun Jan 02 2000 - 11:58:16 MET