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 * Ocaml runtime code -- declarations
8 * ----------------------------------------------------------------------------- */
15 #define SWIGEXT extern "C"
20 #define value caml_value_t
21 #define CAML_VALUE caml_value_t
22 #include <caml/alloc.h>
23 #include <caml/custom.h>
24 #include <caml/mlvalues.h>
25 #include <caml/memory.h>
26 #include <caml/callback.h>
27 #include <caml/fail.h>
28 #include <caml/misc.h>
30 #define caml_array_set swig_caml_array_set
32 // Adapted from memory.h and mlvalues.h
34 #define SWIG_CAMLlocal1(x) \
38 #define SWIG_CAMLlocal2(x, y) \
39 caml_value_t x = 0, y = 0; \
42 #define SWIG_CAMLlocal3(x, y, z) \
43 caml_value_t x = 0, y = 0, z = 0; \
46 #define SWIG_CAMLlocal4(x, y, z, t) \
47 caml_value_t x = 0, y = 0, z = 0, t = 0; \
48 CAMLxparam4 (x, y, z, t)
50 #define SWIG_CAMLlocal5(x, y, z, t, u) \
51 caml_value_t x = 0, y = 0, z = 0, t = 0, u = 0; \
52 CAMLxparam5 (x, y, z, t, u)
54 #define SWIG_CAMLlocalN(x, size) \
55 caml_value_t x [(size)] = { 0, /* 0, 0, ... */ }; \
56 CAMLxparamN (x, (size))
58 #define SWIG_Field(x, i) (((caml_value_t *)(x)) [i]) /* Also an l-value. */
59 #define SWIG_Store_field(block, offset, val) do{ \
60 mlsize_t caml__temp_offset = (offset); \
61 caml_value_t caml__temp_val = (val); \
62 modify (&SWIG_Field ((block), caml__temp_offset), caml__temp_val); \
65 #define SWIG_Data_custom_val(v) ((void *) &SWIG_Field((v), 1))
66 #ifdef ARCH_BIG_ENDIAN
67 #define SWIG_Tag_val(val) (((unsigned char *) (val)) [-1])
68 /* Also an l-value. */
69 #define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [sizeof(caml_value_t)-1])
70 /* Also an l-value. */
72 #define SWIG_Tag_val(val) (((unsigned char *) (val)) [-sizeof(caml_value_t)])
73 /* Also an l-value. */
74 #define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [0])
75 /* Also an l-value. */
81 #define CAMLreturn0 do{ \
82 caml_local_roots = caml__frame; \
89 #define CAMLreturn(result) do{ \
90 caml_value_t caml__temp_result = (result); \
91 caml_local_roots = caml__frame; \
92 return (caml__temp_result); \
95 #define CAMLreturn_type(result) do{ \
96 caml_local_roots = caml__frame; \
103 #define CAMLnoreturn ((void) caml__frame)
106 #ifndef ARCH_ALIGN_INT64
107 #define SWIG_Int64_val(v) (*((int64 *) SWIG_Data_custom_val(v)))
109 CAMLextern int64 Int64_val(caml_value_t v);
110 #define SWIG_Int64_val(v) Int64_val(v)
113 #define SWIG_NewPointerObj(p,type,flags) caml_val_ptr(p,type)
114 #define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule()
115 #define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer)
117 #define SWIG_contract_assert(expr, msg) if(!(expr)) {failwith(msg);} else
120 SWIG_GetPtr(void *source, void **result, swig_type_info *type, swig_type_info *result_type);
123 SWIG_MustGetPtr (CAML_VALUE v, swig_type_info *type);
125 SWIGSTATIC CAML_VALUE _wrap_delete_void( CAML_VALUE );
127 SWIGSTATIC int enum_to_int( char *name, CAML_VALUE v );
128 SWIGSTATIC CAML_VALUE int_to_enum( char *name, int v );
130 SWIGSTATIC CAML_VALUE caml_list_nth( CAML_VALUE lst, int n );
131 SWIGSTATIC CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt );
132 SWIGSTATIC int caml_list_length( CAML_VALUE lst );
133 SWIGSTATIC CAML_VALUE caml_array_new( int n );
134 SWIGSTATIC void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item );
135 SWIGSTATIC CAML_VALUE caml_array_nth( CAML_VALUE arr, int n );
136 SWIGSTATIC int caml_array_length( CAML_VALUE arr );
138 SWIGSTATIC CAML_VALUE caml_val_char( char c );
139 SWIGSTATIC CAML_VALUE caml_val_uchar( unsigned char c );
141 SWIGSTATIC CAML_VALUE caml_val_short( short s );
142 SWIGSTATIC CAML_VALUE caml_val_ushort( unsigned short s );
144 SWIGSTATIC CAML_VALUE caml_val_int( int x );
145 SWIGSTATIC CAML_VALUE caml_val_uint( unsigned int x );
147 SWIGSTATIC CAML_VALUE caml_val_long( long x );
148 SWIGSTATIC CAML_VALUE caml_val_ulong( unsigned long x );
150 SWIGSTATIC CAML_VALUE caml_val_float( float f );
151 SWIGSTATIC CAML_VALUE caml_val_double( double d );
153 SWIGSTATIC CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor );
155 SWIGSTATIC CAML_VALUE caml_val_string( const char *str );
156 SWIGSTATIC CAML_VALUE caml_val_string_len( const char *str, int len );
158 SWIGSTATIC long caml_long_val( CAML_VALUE v );
159 SWIGSTATIC double caml_double_val( CAML_VALUE v );
161 SWIGSTATIC int caml_ptr_val_internal( CAML_VALUE v, void **out,
162 swig_type_info *descriptor );
163 SWIGSTATIC void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor );
165 SWIGSTATIC char *caml_string_val( CAML_VALUE v );
166 SWIGSTATIC int caml_string_len( CAML_VALUE v );
172 /* mzschemedec.swg ends here */