/* A C main() that owns the process and starts the OCaml runtime underneath it. */ #include #include #include int main(int argc, char **argv) { (void)argc; caml_startup(argv); const value *f = caml_named_value("spike_greet"); if (!f) { fprintf(stderr, "spike: greet not registered\n"); return 1; } printf("%s\n", String_val(caml_callback(*f, Val_int(42)))); printf("spike: C main still owns the process\n"); return 0; }