Rename interpretor to interpreter.
[Faustine.git] / interpreter / preprocess_stubs.cpp
diff --git a/interpreter/preprocess_stubs.cpp b/interpreter/preprocess_stubs.cpp
new file mode 100644 (file)
index 0000000..baa5094
--- /dev/null
@@ -0,0 +1,32 @@
+#include <iostream>
+#include <string>
+#include "preprocess.hh"
+
+extern "C" {
+#include <caml/memory.h>
+#include <caml/mlvalues.h>
+#include <caml/alloc.h>
+}
+
+using namespace std;
+
+/*
+extern "C" value preProcess_cpp (value v_str){
+    CAMLparam1 (v_str);
+    CAMLlocal1 (ml_s);
+    char* s;
+    s = preProcess(String_val(v_str));
+    ml_s = caml_copy_string(s);
+    CAMLreturn (ml_s);
+}
+*/
+
+extern "C" value preProcess_cpp (value v_str){
+  CAMLparam1 (v_str);
+  CAMLlocal1 (ml_s);
+  string dsp_file = string(String_val(v_str));
+  char* dsp_file_c = (char*)dsp_file.c_str();
+  char* s = preProcess(dsp_file_c);
+  ml_s = caml_copy_string(s);
+  CAMLreturn (ml_s);
+}