Version française
Home     About     Download     Resources     Contact us    
Browse thread
Help interfacing with C
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Bardur Arantsson <spam@s...>
Subject: Re: Help interfacing with C
Olivier Andrieu wrote:
>  Bardur Arantsson [Thursday 17 August 2006] :
>  >
>  > Nathaniel Gray wrote:
>  > > Hi folks,
>  > [--snip--]
>  > > have select work on (file_descr * 'a) pairs instead of plain file
>  > > descriptors.
>  > 
>  > It's much easier than that; just define a conversion in OCaml:
>  > 
>  >     external file_descr_to_int : file_descr -> int = "%identity";
>  >     external int_to_file_descr : int -> file_descr = "%identity";
> 
> That will only work on Unix: on Windows, a file_descr is not an int
> but a custom block.
> 
> file_descr work fine as keys for a Hashtbl though.
> 

Well, AFAICT he's accessing/creating them through Int_val/Val_int, so I 
kind of assumed...

-- 
Bardur Arantsson
<bardurREMOVE@THISscientician.net>

- Evil will always triumph over Good, because Good is dumb.
                                          Dark Helmet / Spaceballs