bakunin has asked for the wisdom of the Perl Monks concerning the following question:
package Foo; ## Inline part skipped. __C__ SV* new() { HV* hv = newHV(); Foo* foo = newFoo(); //C constructor. // Now, do something with hv and foo, then return blessed_hashref; } void setName(SV* obj, char* name) { Foo* foo = get_foo_from(obj); // and call the Foo-C method: Foo_set_name(foo); } package main; my $foo = Foo->new(); $foo->setName("Lorelai"); $foo->{shortname} = "Rory";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Perl API,external C library and blessing a hashref
by mpeppler (Vicar) on May 19, 2004 at 16:10 UTC | |
by bakunin (Scribe) on May 19, 2004 at 17:15 UTC | |
by mpeppler (Vicar) on May 19, 2004 at 17:52 UTC |