1996-11-02 10:04:42 -08:00
|
|
|
#include "mlvalues.h"
|
|
|
|
#include "memory.h"
|
1997-03-17 02:18:39 -08:00
|
|
|
#include "callback.h"
|
1995-12-20 02:39:12 -08:00
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
value mycallback1(value fun, value arg)
|
1995-12-20 02:39:12 -08:00
|
|
|
{
|
|
|
|
value res;
|
|
|
|
res = callback(fun, arg);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
value mycallback2(value fun, value arg1, value arg2)
|
1995-12-20 02:39:12 -08:00
|
|
|
{
|
|
|
|
value res;
|
|
|
|
res = callback2(fun, arg1, arg2);
|
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
value mycallback3(value fun, value arg1, value arg2, value arg3)
|
1995-12-20 02:39:12 -08:00
|
|
|
{
|
|
|
|
value res;
|
|
|
|
res = callback3(fun, arg1, arg2, arg3);
|
1999-01-15 08:59:06 -08:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
|
|
|
value mycallback4(value fun, value arg1, value arg2, value arg3, value arg4)
|
|
|
|
{
|
|
|
|
value args[4];
|
|
|
|
value res;
|
|
|
|
args[0] = arg1;
|
|
|
|
args[1] = arg2;
|
|
|
|
args[2] = arg3;
|
|
|
|
args[3] = arg4;
|
|
|
|
res = callbackN(fun, 4, args);
|
1995-12-20 02:39:12 -08:00
|
|
|
return res;
|
|
|
|
}
|
|
|
|
|
1997-09-02 05:55:01 -07:00
|
|
|
value mypushroot(value v, value fun, value arg)
|
1995-12-20 02:39:12 -08:00
|
|
|
{
|
2000-04-20 09:19:55 -07:00
|
|
|
Begin_root(v)
|
|
|
|
callback(fun, arg);
|
|
|
|
End_roots();
|
1995-12-20 02:39:12 -08:00
|
|
|
return v;
|
|
|
|
}
|
1999-11-20 07:04:56 -08:00
|
|
|
|
|
|
|
value mycamlparam (value v, value fun, value arg)
|
|
|
|
{
|
|
|
|
CAMLparam3 (v, fun, arg);
|
|
|
|
CAMLlocal2 (x, y);
|
|
|
|
x = v;
|
|
|
|
y = callback (fun, arg);
|
|
|
|
v = x;
|
1999-11-29 11:48:02 -08:00
|
|
|
CAMLreturn (v);
|
1999-11-20 07:04:56 -08:00
|
|
|
}
|