On Jun 14, 2006, at 9:05 PM, ruz wrote:
Hi.
I'm trying to embed perl into C programm.
In C function I have tMyStruct* xxx and want bless this pointer into
class 'MyStruct' and pass this object as argument into perl function.
I really don't understand how to write something like "bless
$ref_to_xxx, 'MyStruct'". Could give me small example or pointer to a
code where it's implemented.
The magic you want involves using sv_setref_pv() in a typemap.
See the sections "Perl Objects and C Structures" and "The Typemap" in
the perlxs manpage, and the sv_setref_pv() entry in the perlapi manpage.
--
However, like all drugs, PANEXA can produce some notable side
effects, all of which are probably really, really terrific and
nothing that anyone should be concerned about, let alone notify any
medical regulatory commission about.
-- http://www.panexa.com