Fix and make mruby work better
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
open Ctypes
|
||||
open Foreign
|
||||
|
||||
let _mrb_open = foreign "mrb_open" (void @-> returning (ptr Types.Mrb_state.typ))
|
||||
let mrb_open = _mrb_open ()
|
||||
let mrb_close = foreign "mrb_close" (ptr Types.Mrb_state.typ @-> returning void)
|
||||
|
||||
let mrb_print_error =
|
||||
foreign "mrb_print_error" (ptr Types.Mrb_state.typ @-> returning void)
|
||||
|
||||
(* TODO: bind module definition and adding functions to the module thing here somehow. *)
|
||||
|
||||
let mrb_load_string =
|
||||
foreign "mrb_load_string"
|
||||
(ptr Types.Mrb_state.typ @-> string @-> returning void)
|
||||
|
||||
let error_check mrb_ptr =
|
||||
if Types.Mrb_state.has_error mrb_ptr then begin
|
||||
mrb_print_error mrb_ptr;
|
||||
Types.Mrb_state.clear_error mrb_ptr
|
||||
end
|
||||
Reference in New Issue
Block a user