[GRASS-user] Question with Python-SWIG example [SEC=UNCLASSIFIED]
Andrew MacIntyre
Andrew.MacIntyre at acma.gov.au
Tue May 11 22:38:07 EDT 2010
> > That seems to be what the SWIG Pointer Library function ptrcast() is
> > for,
> > according to http://www.swig.org/Doc1.1/HTML/Typemaps.html, so
> > something like (in Python):
> >
> > import GrassMod
> > pCELL = GrassMod.Returns_CELLptr()
> > pvoid = GrassMod.castptr(pCELL, "void *")
>
> above line should read:
> pvoid = GrassMod.ptrcast(pCELL, "void *")
>
> > result = GrassMod.Takes_voidptr(pvoid)
> >
> > (substitute the correct name of the GRASS SWIG module for
"GrassMod")
Just noticed that the docco I referenced was for SWIG 1.1, so the above
is probably moot.
However, the 2nd para of s5.3.2 of the SWIG 1.3 documentation at
http://www.swig.org/Doc1.3/SWIG.html#SWIG_nn17 states
"Like C, void * matches any kind of pointer."
which suggests to me that the casts from CELL*/FCELL*/DCELL to void*
would be implicitly performed anyway - be worth testing.
Cheers,
Andrew.
-------------------------> "These thoughts are mine alone!" <---------
Andrew MacIntyre Operations Branch
tel: +61 2 6219 5356 Communications Infrastructure Division
fax: +61 2 6253 3277 Australian Communications & Media Authority
email: andrew.macintyre at acma.gov.au http://www.acma.gov.au/
If you have received this email in error, please notify the sender immediately and erase all copies of the email and any attachments to it. The information contained in this email and any attachments may be private, confidential and legally privileged or the subject of copyright. If you are not the addressee it may be illegal to review, disclose, use, forward, or distribute this email and/or its contents.
Unless otherwise specified, the information in the email and any attachments is intended as a guide only and should not be relied upon as legal or technical advice or regarded as a substitute for legal or technical advice in individual cases. Opinions contained in this email or any of its attachments do not necessarily reflect the opinions of ACMA.
More information about the grass-user
mailing list