Add a bullet symbol.
[tatoo.git] / src / uid.ml
1 (***********************************************************************)
2 (*                                                                     *)
3 (*                               TAToo                                 *)
4 (*                                                                     *)
5 (*                     Kim Nguyen, LRI UMR8623                         *)
6 (*                   Université Paris-Sud & CNRS                       *)
7 (*                                                                     *)
8 (*  Copyright 2010-2012 Université Paris-Sud and Centre National de la *)
9 (*  Recherche Scientifique. All rights reserved.  This file is         *)
10 (*  distributed under the terms of the GNU Lesser General Public       *)
11 (*  License, with the special exception on linking described in file   *)
12 (*  ../LICENSE.                                                        *)
13 (*                                                                     *)
14 (***********************************************************************)
15
16 type t = int
17
18 exception Overflow
19 let make_maker () =
20   let _id = ref ~-1 in
21     fun () ->
22       incr _id;
23       let i = !_id in
24       if i < 0 then raise Overflow else i
25
26 let dummy = -1
27
28 external to_int : t -> int = "%identity"
29 external of_int : int -> t= "%identity"