test/Testcb.java
raw| 1 | import fr.inria.caml.camljava.Callback; |
| 2 | |
| 3 | class Testcb { |
| 4 | private Callback cb; |
| 5 | private static long _f = Callback.getCamlMethodID("f"); |
| 6 | private static long _g = Callback.getCamlMethodID("g"); |
| 7 | public Testcb(Callback c) { cb = c; } |
| 8 | public void f() |
| 9 | { Object[] args = { }; cb.callVoid(_f, args); } |
| 10 | public int g(int x) |
| 11 | { Object[] args = { new fr.inria.caml.camljava.Camlint(x) }; |
| 12 | return cb.callCamlint(_g, args); } |
| 13 | } |