File: thread.ml

package info (click to toggle)
hevea 2.36-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 3,780 kB
  • sloc: ml: 19,453; sh: 503; makefile: 311; ansic: 132
file content (32 lines) | stat: -rw-r--r-- 1,302 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
(***********************************************************************)
(*                                                                     *)
(*                          HEVEA                                      *)
(*                                                                     *)
(*  Luc Maranget, projet PARA, INRIA Rocquencourt                      *)
(*                                                                     *)
(*  Copyright 1998 Institut National de Recherche en Informatique et   *)
(*  Automatique.  Distributed only by permission.                      *)
(*                                                                     *)
(***********************************************************************)

let uptable = Hashtbl.create 17
and nexttable = Hashtbl.create 17
and prevtable = Hashtbl.create 17
;;

let setup file upname = Hashtbl.add uptable file upname
and setprev file prevname = Hashtbl.add prevtable file prevname
let setnext file nextname = Hashtbl.add nexttable file nextname
;;

let setprevnext prev now =
  if prev <> "" then begin
    Hashtbl.add nexttable prev now ;
    Hashtbl.add prevtable now prev
  end
;;

let next name = Hashtbl.find nexttable name
and up   name = Hashtbl.find uptable name
and prev name = Hashtbl.find prevtable name
;;