Import Debian changes 20180207-1
[hcoop/debian/mlton.git] / basis-library / mlton / pointer.sig
1 (* Copyright (C) 2003-2006, 2008 Henry Cejtin, Matthew Fluet, Suresh
2 * Jagannathan, and Stephen Weeks.
3 *
4 * MLton is released under a BSD-style license.
5 * See the file MLton-LICENSE for details.
6 *)
7
8 signature MLTON_POINTER =
9 sig
10 eqtype t
11
12 val add: t * word -> t
13 val compare: t * t -> order
14 val diff: t * t -> word
15 (* val free: t -> unit *)
16 val getInt8: t * int -> Int8.int
17 val getInt16: t * int -> Int16.int
18 val getInt32: t * int -> Int32.int
19 val getInt64: t * int -> Int64.int
20 val getPointer: t * int -> t
21 val getReal32: t * int -> Real32.real
22 val getReal64: t * int -> Real64.real
23 val getWord8: t * int -> Word8.word
24 val getWord16: t * int -> Word16.word
25 val getWord32: t * int -> Word32.word
26 val getWord64: t * int -> Word64.word
27 val null: t
28 val setInt8: t * int * Int8.int -> unit
29 val setInt16: t * int * Int16.int -> unit
30 val setInt32: t * int * Int32.int -> unit
31 val setInt64: t * int * Int64.int -> unit
32 val setPointer: t * int * t -> unit
33 val setReal32: t * int * Real32.real -> unit
34 val setReal64: t * int * Real64.real -> unit
35 val setWord8: t * int * Word8.word -> unit
36 val setWord16: t * int * Word16.word -> unit
37 val setWord32: t * int * Word32.word -> unit
38 val setWord64: t * int * Word64.word -> unit
39 val sizeofPointer: word
40 val sub: t * word -> t
41 end
42
43 signature MLTON_POINTER_EXTRA =
44 sig
45 include MLTON_POINTER
46
47 val getCPointer: t * int -> t
48 val setCPointer: t * int * t -> unit
49 val getObjptr: t * int -> 'a
50 val setObjptr: t * int * 'a -> unit
51 end