Mark Shelor wrote:
> I recently wrote a Perl extension in which h2xs pretty much handled all
> the XS details for me. I now need to go back and access C struct
> members from within Perl if possible.
>
> The typemap file indicates that my struct pointer (SHA *) got mapped as
> a T_PTROBJ. Is there any way I can use this info to do reads and writes
> on the various struct members? Or, do I need to go back and write
> accessor routines in C?
>
> TIA, Mark
>
I was involved in some discussion of Inline::Struct about a week ago -
though I don't profess to know much about it. It's not yet recommended
for production, but it might be useful to you. (It uses the Inline and
Inline::C modules to enable direct reads and writes on C struct members
form perl.) If you think it might be useful then first check out the
*entire* thread "Help w/ Inline::Struct" on the Inline mailing list
archives - see
http://lists.perl.org, click on the link to Inline, then
on the link to the Archive.
Reading that thread should give you a fair idea of what you need to do
if you want to make use of Inline::Struct.
I think it turned out to be insufficiently versatile for the purposes of
the OP, and he concluded that he would have to write accessor routines
in C - which is an option you've mentioned, and is the only additional
option I'm aware of .... but faik, there could be others
Cheers,
Rob
--
To reply by email u have to take out the u in kalinaubears.