From ef312564ca84a2b49fc291434d8fb2f8501bb618 Mon Sep 17 00:00:00 2001 From: Sébastien Dailly Date: Tue, 15 Nov 2016 13:00:01 +0100 Subject: Initial commit --- stub/ocaml.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 stub/ocaml.h (limited to 'stub/ocaml.h') 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 +#include +#include +#include +#include + +#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 -- cgit v1.2.3