From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (from weis@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id SAA11645 for caml-redistribution; Thu, 12 Nov 1998 18:08:45 +0100 (MET) Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by pauillac.inria.fr (8.7.6/8.7.3) with ESMTP id OAA26185 for ; Thu, 12 Nov 1998 14:10:58 +0100 (MET) Received: from pauillac.inria.fr (pauillac.inria.fr [128.93.11.35]) by concorde.inria.fr (8.8.7/8.8.7) with ESMTP id OAA00848; Thu, 12 Nov 1998 14:10:52 +0100 (MET) Received: (from xleroy@localhost) by pauillac.inria.fr (8.7.6/8.7.3) id OAA30343; Thu, 12 Nov 1998 14:10:52 +0100 (MET) Message-ID: <19981112141052.37218@pauillac.inria.fr> Date: Thu, 12 Nov 1998 14:10:52 +0100 From: Xavier Leroy To: frouaix@liquidmarket.com, Brian Rogoff Cc: caml-list@inria.fr Subject: Re: Anyone ported OCamlTk to Tcl/Tk 8.0 on Windows? References: <199811120006.QAA19057@fiji01.liquidmarket.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.89.1 In-Reply-To: <199811120006.QAA19057@fiji01.liquidmarket.com>; from Francois Rouaix on Wed, Nov 11, 1998 at 04:06:43PM -0800 Sender: weis > 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