aboutsummaryrefslogtreecommitdiff
path: root/stub/ocaml.h
blob: 6d2638245490206303b900daa4c160ab75351012 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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