5 let cbtable = Hashtbl.create 1024
7 (* The in descriptor is always open. Thanks to the broken semantics of
8 * fifo outputs, the out descriptor must be opened a nouveau whenever we
9 * want to send out data, and so we keep the associated filename as well.
10 * Same with input fifos. Yipee.*)
12 let add_fd (evpair:fd_and_fname) (fd_other:fd_and_fname) (callback:fd_and_fname->fd_and_fname->unit) =
13 let (fname,fd) = evpair in
14 fdset := (fd::!fdset);
15 Hashtbl.replace cbtable fd (callback,(evpair,fd_other))
18 fdset:=List.filter (fun l->l<>fd) !fdset;
19 flush Pervasives.stdout
24 let (fds,_,_) = try Unix.select !fdset [] [] (-1.)
29 let (func,(evd,fd_other)) = Hashtbl.find cbtable elt in
30 func evd fd_other) fds