I have found using SWIG (www.swig.org) is very convenient and it generate high quality wrapper code. Better, with the C++ option, it will a set of Perl modules with a parallel inheritance hierarchy. Even if you do not end up using the generated wrapper, it provides useful examples of XS code for complex objects.

hth,
Charlie

At 03:08 PM 1/10/2003 +0700, Komtanoo Pinpimai wrote:
Hello,

I've started learning XS technology, I know howto pass/return primitive data, such as int,scalar,array..
The problem is howto pass/return C struct,

For example, in the XS file, I have:

c_object=c_create_object(); # in function MyTest::new_object

and I want to return the "c_object" to perl to be able to pass it to C again to use like this:

printf("--- %s\n",c_object->str); #in function MyTest::display
use_object(c_object,3);

What type should I map to c_object the typemap file or it is not possible !?

--
$_=`perldoc -U -q "What is a"`;m/"(.*?)"/;print$1



_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm
_______________________________________________
Boston-pm mailing list
[EMAIL PROTECTED]
http://mail.pm.org/mailman/listinfo/boston-pm


Reply via email to