Commits

Yosuke Onoue  committed c132472

add restype

  • Participants
  • Parent commits eaa25e1

Comments (0)

Files changed (1)

     util = create_module(module_name + '.util', 'util', lib, path)
     util.__dict__['otypes'] = mod
     mod.__dict__['util'] = util
-    mod.context.caml_named_value.restype = mod.ml_value_p
+
+    # alloc.h
+    mod.context.caml_alloc.restype = mod.ml_value
+    mod.context.caml_alloc_small.restype = mod.ml_value
+    mod.context.caml_alloc_tuple.restype = mod.ml_value
+    mod.context.caml_alloc_string.restype = mod.ml_value
+    mod.context.caml_copy_string.restype = mod.ml_value
+    mod.context.caml_copy_string_array.restype = mod.ml_value
+    mod.context.caml_copy_double.restype = mod.ml_value
+    mod.context.caml_copy_int32.restype = mod.ml_value
+    mod.context.caml_copy_int64.restype = mod.ml_value
+    mod.context.caml_copy_nativeint.restype = mod.ml_value
+    mod.context.caml_alloc_array.restype = mod.ml_value
+    mod.context.caml_alloc_final.restype = mod.ml_value
+    mod.context.caml_convert_flag_list = ctypes.c_int
+
+    # callback.h
     mod.context.caml_callback.restype = mod.ml_value
     mod.context.caml_callback2.restype = mod.ml_value
     mod.context.caml_callback3.restype = mod.ml_value
-    mod.context.caml_alloc.restype = mod.ml_value
+    mod.context.caml_callbackN.restype = mod.ml_value
+    mod.context.caml_callback_exn.restype = mod.ml_value
+    mod.context.caml_callback2_exn.restype = mod.ml_value
+    mod.context.caml_callback3_exn.restype = mod.ml_value
+    mod.context.caml_callbackN_exn.restype = mod.ml_value
+    mod.context.caml_named_value.restype = mod.ml_value_p
+    mod.context.caml_main.restype = None
+    mod.context.caml_startup.restype = None
+
+    # custom.h
+    mod.context.caml_alloc_custom.restype = mod.ml_value
+    mod.context.caml_register_custom_operations.restype = None
+    #mod.context.caml_compare_unordered.restype = ctypes.c_int
+
+    # fail.h
+    mod.context.caml_raise.restype = None
+    mod.context.caml_raise_constant.restype = None
+    mod.context.caml_raise_with_arg.restype = None
+    mod.context.caml_raise_with_args.restype = None
+    mod.context.caml_raise_with_string.restype = None
+    mod.context.caml_failwith.restype = None
+    mod.context.caml_invalid_argument.restype = None
+    mod.context.caml_raise_out_of_memory.restype = None
+    mod.context.caml_raise_stack_overflow.restype = None
+    mod.context.caml_raise_sys_error.restype = None
+    mod.context.caml_raise_end_of_file.restype = None
+    mod.context.caml_raise_zero_divide.restype = None
+    mod.context.caml_raise_not_found.restype = None
+    #mod.context.caml_init_exceptions.restype = None
+    mod.context.caml_array_bound_error.restype = None
+    mod.context.caml_raise_sys_blocked_io.restype = None
+
+    # intext.h
+    # TODO
+
+    # memory.h
+    mod.context.caml_alloc_shr.restype = mod.ml_value
+    mod.context.caml_adjust_gc_speed.restype = None
+    mod.context.caml_alloc_dependent_memory.restype = None
+    mod.context.caml_free_dependent_memory.restype = None
+    mod.context.caml_modify.restype = None
+    mod.context.caml_initialize.restype = None
+    mod.context.caml_check_urgent_gc.restype = mod.ml_value
+    mod.context.caml_stat_alloc.restype = ctypes.c_void_p
+    mod.context.caml_stat_free.restype = None
+    mod.context.caml_stat_resize.restype = ctypes.c_void_p
+    mod.context.caml_register_global_root.restype = None
+    mod.context.caml_remove_global_root.restype = None
+    #mod.context.caml_register_generation_global_root.restype = None
+    #mod.context.caml_remove_generation_global_root.restype = None
+    #mod.context.caml_modify_generation_global_root.restype = None
+
+    # mlvalues.h
+    mod.context.caml_get_public_method.restype = mod.ml_value
+    #mod.context.caml_hash_variant.restype = mod.ml_value
     mod.context.caml_string_length.restype = mod.ml_mlsize_t
+    #mod.context.caml_Double_val.restype = ctypes.c_double
+    #mod.context.caml_Store_double_val.restype = None
+    #mod.context.caml_Int64_val.restype = mod.ml_int64