swig/Examples/ocaml/string_from_ptr/foolib.i
Art Yerkes 4639f09df5 Added string-from-ptr example.
-- Response to a question asked by Thaddeus L. Olczyk


git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@5489 626c5289-ae23-0410-ae9c-e8d60b6d4f22
2003-12-05 22:58:56 +00:00

16 lines
296 B
OpenEdge ABL

%module foolib
%{
static int foo( char **buf ) {
*buf = "string from c";
return 0;
}
%}
%typemap(in,numinputs=0) char **buf (char *temp) {
$1 = &temp;
}
%typemap(argout) char **buf {
swig_result = caml_list_append(swig_result,caml_val_string((char *)*$1));
}
int foo( char **buf );