PageRenderTime 41ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/trunk/Lib/ocaml/ocamldec.swg

#
Unknown | 169 lines | 132 code | 37 blank | 0 comment | 0 complexity | 3e8f38fcb0c631210fba88133a5703af MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. /* -----------------------------------------------------------------------------
  2. * ocamldec.swg
  3. *
  4. * Ocaml runtime code -- declarations
  5. * ----------------------------------------------------------------------------- */
  6. #include <stdio.h>
  7. #include <string.h>
  8. #include <stdlib.h>
  9. #ifdef __cplusplus
  10. #define SWIGEXT extern "C"
  11. SWIGEXT {
  12. #else
  13. #define SWIGEXT
  14. #endif
  15. #define value caml_value_t
  16. #define CAML_VALUE caml_value_t
  17. #include <caml/alloc.h>
  18. #include <caml/custom.h>
  19. #include <caml/mlvalues.h>
  20. #include <caml/memory.h>
  21. #include <caml/callback.h>
  22. #include <caml/fail.h>
  23. #include <caml/misc.h>
  24. #define caml_array_set swig_caml_array_set
  25. // Adapted from memory.h and mlvalues.h
  26. #define SWIG_CAMLlocal1(x) \
  27. caml_value_t x = 0; \
  28. CAMLxparam1 (x)
  29. #define SWIG_CAMLlocal2(x, y) \
  30. caml_value_t x = 0, y = 0; \
  31. CAMLxparam2 (x, y)
  32. #define SWIG_CAMLlocal3(x, y, z) \
  33. caml_value_t x = 0, y = 0, z = 0; \
  34. CAMLxparam3 (x, y, z)
  35. #define SWIG_CAMLlocal4(x, y, z, t) \
  36. caml_value_t x = 0, y = 0, z = 0, t = 0; \
  37. CAMLxparam4 (x, y, z, t)
  38. #define SWIG_CAMLlocal5(x, y, z, t, u) \
  39. caml_value_t x = 0, y = 0, z = 0, t = 0, u = 0; \
  40. CAMLxparam5 (x, y, z, t, u)
  41. #define SWIG_CAMLlocalN(x, size) \
  42. caml_value_t x [(size)] = { 0, /* 0, 0, ... */ }; \
  43. CAMLxparamN (x, (size))
  44. #define SWIG_Field(x, i) (((caml_value_t *)(x)) [i]) /* Also an l-value. */
  45. #define SWIG_Store_field(block, offset, val) do{ \
  46. mlsize_t caml__temp_offset = (offset); \
  47. caml_value_t caml__temp_val = (val); \
  48. modify (&SWIG_Field ((block), caml__temp_offset), caml__temp_val); \
  49. }while(0)
  50. #define SWIG_Data_custom_val(v) ((void *) &SWIG_Field((v), 1))
  51. #ifdef ARCH_BIG_ENDIAN
  52. #define SWIG_Tag_val(val) (((unsigned char *) (val)) [-1])
  53. /* Also an l-value. */
  54. #define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [sizeof(caml_value_t)-1])
  55. /* Also an l-value. */
  56. #else
  57. #define SWIG_Tag_val(val) (((unsigned char *) (val)) [-sizeof(caml_value_t)])
  58. /* Also an l-value. */
  59. #define SWIG_Tag_hp(hp) (((unsigned char *) (hp)) [0])
  60. /* Also an l-value. */
  61. #endif
  62. #ifdef CAMLreturn0
  63. #undef CAMLreturn0
  64. #endif
  65. #define CAMLreturn0 do{ \
  66. caml_local_roots = caml__frame; \
  67. return; \
  68. }while (0)
  69. #ifdef CAMLreturn
  70. #undef CAMLreturn
  71. #endif
  72. #define CAMLreturn(result) do{ \
  73. caml_value_t caml__temp_result = (result); \
  74. caml_local_roots = caml__frame; \
  75. return (caml__temp_result); \
  76. }while(0)
  77. #define CAMLreturn_type(result) do{ \
  78. caml_local_roots = caml__frame; \
  79. return result; \
  80. }while(0)
  81. #ifdef CAMLnoreturn
  82. #undef CAMLnoreturn
  83. #endif
  84. #define CAMLnoreturn ((void) caml__frame)
  85. #ifndef ARCH_ALIGN_INT64
  86. #define SWIG_Int64_val(v) (*((int64 *) SWIG_Data_custom_val(v)))
  87. #else
  88. CAMLextern int64 Int64_val(caml_value_t v);
  89. #define SWIG_Int64_val(v) Int64_val(v)
  90. #endif
  91. #define SWIG_NewPointerObj(p,type,flags) caml_val_ptr(p,type)
  92. #define SWIG_GetModule(clientdata) SWIG_Ocaml_GetModule()
  93. #define SWIG_SetModule(clientdata, pointer) SWIG_Ocaml_SetModule(pointer)
  94. #define SWIG_contract_assert(expr, msg) if(!(expr)) {failwith(msg);} else
  95. SWIGSTATIC int
  96. SWIG_GetPtr(void *source, void **result, swig_type_info *type, swig_type_info *result_type);
  97. SWIGSTATIC void *
  98. SWIG_MustGetPtr (CAML_VALUE v, swig_type_info *type);
  99. SWIGSTATIC CAML_VALUE _wrap_delete_void( CAML_VALUE );
  100. SWIGSTATIC int enum_to_int( char *name, CAML_VALUE v );
  101. SWIGSTATIC CAML_VALUE int_to_enum( char *name, int v );
  102. SWIGSTATIC CAML_VALUE caml_list_nth( CAML_VALUE lst, int n );
  103. SWIGSTATIC CAML_VALUE caml_list_append( CAML_VALUE lst, CAML_VALUE elt );
  104. SWIGSTATIC int caml_list_length( CAML_VALUE lst );
  105. SWIGSTATIC CAML_VALUE caml_array_new( int n );
  106. SWIGSTATIC void caml_array_set( CAML_VALUE arr, int n, CAML_VALUE item );
  107. SWIGSTATIC CAML_VALUE caml_array_nth( CAML_VALUE arr, int n );
  108. SWIGSTATIC int caml_array_length( CAML_VALUE arr );
  109. SWIGSTATIC CAML_VALUE caml_val_char( char c );
  110. SWIGSTATIC CAML_VALUE caml_val_uchar( unsigned char c );
  111. SWIGSTATIC CAML_VALUE caml_val_short( short s );
  112. SWIGSTATIC CAML_VALUE caml_val_ushort( unsigned short s );
  113. SWIGSTATIC CAML_VALUE caml_val_int( int x );
  114. SWIGSTATIC CAML_VALUE caml_val_uint( unsigned int x );
  115. SWIGSTATIC CAML_VALUE caml_val_long( long x );
  116. SWIGSTATIC CAML_VALUE caml_val_ulong( unsigned long x );
  117. SWIGSTATIC CAML_VALUE caml_val_float( float f );
  118. SWIGSTATIC CAML_VALUE caml_val_double( double d );
  119. SWIGSTATIC CAML_VALUE caml_val_ptr( void *p, swig_type_info *descriptor );
  120. SWIGSTATIC CAML_VALUE caml_val_string( const char *str );
  121. SWIGSTATIC CAML_VALUE caml_val_string_len( const char *str, int len );
  122. SWIGSTATIC long caml_long_val( CAML_VALUE v );
  123. SWIGSTATIC double caml_double_val( CAML_VALUE v );
  124. SWIGSTATIC int caml_ptr_val_internal( CAML_VALUE v, void **out,
  125. swig_type_info *descriptor );
  126. SWIGSTATIC void *caml_ptr_val( CAML_VALUE v, swig_type_info *descriptor );
  127. SWIGSTATIC char *caml_string_val( CAML_VALUE v );
  128. SWIGSTATIC int caml_string_len( CAML_VALUE v );
  129. #ifdef __cplusplus
  130. }
  131. #endif
  132. /* mzschemedec.swg ends here */