PageRenderTime 26ms CodeModel.GetById 23ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 1ms

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

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