1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/* libproxy.i */ %module Libproxy %{ #include "../../libproxy/proxy.h" %} %typemap(out) char ** { VALUE arr = rb_ary_new2(255); int i; for (i=0; $1[i]; i++) { rb_ary_push(arr, rb_str_new2($1[i])); } $result = arr; } %typemap(freearg) char ** { free($source); } %include "../../libproxy/proxy.h"