/trunk/Examples/ocaml/string_from_ptr/foolib.i
Swig | 16 lines | 14 code | 2 blank | 0 comment | 0 complexity | dc415486546b099c7ed2f66836fdce74 MD5 | raw file
Possible License(s): LGPL-2.1, Cube, GPL-3.0, 0BSD, GPL-2.0
- %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 );