[geos-devel] c api questions for SWIG
Charlie Savage
cfis at savagexi.com
Mon Jul 10 17:13:28 EDT 2006
While I'm working through the SWIG bindings, I've come up with a few
questions/issues about the c api.
1. GEOSGeomTypeId. This is both a method name in the CAPI and the name
of an enum. This causes problems in the SWIG bindings because I have
code that does this:
GEOSGeomTypeIdgeomId = (GEOSGeomTypeId)GEOSGeomTypeId(geom);
switch (geomId)
{
case GEOS_POINT:
case GEOS_LINESTRING:
etc.
}
VC++ won't compile this code (haven't checked gcc). However, it seems
like a bad idea to have the same identifier used for two different
things. Can we change the name of the enum to something like GeomTypeID?
2. Message handlers have this signature:
typedef void (*GEOSMessageHandler)(const char *fmt, ...);
Are the ... parameters ever used (I didn't see any place where they
were). If they are used, what are they? If not, should they be removed?
3. Init/Finish. In SWIG I can automatically call initGEOS and install
the message handlers. But I don't know of a way to call finishGEOS
automatically. What happens if the SWIG bindings don't call it?
Thanks,
Charlie
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3237 bytes
Desc: S/MIME Cryptographic Signature
Url : http://lists.osgeo.org/pipermail/geos-devel/attachments/20060710/9801572d/smime.bin
More information about the geos-devel
mailing list