1996-11-08 06:47:40 -08:00
|
|
|
#include <string.h>
|
1997-03-17 05:00:55 -08:00
|
|
|
#include <mlvalues.h>
|
|
|
|
#include <callback.h>
|
1996-11-08 06:47:40 -08:00
|
|
|
|
|
|
|
/* Functions callable directly from C */
|
|
|
|
|
|
|
|
int fib(int n)
|
|
|
|
{
|
|
|
|
value * fib_closure = caml_named_value("fib");
|
|
|
|
return Int_val(callback(*fib_closure, Val_int(n)));
|
|
|
|
}
|
|
|
|
|
|
|
|
char * format_result(int n)
|
|
|
|
{
|
|
|
|
value * format_result_closure = caml_named_value("format_result");
|
|
|
|
return strdup(String_val(callback(*format_result_closure, Val_int(n))));
|
|
|
|
}
|