summaryrefslogtreecommitdiffstats
path: root/testsuite/tests/lib-dynlink-native/plugin_ref.ml
blob: df98431bd25a3da24a36f59bc382b5d5e7814bfc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
(***********************************************************************)
(*                                                                     *)
(*                                OCaml                                *)
(*                                                                     *)
(*                        Alain Frisch, LexiFi                         *)
(*                                                                     *)
(*  Copyright 2007 Institut National de Recherche en Informatique et   *)
(*  en Automatique.  All rights reserved.  This file is distributed    *)
(*  under the terms of the Q Public License version 1.0.               *)
(*                                                                     *)
(***********************************************************************)

let x = ref 0

let () =
  Api.reg_mod "Plugin_ref";

  Api.add_cb
    (fun () ->
       Printf.printf "current value for ref = %i\n" !x;
       incr x
    )