1. camlspotter
  2. opycaml

Commits

camlspotter  committed 080a75a

from_python_c.c added

  • Participants
  • Parent commits 747df4b
  • Branches dev

Comments (0)

Files changed (1)

File from_python_c.c

View file
+#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);
+}