PageRenderTime 9ms CodeModel.GetById 7ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/trunk/Examples/ocaml/string_from_ptr/foolib.i

#
Swig | 16 lines | 14 code | 2 blank | 0 comment | 0 complexity | dc415486546b099c7ed2f66836fdce74 MD5 | raw file
 1%module foolib
 2%{
 3static int foo( char **buf ) {
 4  *buf = "string from c";
 5  return 0;
 6}
 7%}
 8
 9%typemap(in,numinputs=0) char **buf (char *temp) {
10    $1 = &temp;
11}
12%typemap(argout) char **buf {
13    swig_result = caml_list_append(swig_result,caml_val_string((char *)*$1));
14}
15
16int foo( char **buf );