Browse thread
Help interfacing with C
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2006-08-18 (15:52) |
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