PageRenderTime 46ms CodeModel.GetById 20ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/ocaml/strings_test/runme.ml

#
OCaml | 17 lines | 14 code | 2 blank | 1 comment | 0 complexity | f7f31c437c9820603a1bbea0f71ba6dc MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
  1. (* This example is meant to reach every case in cstring.i *)
  2. open Swig
  3. open Example
  4. let _ = _takes_std_string (C_string "foo")
  5. let _ = print_endline
  6. ("_gives_std_string <<" ^ (get_string (_gives_std_string C_void)) ^ " >>")
  7. let _ = _takes_char_ptr (C_string "bar")
  8. let _ = print_endline
  9. ("_gives_char_ptr << " ^ (get_string (_gives_char_ptr C_void)) ^ " >>")
  10. let _ = print_endline
  11. ("_takes_and_gives_std_string << " ^
  12. (get_string (_takes_and_gives_std_string (C_string "foo"))) ^ " >>")
  13. let _ = print_endline
  14. ("_takes_and_gives_char_ptr << " ^
  15. (get_string (_takes_and_gives_char_ptr (C_string "bar.bar"))) ^ " >>")