-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcache.idl
53 lines (44 loc) · 1.48 KB
/
cache.idl
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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/* -*- mode: c -*- */
/* This file is part of the MLCUDDIDL Library, released under LGPL license.
Please read the COPYING file packaged in the distribution */
quote(C, "
#include \"stdio.h\"
#include \"cuddInt.h\"
#include \"caml/custom.h\"
#include \"cudd_caml.h\"
")
import "man.idl";
typedef [abstract,c2ml(camlidl_cudd_cache_c2ml),ml2c(camlidl_cudd_cache_ml2c)] struct cache__t* cache__t;
cache__t _create(int arity, int size, int maxsize)
quote(call,"
_res = malloc(sizeof(struct CuddauxCache));
_res->cache = NULL;
_res->arity = arity;
_res->initialsize = size;
_res->maxsize = maxsize;
_res->man = NULL;
");
quote(MLI,"
val create : ?size:int -> ?maxsize:int -> arity:int -> t
val create1 : ?size:int -> ?maxsize:int -> unit -> t
val create2 : ?size:int -> ?maxsize:int -> unit -> t
val create3 : ?size:int -> ?maxsize:int -> unit -> t
(** Creates local caches of the given arity, with initial size [size] and
maximal size [maxsize]. *)
")
quote(MLI,"(** Returns the arity of the local cache. *)")
int arity(cache__t cache)
quote(call,"_res = cache->arity;");
quote(MLI,"(** Clears the content of the local cache. *)")
void clear(cache__t cache)
quote(call,"cuddauxCacheClear(cache);");
quote(ML,"
let create ?(size=0) ?(maxsize=max_int) ~arity =
_create arity size maxsize
let create1 ?size ?maxsize () =
(create ?size ?maxsize ~arity:1)
let create2 ?size ?maxsize () =
(create ?size ?maxsize ~arity:2)
let create3 ?size ?maxsize () =
(create ?size ?maxsize ~arity:3)
")