Commits

camlspotter committed 080a75a

from_python_c.c added

Comments (0)

Files changed (1)

+#include "api_ml.h"
+
+extern PyMethodDef OPyCamlMethods[];
+
+char *argv0 = "from python"; // Ugly hack for ocaml to distinguish whether the main is Python or OCaml
+
+PyMODINIT_FUNC initopycaml(void)
+{
+    fprintf(stderr, "OPyCaml initopycaml\n");
+    
+    char *argv[2];
+    argv[0] = argv0;
+    argv[1] = NULL;
+
+    caml_startup(argv);
+}