1 /* -----------------------------------------------------------------------------
2 * See the LICENSE file for information on copyright, usage and redistribution
3 * of SWIG, and the README file for authors - http://www.swig.org/release.html.
7 * SWIG Configuration File for Ocaml
8 * ----------------------------------------------------------------------------- */
11 #define SWIGSTATIC static
14 /* Insert common stuff */
15 %insert(runtime) "swigrun.swg"
18 %insert(runtime) "ocamldec.swg"
20 /* Type registration */
21 %insert(init) "swiginit.swg"
22 %insert(init) "typeregister.swg"
25 val swig_val : c_enum_type -> c_obj -> Swig.c_obj
29 let rec swig_val t v =
31 C_enum e -> enum_to_int t v
32 | C_list l -> Swig.C_list (List.map (swig_val t) l)
33 | C_array a -> Swig.C_array (Array.map (swig_val t) a)
37 /*#ifndef SWIG_NOINCLUDE*/
38 %insert(runtime) "ocaml.swg"
41 %insert(classtemplate) "class.swg"
44 #define SWIG_malloc(size) swig_malloc(size, FUNC_NAME)
45 #define SWIG_free(mem) free(mem)
47 /* Read in standard typemaps. */
50 %include <typecheck.i>
51 %include <exception.i>
52 %include <preamble.swg>
55 /* There's no need to use this, because of my rewriting machinery. C++
56 * words never collide with ocaml keywords */
58 /* still we include the file, but the warning says that the offending
59 name will be properly renamed. Just to let the user to know about
61 %include <ocamlkw.swg>