aboutsummaryrefslogtreecommitdiff
path: root/stub/ocaml.h
diff options
context:
space:
mode:
Diffstat (limited to 'stub/ocaml.h')
-rwxr-xr-xstub/ocaml.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/stub/ocaml.h b/stub/ocaml.h
new file mode 100755
index 0000000..6d26382
--- /dev/null
+++ b/stub/ocaml.h
@@ -0,0 +1,28 @@
+#ifndef OC__STUB_OCAML_H
+
+#include <caml/custom.h>
+#include <caml/memory.h>
+#include <caml/alloc.h>
+#include <caml/fail.h>
+#include <caml/mlvalues.h>
+
+#define Val_none Val_int(0)
+
+value get_opt(value opt, int index);
+
+/**
+ * Convert a « string option » to char* or Null
+ */
+char* string_opt(const value opt);
+
+/**
+ * Store the given value as an option.
+ */
+value Val_some(value v);
+
+/**
+ * Create a field of one element containing the value v.
+ */
+value Val_1field(value v);
+
+#endif