in reply to Perl API,external C library and blessing a hashref
Something like
Then you can get the "info" structure from the hashref via mg_find().thv = (HV*)sv_2mortal((SV*)newHV()); sv = newSViv((IV)info); sv_magic((SV*)thv, sv, '~', "CTlib", 5); SvRMAGICAL_on((SV*)thv); rv = newRV((SV*)thv); stash = gv_stashpv("Sybase::CTlib::_attribs", TRUE); (void)sv_bless(rv, stash);
Note that this code is pretty old, and there might be better ways to do this sort of things in more recent versions of perl.
Michael
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Perl API,external C library and blessing a hashref
by bakunin (Scribe) on May 19, 2004 at 17:15 UTC | |
by mpeppler (Vicar) on May 19, 2004 at 17:52 UTC |