[geos-commits] r3991 - in trunk: . capi

svn_geos at osgeo.org svn_geos at osgeo.org
Mon Jun 30 07:11:06 PDT 2014


Author: strk
Date: 2014-06-30 07:11:06 -0700 (Mon, 30 Jun 2014)
New Revision: 3991

Modified:
   trunk/NEWS
   trunk/capi/geos_c.h.in
Log:
Allow C-API users to hide non-reentrant section

Define GEOS_USE_ONLY_R_API to obtain a compile-time error when
trying to use non-reentrant functions.

Patch by Even Rouault (#695)

Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2014-06-29 14:50:42 UTC (rev 3990)
+++ trunk/NEWS	2014-06-30 14:11:06 UTC (rev 3991)
@@ -3,6 +3,7 @@
 
 - New things:
   - Voronoi API (#627)
+  - GEOS_USE_ONLY_R_API macro support (#695)
   ...
 
 Changes in 3.4.2

Modified: trunk/capi/geos_c.h.in
===================================================================
--- trunk/capi/geos_c.h.in	2014-06-29 14:50:42 UTC (rev 3990)
+++ trunk/capi/geos_c.h.in	2014-06-30 14:11:06 UTC (rev 3991)
@@ -25,7 +25,9 @@
  *	  all returned char * (unless const).
  *
  *	- Functions ending with _r are thread safe; see details in RFC 3
- *	  http://trac.osgeo.org/geos/wiki/RFC3
+ *	  http://trac.osgeo.org/geos/wiki/RFC3. 
+ *	  To avoid using by accident non _r functions,
+ *	  define GEOS_USE_ONLY_R_API before including geos_c.h
  *
  ***********************************************************************/
 
@@ -148,10 +150,6 @@
 
 #include <geos/export.h>
 
-extern void GEOS_DLL initGEOS(GEOSMessageHandler notice_function,
-	GEOSMessageHandler error_function);
-extern void GEOS_DLL finishGEOS(void);
-
 /*
  * Register an interruption checking callback
  *
@@ -186,9 +184,6 @@
  *
  ***********************************************************************/
 
-extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKT(const char *wkt);
-extern char GEOS_DLL *GEOSGeomToWKT(const GEOSGeometry* g);
-
 extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKT_r(GEOSContextHandle_t handle,
                                                 const char *wkt);
 extern char GEOS_DLL *GEOSGeomToWKT_r(GEOSContextHandle_t handle,
@@ -198,8 +193,6 @@
  * Specify whether output WKB should be 2d or 3d.
  * Return previously set number of dimensions.
  */
-extern int GEOS_DLL GEOS_getWKBOutputDims();
-extern int GEOS_DLL GEOS_setWKBOutputDims(int newDims);
 
 extern int GEOS_DLL GEOS_getWKBOutputDims_r(GEOSContextHandle_t handle);
 extern int GEOS_DLL GEOS_setWKBOutputDims_r(GEOSContextHandle_t handle,
@@ -209,15 +202,7 @@
  * Specify whether the WKB byte order is big or little endian.
  * The return value is the previous byte order.
  */
-extern int GEOS_DLL GEOS_getWKBByteOrder();
-extern int GEOS_DLL GEOS_setWKBByteOrder(int byteOrder);
 
-extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKB_buf(const unsigned char *wkb, size_t size);
-extern unsigned char GEOS_DLL *GEOSGeomToWKB_buf(const GEOSGeometry* g, size_t *size);
-
-extern GEOSGeometry GEOS_DLL *GEOSGeomFromHEX_buf(const unsigned char *hex, size_t size);
-extern unsigned char GEOS_DLL *GEOSGeomToHEX_buf(const GEOSGeometry* g, size_t *size);
-
 extern int GEOS_DLL GEOS_getWKBByteOrder_r(GEOSContextHandle_t handle);
 extern int GEOS_DLL GEOS_setWKBByteOrder_r(GEOSContextHandle_t handle,
                                            int byteOrder);
@@ -247,8 +232,6 @@
  * of ``dims'' dimensions.
  * Return NULL on exception.
  */
-extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_create(unsigned int size, unsigned int dims);
-
 extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_create_r(
                                                 GEOSContextHandle_t handle,
                                                 unsigned int size,
@@ -258,8 +241,6 @@
  * Clone a Coordinate Sequence.
  * Return NULL on exception.
  */
-extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_clone(const GEOSCoordSequence* s);
-
 extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_clone_r(
                                                 GEOSContextHandle_t handle,
                                                 const GEOSCoordSequence* s);
@@ -267,8 +248,6 @@
 /*
  * Destroy a Coordinate Sequence.
  */
-extern void GEOS_DLL GEOSCoordSeq_destroy(GEOSCoordSequence* s);
-
 extern void GEOS_DLL GEOSCoordSeq_destroy_r(GEOSContextHandle_t handle,
                                             GEOSCoordSequence* s);
 
@@ -276,15 +255,6 @@
  * Set ordinate values in a Coordinate Sequence.
  * Return 0 on exception.
  */
-extern int GEOS_DLL GEOSCoordSeq_setX(GEOSCoordSequence* s,
-	unsigned int idx, double val);
-extern int GEOS_DLL GEOSCoordSeq_setY(GEOSCoordSequence* s,
-	unsigned int idx, double val);
-extern int GEOS_DLL GEOSCoordSeq_setZ(GEOSCoordSequence* s,
-	unsigned int idx, double val);
-extern int GEOS_DLL GEOSCoordSeq_setOrdinate(GEOSCoordSequence* s,
-	unsigned int idx, unsigned int dim, double val);
-
 extern int GEOS_DLL GEOSCoordSeq_setX_r(GEOSContextHandle_t handle,
                                         GEOSCoordSequence* s, unsigned int idx,
                                         double val);
@@ -303,15 +273,6 @@
  * Get ordinate values from a Coordinate Sequence.
  * Return 0 on exception.
  */
-extern int GEOS_DLL GEOSCoordSeq_getX(const GEOSCoordSequence* s,
-	unsigned int idx, double *val);
-extern int GEOS_DLL GEOSCoordSeq_getY(const GEOSCoordSequence* s,
-	unsigned int idx, double *val);
-extern int GEOS_DLL GEOSCoordSeq_getZ(const GEOSCoordSequence* s,
-	unsigned int idx, double *val);
-extern int GEOS_DLL GEOSCoordSeq_getOrdinate(const GEOSCoordSequence* s,
-	unsigned int idx, unsigned int dim, double *val);
-
 extern int GEOS_DLL GEOSCoordSeq_getX_r(GEOSContextHandle_t handle,
                                         const GEOSCoordSequence* s,
                                         unsigned int idx, double *val);
@@ -329,11 +290,6 @@
  * Get size and dimensions info from a Coordinate Sequence.
  * Return 0 on exception.
  */
-extern int GEOS_DLL GEOSCoordSeq_getSize(const GEOSCoordSequence* s,
-	unsigned int *size);
-extern int GEOS_DLL GEOSCoordSeq_getDimensions(const GEOSCoordSequence* s,
-	unsigned int *dims);
-
 extern int GEOS_DLL GEOSCoordSeq_getSize_r(GEOSContextHandle_t handle,
                                            const GEOSCoordSequence* s,
                                            unsigned int *size);
@@ -355,28 +311,20 @@
 
 /* Return distance of point 'p' projected on 'g' from origin
  * of 'g'. Geometry 'g' must be a lineal geometry */
-extern double GEOS_DLL GEOSProject(const GEOSGeometry *g,
-                                   const GEOSGeometry* p);
 extern double GEOS_DLL GEOSProject_r(GEOSContextHandle_t handle,
                                      const GEOSGeometry *g,
                                      const GEOSGeometry *p);
 
 /* Return closest point to given distance within geometry
  * Geometry must be a LineString */
-extern GEOSGeometry GEOS_DLL *GEOSInterpolate(const GEOSGeometry *g,
-                                              double d);
 extern GEOSGeometry GEOS_DLL *GEOSInterpolate_r(GEOSContextHandle_t handle,
                                                 const GEOSGeometry *g,
                                                 double d);
 
-extern double GEOS_DLL GEOSProjectNormalized(const GEOSGeometry *g,
-                                             const GEOSGeometry* p);
 extern double GEOS_DLL GEOSProjectNormalized_r(GEOSContextHandle_t handle,
                                                const GEOSGeometry *g,
                                                const GEOSGeometry *p);
 
-extern GEOSGeometry GEOS_DLL *GEOSInterpolateNormalized(const GEOSGeometry *g,
-                                                        double d);
 extern GEOSGeometry GEOS_DLL *GEOSInterpolateNormalized_r(
                                                 GEOSContextHandle_t handle,
                                                 const GEOSGeometry *g,
@@ -390,8 +338,6 @@
 
 
 /* @return NULL on exception */
-extern GEOSGeometry GEOS_DLL *GEOSBuffer(const GEOSGeometry* g,
-	double width, int quadsegs);
 extern GEOSGeometry GEOS_DLL *GEOSBuffer_r(GEOSContextHandle_t handle,
                                            const GEOSGeometry* g,
                                            double width, int quadsegs);
@@ -409,45 +355,31 @@
 };
 
 /* @return 0 on exception */
-extern GEOSBufferParams GEOS_DLL *GEOSBufferParams_create();
 extern GEOSBufferParams GEOS_DLL *GEOSBufferParams_create_r(
                                               GEOSContextHandle_t handle);
-extern void GEOS_DLL GEOSBufferParams_destroy(GEOSBufferParams* parms);
 extern void GEOS_DLL GEOSBufferParams_destroy_r(
                                               GEOSContextHandle_t handle,
                                               GEOSBufferParams* parms);
 
 /* @return 0 on exception */
-extern int GEOS_DLL GEOSBufferParams_setEndCapStyle(
-                                              GEOSBufferParams* p,
-                                              int style);
 extern int GEOS_DLL GEOSBufferParams_setEndCapStyle_r(
                                               GEOSContextHandle_t handle,
                                               GEOSBufferParams* p,
                                               int style);
 
 /* @return 0 on exception */
-extern int GEOS_DLL GEOSBufferParams_setJoinStyle(
-                                              GEOSBufferParams* p,
-                                              int joinStyle);
 extern int GEOS_DLL GEOSBufferParams_setJoinStyle_r(
                                               GEOSContextHandle_t handle,
                                               GEOSBufferParams* p,
                                               int joinStyle);
 
 /* @return 0 on exception */
-extern int GEOS_DLL GEOSBufferParams_setMitreLimit(
-                                              GEOSBufferParams* p,
-                                              double mitreLimit);
 extern int GEOS_DLL GEOSBufferParams_setMitreLimit_r(
                                               GEOSContextHandle_t handle,
                                               GEOSBufferParams* p,
                                               double mitreLimit);
 
 /* @return 0 on exception */
-extern int GEOS_DLL GEOSBufferParams_setQuadrantSegments(
-                                              GEOSBufferParams* p,
-                                              int quadSegs);
 extern int GEOS_DLL GEOSBufferParams_setQuadrantSegments_r(
                                               GEOSContextHandle_t handle,
                                               GEOSBufferParams* p,
@@ -455,19 +387,12 @@
 
 /* @param singleSided: 1 for single sided, 0 otherwise */
 /* @return 0 on exception */
-extern int GEOS_DLL GEOSBufferParams_setSingleSided(
-                                              GEOSBufferParams* p,
-                                              int singleSided);
 extern int GEOS_DLL GEOSBufferParams_setSingleSided_r(
                                               GEOSContextHandle_t handle,
                                               GEOSBufferParams* p,
                                               int singleSided);
 
 /* @return NULL on exception */
-extern GEOSGeometry GEOS_DLL *GEOSBufferWithParams(
-                                              const GEOSGeometry* g,
-                                              const GEOSBufferParams* p,
-                                              double width);
 extern GEOSGeometry GEOS_DLL *GEOSBufferWithParams_r(
                                               GEOSContextHandle_t handle,
                                               const GEOSGeometry* g,
@@ -475,18 +400,12 @@
                                               double width);
 
 /* These functions return NULL on exception. */
-extern GEOSGeometry GEOS_DLL *GEOSBufferWithStyle(const GEOSGeometry* g,
-	double width, int quadsegs, int endCapStyle, int joinStyle,
-	double mitreLimit);
 extern GEOSGeometry GEOS_DLL *GEOSBufferWithStyle_r(GEOSContextHandle_t handle,
 	const GEOSGeometry* g, double width, int quadsegs, int endCapStyle,
 	int joinStyle, double mitreLimit);
 
 /* These functions return NULL on exception. Only LINESTRINGs are accepted. */
 /* @deprecated in 3.3.0: use GEOSOffsetCurve instead */
-extern GEOSGeometry GEOS_DLL *GEOSSingleSidedBuffer(const GEOSGeometry* g,
-	double width, int quadsegs, int joinStyle, double mitreLimit,
-	int leftSide);
 extern GEOSGeometry GEOS_DLL *GEOSSingleSidedBuffer_r(
 	GEOSContextHandle_t handle,
 	const GEOSGeometry* g, double width, int quadsegs,
@@ -499,8 +418,6 @@
  *                positive for left side offset.
  * @return NULL on exception
  */
-extern GEOSGeometry GEOS_DLL *GEOSOffsetCurve(const GEOSGeometry* g,
-	double width, int quadsegs, int joinStyle, double mitreLimit);
 extern GEOSGeometry GEOS_DLL *GEOSOffsetCurve_r(GEOSContextHandle_t handle,
 	const GEOSGeometry* g, double width, int quadsegs,
 	int joinStyle, double mitreLimit);
@@ -514,12 +431,6 @@
  *
  ***********************************************************************/
 
-extern GEOSGeometry GEOS_DLL *GEOSGeom_createPoint(GEOSCoordSequence* s);
-extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPoint();
-extern GEOSGeometry GEOS_DLL *GEOSGeom_createLinearRing(GEOSCoordSequence* s);
-extern GEOSGeometry GEOS_DLL *GEOSGeom_createLineString(GEOSCoordSequence* s);
-extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyLineString();
-
 extern GEOSGeometry GEOS_DLL *GEOSGeom_createPoint_r(
                                        GEOSContextHandle_t handle,
                                        GEOSCoordSequence* s);
@@ -539,13 +450,6 @@
  * The caller remains owner of the array, but pointed-to
  * objects become ownership of the returned GEOSGeometry.
  */
-extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPolygon();
-extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon(GEOSGeometry* shell,
-	GEOSGeometry** holes, unsigned int nholes);
-extern GEOSGeometry GEOS_DLL *GEOSGeom_createCollection(int type,
-	GEOSGeometry* *geoms, unsigned int ngeoms);
-extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyCollection(int type);
-
 extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPolygon_r(
                                        GEOSContextHandle_t handle);
 extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon_r(
@@ -560,8 +464,6 @@
 extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyCollection_r(
                                        GEOSContextHandle_t handle, int type);
 
-extern GEOSGeometry GEOS_DLL *GEOSGeom_clone(const GEOSGeometry* g);
-
 extern GEOSGeometry GEOS_DLL *GEOSGeom_clone_r(GEOSContextHandle_t handle,
                                                const GEOSGeometry* g);
 
@@ -571,8 +473,6 @@
  *
  ***********************************************************************/
 
-extern void GEOS_DLL GEOSGeom_destroy(GEOSGeometry* g);
-
 extern void GEOS_DLL GEOSGeom_destroy_r(GEOSContextHandle_t handle,
                                         GEOSGeometry* g);
 
@@ -582,21 +482,6 @@
  *
  ***********************************************************************/
 
-extern GEOSGeometry GEOS_DLL *GEOSEnvelope(const GEOSGeometry* g);
-extern GEOSGeometry GEOS_DLL *GEOSIntersection(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern GEOSGeometry GEOS_DLL *GEOSConvexHull(const GEOSGeometry* g);
-extern GEOSGeometry GEOS_DLL *GEOSDifference(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern GEOSGeometry GEOS_DLL *GEOSSymDifference(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern GEOSGeometry GEOS_DLL *GEOSBoundary(const GEOSGeometry* g);
-extern GEOSGeometry GEOS_DLL *GEOSUnion(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern GEOSGeometry GEOS_DLL *GEOSUnaryUnion(const GEOSGeometry* g);
-
-/* @deprecated in 3.3.0: use GEOSUnaryUnion instead */
-extern GEOSGeometry GEOS_DLL *GEOSUnionCascaded(const GEOSGeometry* g);
-extern GEOSGeometry GEOS_DLL *GEOSPointOnSurface(const GEOSGeometry* g);
-extern GEOSGeometry GEOS_DLL *GEOSGetCentroid(const GEOSGeometry* g);
-extern GEOSGeometry GEOS_DLL *GEOSNode(const GEOSGeometry* g);
-
 extern GEOSGeometry GEOS_DLL *GEOSEnvelope_r(GEOSContextHandle_t handle,
                                              const GEOSGeometry* g);
 extern GEOSGeometry GEOS_DLL *GEOSIntersection_r(GEOSContextHandle_t handle,
@@ -617,6 +502,7 @@
                                           const GEOSGeometry* g2);
 extern GEOSGeometry GEOS_DLL *GEOSUnaryUnion_r(GEOSContextHandle_t handle,
                                           const GEOSGeometry* g);
+/* @deprecated in 3.3.0: use GEOSUnaryUnion_r instead */
 extern GEOSGeometry GEOS_DLL *GEOSUnionCascaded_r(GEOSContextHandle_t handle,
                                                   const GEOSGeometry* g);
 extern GEOSGeometry GEOS_DLL *GEOSPointOnSurface_r(GEOSContextHandle_t handle,
@@ -630,8 +516,6 @@
  * all arguments remain ownership of the caller
  * (both Geometries and pointers)
  */
-extern GEOSGeometry GEOS_DLL *GEOSPolygonize(const GEOSGeometry * const geoms[], unsigned int ngeoms);
-extern GEOSGeometry GEOS_DLL *GEOSPolygonizer_getCutEdges(const GEOSGeometry * const geoms[], unsigned int ngeoms);
 /*
  * Polygonizes a set of Geometries which contain linework that
  * represents the edges of a planar graph.
@@ -659,14 +543,7 @@
  * geometries must be destroyed by caller.
  *
  */
-extern GEOSGeometry GEOS_DLL *GEOSPolygonize_full(const GEOSGeometry* input,
-	GEOSGeometry** cuts, GEOSGeometry** dangles, GEOSGeometry** invalid);
 
-extern GEOSGeometry GEOS_DLL *GEOSLineMerge(const GEOSGeometry* g);
-extern GEOSGeometry GEOS_DLL *GEOSSimplify(const GEOSGeometry* g, double tolerance);
-extern GEOSGeometry GEOS_DLL *GEOSTopologyPreserveSimplify(const GEOSGeometry* g,
-	double tolerance);
-
 extern GEOSGeometry GEOS_DLL *GEOSPolygonize_r(GEOSContextHandle_t handle,
                               const GEOSGeometry *const geoms[],
                               unsigned int ngeoms);
@@ -692,8 +569,6 @@
  * Note that only 2 dimensions of the vertices are considered when
  * testing for equality.
  */
-extern GEOSGeometry GEOS_DLL *GEOSGeom_extractUniquePoints(
-                              const GEOSGeometry* g);
 extern GEOSGeometry GEOS_DLL *GEOSGeom_extractUniquePoints_r(
                               GEOSContextHandle_t handle,
                               const GEOSGeometry* g);
@@ -709,8 +584,6 @@
  *
  * Returns NULL on exception
  */
-extern GEOSGeometry GEOS_DLL *GEOSSharedPaths(const GEOSGeometry* g1,
-  const GEOSGeometry* g2);
 extern GEOSGeometry GEOS_DLL *GEOSSharedPaths_r(GEOSContextHandle_t handle,
   const GEOSGeometry* g1, const GEOSGeometry* g2);
 
@@ -718,8 +591,6 @@
  * Snap first geometry on to second with given tolerance
  * Returns a newly allocated geometry, or NULL on exception
  */
-extern GEOSGeometry GEOS_DLL *GEOSSnap(const GEOSGeometry* g1,
-  const GEOSGeometry* g2, double tolerance);
 extern GEOSGeometry GEOS_DLL *GEOSSnap_r(GEOSContextHandle_t handle,
   const GEOSGeometry* g1, const GEOSGeometry* g2, double tolerance);
 
@@ -733,11 +604,6 @@
  *
  * @return  a newly allocated geometry, or NULL on exception
  */
-extern GEOSGeometry GEOS_DLL * GEOSDelaunayTriangulation(
-                                  const GEOSGeometry *g,
-                                  double tolerance,
-                                  int onlyEdges);
-
 extern GEOSGeometry GEOS_DLL * GEOSDelaunayTriangulation_r(
                                   GEOSContextHandle_t handle,
                                   const GEOSGeometry *g,
@@ -757,12 +623,6 @@
  * 
  * @return a newly allocated geometry, or NULL on exception.
  */
-extern GEOSGeometry GEOS_DLL * GEOSVoronoiDiagram(
-				const GEOSGeometry *g,
-				const GEOSGeometry *env,
-				double tolerance,
-				int onlyEdges);
-
 extern GEOSGeometry GEOS_DLL * GEOSVoronoiDiagram_r(
 				GEOSContextHandle_t extHandle, 
 				const GEOSGeometry *g, 
@@ -777,18 +637,6 @@
  *
  ***********************************************************************/
 
-extern char GEOS_DLL GEOSDisjoint(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSTouches(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSIntersects(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSCrosses(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSWithin(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSContains(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSOverlaps(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSEquals(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSEqualsExact(const GEOSGeometry* g1, const GEOSGeometry* g2, double tolerance);
-extern char GEOS_DLL GEOSCovers(const GEOSGeometry* g1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSCoveredBy(const GEOSGeometry* g1, const GEOSGeometry* g2);
-
 extern char GEOS_DLL GEOSDisjoint_r(GEOSContextHandle_t handle,
                                     const GEOSGeometry* g1,
                                     const GEOSGeometry* g2);
@@ -833,24 +681,6 @@
 /*
  * GEOSGeometry ownership is retained by caller
  */
-extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare(const GEOSGeometry* g);
-
-extern void GEOS_DLL GEOSPreparedGeom_destroy(const GEOSPreparedGeometry* g);
-
-extern char GEOS_DLL GEOSPreparedContains(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSPreparedContainsProperly(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSPreparedCoveredBy(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSPreparedCovers(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSPreparedCrosses(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSPreparedDisjoint(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSPreparedIntersects(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSPreparedOverlaps(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSPreparedTouches(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-extern char GEOS_DLL GEOSPreparedWithin(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
-
-/*
- * GEOSGeometry ownership is retained by caller
- */
 extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare_r(
                                             GEOSContextHandle_t handle,
                                             const GEOSGeometry* g);
@@ -899,23 +729,6 @@
  * GEOSGeometry ownership is retained by caller
  */
 
-extern GEOSSTRtree GEOS_DLL *GEOSSTRtree_create(size_t nodeCapacity);
-extern void GEOS_DLL GEOSSTRtree_insert(GEOSSTRtree *tree,
-                                        const GEOSGeometry *g,
-                                        void *item);
-extern void GEOS_DLL GEOSSTRtree_query(GEOSSTRtree *tree,
-                                       const GEOSGeometry *g,
-                                       GEOSQueryCallback callback,
-                                       void *userdata);
-extern void GEOS_DLL GEOSSTRtree_iterate(GEOSSTRtree *tree,
-                                       GEOSQueryCallback callback,
-                                       void *userdata);
-extern char GEOS_DLL GEOSSTRtree_remove(GEOSSTRtree *tree,
-                                        const GEOSGeometry *g,
-                                        void *item);
-extern void GEOS_DLL GEOSSTRtree_destroy(GEOSSTRtree *tree);
-
-
 extern GEOSSTRtree GEOS_DLL *GEOSSTRtree_create_r(
                                     GEOSContextHandle_t handle,
                                     size_t nodeCapacity);
@@ -946,12 +759,6 @@
  *
  ***********************************************************************/
 
-extern char GEOS_DLL GEOSisEmpty(const GEOSGeometry* g);
-extern char GEOS_DLL GEOSisSimple(const GEOSGeometry* g);
-extern char GEOS_DLL GEOSisRing(const GEOSGeometry* g);
-extern char GEOS_DLL GEOSHasZ(const GEOSGeometry* g);
-extern char GEOS_DLL GEOSisClosed(const GEOSGeometry *g);
-
 extern char GEOS_DLL GEOSisEmpty_r(GEOSContextHandle_t handle,
                                    const GEOSGeometry* g);
 extern char GEOS_DLL GEOSisSimple_r(GEOSContextHandle_t handle,
@@ -982,28 +789,22 @@
 };
 
 /* return 2 on exception, 1 on true, 0 on false */
-extern char GEOS_DLL GEOSRelatePattern(const GEOSGeometry* g1, const GEOSGeometry* g2, const char *pat);
 extern char GEOS_DLL GEOSRelatePattern_r(GEOSContextHandle_t handle,
                                          const GEOSGeometry* g1,
                                          const GEOSGeometry* g2,
                                          const char *pat);
 
 /* return NULL on exception, a string to GEOSFree otherwise */
-extern char GEOS_DLL *GEOSRelate(const GEOSGeometry* g1, const GEOSGeometry* g2);
 extern char GEOS_DLL *GEOSRelate_r(GEOSContextHandle_t handle,
                                    const GEOSGeometry* g1,
                                    const GEOSGeometry* g2);
 
 /* return 2 on exception, 1 on true, 0 on false */
-extern char GEOS_DLL GEOSRelatePatternMatch(const char *mat, const char *pat);
 extern char GEOS_DLL GEOSRelatePatternMatch_r(GEOSContextHandle_t handle,
                                          const char *mat,
                                          const char *pat);
 
 /* return NULL on exception, a string to GEOSFree otherwise */
-extern char GEOS_DLL *GEOSRelateBoundaryNodeRule(const GEOSGeometry* g1,
-                                                 const GEOSGeometry* g2,
-                                                 int bnr);
 extern char GEOS_DLL *GEOSRelateBoundaryNodeRule_r(GEOSContextHandle_t handle,
                                                    const GEOSGeometry* g1,
                                                    const GEOSGeometry* g2,
@@ -1021,12 +822,10 @@
 };
 
 /* return 2 on exception, 1 on true, 0 on false */
-extern char GEOS_DLL GEOSisValid(const GEOSGeometry* g);
 extern char GEOS_DLL GEOSisValid_r(GEOSContextHandle_t handle,
                                    const GEOSGeometry* g);
 
 /* return NULL on exception, a string to GEOSFree otherwise */
-extern char GEOS_DLL *GEOSisValidReason(const GEOSGeometry *g);
 extern char GEOS_DLL *GEOSisValidReason_r(GEOSContextHandle_t handle,
                                          const GEOSGeometry* g);
 
@@ -1035,9 +834,6 @@
  * and 'location' (GEOSGeom_destroy) params
  * return 2 on exception, 1 when valid, 0 when invalid
  */
-extern char GEOS_DLL GEOSisValidDetail(const GEOSGeometry* g,
-                                       int flags,
-                                       char** reason, GEOSGeometry** location);
 extern char GEOS_DLL GEOSisValidDetail_r(GEOSContextHandle_t handle,
                                          const GEOSGeometry* g,
                                          int flags,
@@ -1051,23 +847,17 @@
  ***********************************************************************/
 
 /* Return NULL on exception, result must be freed by caller. */
-extern char GEOS_DLL *GEOSGeomType(const GEOSGeometry* g);
-
 extern char GEOS_DLL *GEOSGeomType_r(GEOSContextHandle_t handle,
                                      const GEOSGeometry* g);
 
 /* Return -1 on exception */
-extern int GEOS_DLL GEOSGeomTypeId(const GEOSGeometry* g);
-
 extern int GEOS_DLL GEOSGeomTypeId_r(GEOSContextHandle_t handle,
                                      const GEOSGeometry* g);
 
 /* Return 0 on exception */
-extern int GEOS_DLL GEOSGetSRID(const GEOSGeometry* g);
 extern int GEOS_DLL GEOSGetSRID_r(GEOSContextHandle_t handle,
                                   const GEOSGeometry* g);
 
-extern void GEOS_DLL GEOSSetSRID(GEOSGeometry* g, int SRID);
 extern void GEOS_DLL GEOSSetSRID_r(GEOSContextHandle_t handle,
                                    GEOSGeometry* g, int SRID);
 
@@ -1077,8 +867,6 @@
  * when fed simple geometries, so beware if you need compatibility with
  * old GEOS versions.
  */
-extern int GEOS_DLL GEOSGetNumGeometries(const GEOSGeometry* g);
-
 extern int GEOS_DLL GEOSGetNumGeometries_r(GEOSContextHandle_t handle,
                                            const GEOSGeometry* g);
 
@@ -1090,34 +878,23 @@
  * later version it doesn't matter (getGeometryN(0) for a single will
  * return the input).
  */
-extern const GEOSGeometry GEOS_DLL *GEOSGetGeometryN(const GEOSGeometry* g, int n);
-
 extern const GEOSGeometry GEOS_DLL *GEOSGetGeometryN_r(
                                     GEOSContextHandle_t handle,
                                     const GEOSGeometry* g, int n);
 
 /* Return -1 on exception */
-extern int GEOS_DLL GEOSNormalize(GEOSGeometry* g);
-
 extern int GEOS_DLL GEOSNormalize_r(GEOSContextHandle_t handle,
                                     GEOSGeometry* g);
 
 /* Return -1 on exception */
-extern int GEOS_DLL GEOSGetNumInteriorRings(const GEOSGeometry* g);
-
 extern int GEOS_DLL GEOSGetNumInteriorRings_r(GEOSContextHandle_t handle,
                                               const GEOSGeometry* g);
 
 /* Return -1 on exception, Geometry must be a LineString. */
-extern int GEOS_DLL GEOSGeomGetNumPoints(const GEOSGeometry* g);
-
 extern int GEOS_DLL GEOSGeomGetNumPoints_r(GEOSContextHandle_t handle,
                                        const GEOSGeometry* g);
 
 /* Return -1 on exception, Geometry must be a Point. */
-extern int GEOS_DLL GEOSGeomGetX(const GEOSGeometry *g, double *x);
-extern int GEOS_DLL GEOSGeomGetY(const GEOSGeometry *g, double *y);
-
 extern int GEOS_DLL GEOSGeomGetX_r(GEOSContextHandle_t handle, const GEOSGeometry *g, double *x);
 extern int GEOS_DLL GEOSGeomGetY_r(GEOSContextHandle_t handle, const GEOSGeometry *g, double *y);
 
@@ -1126,8 +903,6 @@
  * Returned object is a pointer to internal storage:
  * it must NOT be destroyed directly.
  */
-extern const GEOSGeometry GEOS_DLL *GEOSGetInteriorRingN(const GEOSGeometry* g, int n);
-
 extern const GEOSGeometry GEOS_DLL *GEOSGetInteriorRingN_r(
                                     GEOSContextHandle_t handle,
                                     const GEOSGeometry* g, int n);
@@ -1137,15 +912,11 @@
  * Returned object is a pointer to internal storage:
  * it must NOT be destroyed directly.
  */
-extern const GEOSGeometry GEOS_DLL *GEOSGetExteriorRing(const GEOSGeometry* g);
-
 extern const GEOSGeometry GEOS_DLL *GEOSGetExteriorRing_r(
                                     GEOSContextHandle_t handle,
                                     const GEOSGeometry* g);
 
 /* Return -1 on exception */
-extern int GEOS_DLL GEOSGetNumCoordinates(const GEOSGeometry* g);
-
 extern int GEOS_DLL GEOSGetNumCoordinates_r(GEOSContextHandle_t handle,
                                             const GEOSGeometry* g);
 
@@ -1153,8 +924,6 @@
  * Return NULL on exception.
  * Geometry must be a LineString, LinearRing or Point.
  */
-extern const GEOSCoordSequence GEOS_DLL *GEOSGeom_getCoordSeq(const GEOSGeometry* g);
-
 extern const GEOSCoordSequence GEOS_DLL *GEOSGeom_getCoordSeq_r(
                                          GEOSContextHandle_t handle,
                                          const GEOSGeometry* g);
@@ -1162,16 +931,12 @@
 /*
  * Return 0 on exception (or empty geometry)
  */
-extern int GEOS_DLL GEOSGeom_getDimensions(const GEOSGeometry* g);
-
 extern int GEOS_DLL GEOSGeom_getDimensions_r(GEOSContextHandle_t handle,
                                              const GEOSGeometry* g);
 
 /*
  * Return 2 or 3.
  */
-extern int GEOS_DLL GEOSGeom_getCoordinateDimension(const GEOSGeometry* g);
-
 extern int GEOS_DLL GEOSGeom_getCoordinateDimension_r(GEOSContextHandle_t handle,
                                                       const GEOSGeometry* g);
 
@@ -1179,10 +944,6 @@
  * Return NULL on exception.
  * Must be LineString and must be freed by called.
  */
-extern GEOSGeometry GEOS_DLL *GEOSGeomGetPointN(const GEOSGeometry *g, int n);
-extern GEOSGeometry GEOS_DLL *GEOSGeomGetStartPoint(const GEOSGeometry *g);
-extern GEOSGeometry GEOS_DLL *GEOSGeomGetEndPoint(const GEOSGeometry *g);
-
 extern GEOSGeometry GEOS_DLL *GEOSGeomGetPointN_r(GEOSContextHandle_t handle, const GEOSGeometry *g, int n);
 extern GEOSGeometry GEOS_DLL *GEOSGeomGetStartPoint_r(GEOSContextHandle_t handle, const GEOSGeometry *g);
 extern GEOSGeometry GEOS_DLL *GEOSGeomGetEndPoint_r(GEOSContextHandle_t handle, const GEOSGeometry *g);
@@ -1194,16 +955,6 @@
  ***********************************************************************/
 
 /* Return 0 on exception, 1 otherwise */
-extern int GEOS_DLL GEOSArea(const GEOSGeometry* g, double *area);
-extern int GEOS_DLL GEOSLength(const GEOSGeometry* g, double *length);
-extern int GEOS_DLL GEOSDistance(const GEOSGeometry* g1, const GEOSGeometry* g2,
-	double *dist);
-extern int GEOS_DLL GEOSHausdorffDistance(const GEOSGeometry *g1,
-        const GEOSGeometry *g2, double *dist);
-extern int GEOS_DLL GEOSHausdorffDistanceDensify(const GEOSGeometry *g1,
-        const GEOSGeometry *g2, double densifyFrac, double *dist);
-extern int GEOS_DLL GEOSGeomGetLength(const GEOSGeometry *g, double *length);
-
 extern int GEOS_DLL GEOSArea_r(GEOSContextHandle_t handle,
                                const GEOSGeometry* g, double *area);
 extern int GEOS_DLL GEOSLength_r(GEOSContextHandle_t handle,
@@ -1225,8 +976,6 @@
 /* Return 0 on exception, the closest points of the two geometries otherwise.
  * The first point comes from g1 geometry and the second point comes from g2.
  */
-extern GEOSCoordSequence GEOS_DLL *GEOSNearestPoints(
-  const GEOSGeometry* g1, const GEOSGeometry* g2);
 extern GEOSCoordSequence GEOS_DLL *GEOSNearestPoints_r(
   GEOSContextHandle_t handle, const GEOSGeometry* g1, const GEOSGeometry* g2);
 
@@ -1245,8 +994,6 @@
  * On exceptions, return 2.
  *
  */
-extern int GEOS_DLL GEOSOrientationIndex(double Ax, double Ay, double Bx, double By,
-	double Px, double Py);
 extern int GEOS_DLL GEOSOrientationIndex_r(GEOSContextHandle_t handle,
 	double Ax, double Ay, double Bx, double By, double Px, double Py);
 
@@ -1264,10 +1011,6 @@
 
 
 /* WKT Reader */
-extern GEOSWKTReader GEOS_DLL *GEOSWKTReader_create();
-extern void GEOS_DLL GEOSWKTReader_destroy(GEOSWKTReader* reader);
-extern GEOSGeometry GEOS_DLL *GEOSWKTReader_read(GEOSWKTReader* reader, const char *wkt);
-
 extern GEOSWKTReader GEOS_DLL *GEOSWKTReader_create_r(
                                              GEOSContextHandle_t handle);
 extern void GEOS_DLL GEOSWKTReader_destroy_r(GEOSContextHandle_t handle,
@@ -1277,15 +1020,6 @@
                                                    const char *wkt);
 
 /* WKT Writer */
-extern GEOSWKTWriter GEOS_DLL *GEOSWKTWriter_create();
-extern void GEOS_DLL GEOSWKTWriter_destroy(GEOSWKTWriter* writer);
-extern char GEOS_DLL *GEOSWKTWriter_write(GEOSWKTWriter* writer, const GEOSGeometry* g);
-extern void GEOS_DLL GEOSWKTWriter_setTrim(GEOSWKTWriter *writer, char trim);
-extern void GEOS_DLL GEOSWKTWriter_setRoundingPrecision(GEOSWKTWriter *writer, int precision);
-extern void GEOS_DLL GEOSWKTWriter_setOutputDimension(GEOSWKTWriter *writer, int dim);
-extern int  GEOS_DLL GEOSWKTWriter_getOutputDimension(GEOSWKTWriter *writer);
-extern void GEOS_DLL GEOSWKTWriter_setOld3D(GEOSWKTWriter *writer, int useOld3D);
-
 extern GEOSWKTWriter GEOS_DLL *GEOSWKTWriter_create_r(
                                              GEOSContextHandle_t handle);
 extern void GEOS_DLL GEOSWKTWriter_destroy_r(GEOSContextHandle_t handle,
@@ -1309,11 +1043,6 @@
                                               int useOld3D);
 
 /* WKB Reader */
-extern GEOSWKBReader GEOS_DLL *GEOSWKBReader_create();
-extern void GEOS_DLL GEOSWKBReader_destroy(GEOSWKBReader* reader);
-extern GEOSGeometry GEOS_DLL *GEOSWKBReader_read(GEOSWKBReader* reader, const unsigned char *wkb, size_t size);
-extern GEOSGeometry GEOS_DLL *GEOSWKBReader_readHEX(GEOSWKBReader* reader, const unsigned char *hex, size_t size);
-
 extern GEOSWKBReader GEOS_DLL *GEOSWKBReader_create_r(
                                              GEOSContextHandle_t handle);
 extern void GEOS_DLL GEOSWKBReader_destroy_r(GEOSContextHandle_t handle,
@@ -1329,18 +1058,12 @@
                                             size_t size);
 
 /* WKB Writer */
-extern GEOSWKBWriter GEOS_DLL *GEOSWKBWriter_create();
-extern void GEOS_DLL GEOSWKBWriter_destroy(GEOSWKBWriter* writer);
-
 extern GEOSWKBWriter GEOS_DLL *GEOSWKBWriter_create_r(
                                              GEOSContextHandle_t handle);
 extern void GEOS_DLL GEOSWKBWriter_destroy_r(GEOSContextHandle_t handle,
                                              GEOSWKBWriter* writer);
 
 /* The caller owns the results for these two methods! */
-extern unsigned char GEOS_DLL *GEOSWKBWriter_write(GEOSWKBWriter* writer, const GEOSGeometry* g, size_t *size);
-extern unsigned char GEOS_DLL *GEOSWKBWriter_writeHEX(GEOSWKBWriter* writer, const GEOSGeometry* g, size_t *size);
-
 extern unsigned char GEOS_DLL *GEOSWKBWriter_write_r(
                                              GEOSContextHandle_t handle,
                                              GEOSWKBWriter* writer,
@@ -1356,9 +1079,6 @@
  * Specify whether output WKB should be 2d or 3d.
  * Return previously set number of dimensions.
  */
-extern int GEOS_DLL GEOSWKBWriter_getOutputDimension(const GEOSWKBWriter* writer);
-extern void GEOS_DLL GEOSWKBWriter_setOutputDimension(GEOSWKBWriter* writer, int newDimension);
-
 extern int GEOS_DLL GEOSWKBWriter_getOutputDimension_r(
                                   GEOSContextHandle_t handle,
                                   const GEOSWKBWriter* writer);
@@ -1370,9 +1090,6 @@
  * Specify whether the WKB byte order is big or little endian.
  * The return value is the previous byte order.
  */
-extern int GEOS_DLL GEOSWKBWriter_getByteOrder(const GEOSWKBWriter* writer);
-extern void GEOS_DLL GEOSWKBWriter_setByteOrder(GEOSWKBWriter* writer, int byteOrder);
-
 extern int GEOS_DLL GEOSWKBWriter_getByteOrder_r(GEOSContextHandle_t handle,
                                                  const GEOSWKBWriter* writer);
 extern void GEOS_DLL GEOSWKBWriter_setByteOrder_r(GEOSContextHandle_t handle,
@@ -1382,9 +1099,6 @@
 /*
  * Specify whether SRID values should be output.
  */
-extern char GEOS_DLL GEOSWKBWriter_getIncludeSRID(const GEOSWKBWriter* writer);
-extern void GEOS_DLL GEOSWKBWriter_setIncludeSRID(GEOSWKBWriter* writer, const char writeSRID);
-
 extern char GEOS_DLL GEOSWKBWriter_getIncludeSRID_r(GEOSContextHandle_t handle,
                                    const GEOSWKBWriter* writer);
 extern void GEOS_DLL GEOSWKBWriter_setIncludeSRID_r(GEOSContextHandle_t handle,
@@ -1395,9 +1109,684 @@
  * Free buffers returned by stuff like GEOSWKBWriter_write(),
  * GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write().
  */
-extern void GEOS_DLL GEOSFree(void *buffer);
 extern void GEOS_DLL GEOSFree_r(GEOSContextHandle_t handle, void *buffer);
 
+
+/* External code to GEOS can define GEOS_USE_ONLY_R_API to avoid the */
+/* non _r API to be available */
+#ifndef GEOS_USE_ONLY_R_API
+
+/************************************************************************
+ *
+ * Initialization, cleanup, version
+ *
+ ***********************************************************************/
+
+extern void GEOS_DLL initGEOS(GEOSMessageHandler notice_function,
+    GEOSMessageHandler error_function);
+extern void GEOS_DLL finishGEOS(void);
+
+/************************************************************************
+ *
+ * NOTE - These functions are DEPRECATED.  Please use the new Reader and
+ * writer APIS!
+ *
+ ***********************************************************************/
+
+extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKT(const char *wkt);
+extern char GEOS_DLL *GEOSGeomToWKT(const GEOSGeometry* g);
+
+/*
+ * Specify whether output WKB should be 2d or 3d.
+ * Return previously set number of dimensions.
+ */
+extern int GEOS_DLL GEOS_getWKBOutputDims();
+extern int GEOS_DLL GEOS_setWKBOutputDims(int newDims);
+
+/*
+ * Specify whether the WKB byte order is big or little endian.
+ * The return value is the previous byte order.
+ */
+extern int GEOS_DLL GEOS_getWKBByteOrder();
+extern int GEOS_DLL GEOS_setWKBByteOrder(int byteOrder);
+
+extern GEOSGeometry GEOS_DLL *GEOSGeomFromWKB_buf(const unsigned char *wkb, size_t size);
+extern unsigned char GEOS_DLL *GEOSGeomToWKB_buf(const GEOSGeometry* g, size_t *size);
+
+extern GEOSGeometry GEOS_DLL *GEOSGeomFromHEX_buf(const unsigned char *hex, size_t size);
+extern unsigned char GEOS_DLL *GEOSGeomToHEX_buf(const GEOSGeometry* g, size_t *size);
+
+/************************************************************************
+ *
+ * Coordinate Sequence functions
+ *
+ ***********************************************************************/
+
+/*
+ * Create a Coordinate sequence with ``size'' coordinates
+ * of ``dims'' dimensions.
+ * Return NULL on exception.
+ */
+extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_create(unsigned int size, unsigned int dims);
+
+/*
+ * Clone a Coordinate Sequence.
+ * Return NULL on exception.
+ */
+extern GEOSCoordSequence GEOS_DLL *GEOSCoordSeq_clone(const GEOSCoordSequence* s);
+
+/*
+ * Destroy a Coordinate Sequence.
+ */
+extern void GEOS_DLL GEOSCoordSeq_destroy(GEOSCoordSequence* s);
+
+/*
+ * Set ordinate values in a Coordinate Sequence.
+ * Return 0 on exception.
+ */
+extern int GEOS_DLL GEOSCoordSeq_setX(GEOSCoordSequence* s,
+    unsigned int idx, double val);
+extern int GEOS_DLL GEOSCoordSeq_setY(GEOSCoordSequence* s,
+    unsigned int idx, double val);
+extern int GEOS_DLL GEOSCoordSeq_setZ(GEOSCoordSequence* s,
+    unsigned int idx, double val);
+extern int GEOS_DLL GEOSCoordSeq_setOrdinate(GEOSCoordSequence* s,
+    unsigned int idx, unsigned int dim, double val);
+
+/*
+ * Get ordinate values from a Coordinate Sequence.
+ * Return 0 on exception.
+ */
+extern int GEOS_DLL GEOSCoordSeq_getX(const GEOSCoordSequence* s,
+    unsigned int idx, double *val);
+extern int GEOS_DLL GEOSCoordSeq_getY(const GEOSCoordSequence* s,
+    unsigned int idx, double *val);
+extern int GEOS_DLL GEOSCoordSeq_getZ(const GEOSCoordSequence* s,
+    unsigned int idx, double *val);
+extern int GEOS_DLL GEOSCoordSeq_getOrdinate(const GEOSCoordSequence* s,
+    unsigned int idx, unsigned int dim, double *val);
+/*
+ * Get size and dimensions info from a Coordinate Sequence.
+ * Return 0 on exception.
+ */
+extern int GEOS_DLL GEOSCoordSeq_getSize(const GEOSCoordSequence* s,
+    unsigned int *size);
+extern int GEOS_DLL GEOSCoordSeq_getDimensions(const GEOSCoordSequence* s,
+    unsigned int *dims);
+
+/************************************************************************
+ *
+ *  Linear referencing functions -- there are more, but these are
+ *  probably sufficient for most purposes
+ *
+ ***********************************************************************/
+
+/*
+ * GEOSGeometry ownership is retained by caller
+ */
+
+
+/* Return distance of point 'p' projected on 'g' from origin
+ * of 'g'. Geometry 'g' must be a lineal geometry */
+extern double GEOS_DLL GEOSProject(const GEOSGeometry *g,
+                                   const GEOSGeometry* p);
+
+/* Return closest point to given distance within geometry
+ * Geometry must be a LineString */
+extern GEOSGeometry GEOS_DLL *GEOSInterpolate(const GEOSGeometry *g,
+                                              double d);
+
+extern double GEOS_DLL GEOSProjectNormalized(const GEOSGeometry *g,
+                                             const GEOSGeometry* p);
+
+extern GEOSGeometry GEOS_DLL *GEOSInterpolateNormalized(const GEOSGeometry *g,
+                                                        double d);
+
+/************************************************************************
+ *
+ * Buffer related functions
+ *
+ ***********************************************************************/
+
+
+/* @return NULL on exception */
+extern GEOSGeometry GEOS_DLL *GEOSBuffer(const GEOSGeometry* g,
+    double width, int quadsegs);
+
+/* @return 0 on exception */
+extern GEOSBufferParams GEOS_DLL *GEOSBufferParams_create();
+extern void GEOS_DLL GEOSBufferParams_destroy(GEOSBufferParams* parms);
+
+/* @return 0 on exception */
+extern int GEOS_DLL GEOSBufferParams_setEndCapStyle(
+                                              GEOSBufferParams* p,
+                                              int style);
+
+/* @return 0 on exception */
+extern int GEOS_DLL GEOSBufferParams_setJoinStyle(
+                                              GEOSBufferParams* p,
+                                              int joinStyle);
+
+/* @return 0 on exception */
+extern int GEOS_DLL GEOSBufferParams_setMitreLimit(
+                                              GEOSBufferParams* p,
+                                              double mitreLimit);
+
+/* @return 0 on exception */
+extern int GEOS_DLL GEOSBufferParams_setQuadrantSegments(
+                                              GEOSBufferParams* p,
+                                              int quadSegs);
+
+/* @param singleSided: 1 for single sided, 0 otherwise */
+/* @return 0 on exception */
+extern int GEOS_DLL GEOSBufferParams_setSingleSided(
+                                              GEOSBufferParams* p,
+                                              int singleSided);
+
+/* @return NULL on exception */
+extern GEOSGeometry GEOS_DLL *GEOSBufferWithParams(
+                                              const GEOSGeometry* g,
+                                              const GEOSBufferParams* p,
+                                              double width);
+
+/* These functions return NULL on exception. */
+extern GEOSGeometry GEOS_DLL *GEOSBufferWithStyle(const GEOSGeometry* g,
+    double width, int quadsegs, int endCapStyle, int joinStyle,
+    double mitreLimit);
+
+/* These functions return NULL on exception. Only LINESTRINGs are accepted. */
+/* @deprecated in 3.3.0: use GEOSOffsetCurve instead */
+extern GEOSGeometry GEOS_DLL *GEOSSingleSidedBuffer(const GEOSGeometry* g,
+    double width, int quadsegs, int joinStyle, double mitreLimit,
+    int leftSide);
+
+/*
+ * Only LINESTRINGs are accepted.
+ * @param width : offset distance.
+ *                negative for right side offset.
+ *                positive for left side offset.
+ * @return NULL on exception
+ */
+extern GEOSGeometry GEOS_DLL *GEOSOffsetCurve(const GEOSGeometry* g,
+    double width, int quadsegs, int joinStyle, double mitreLimit);
+
+/************************************************************************
+ *
+ * Geometry Constructors.
+ * GEOSCoordSequence* arguments will become ownership of the returned object.
+ * All functions return NULL on exception.
+ *
+ ***********************************************************************/
+
+extern GEOSGeometry GEOS_DLL *GEOSGeom_createPoint(GEOSCoordSequence* s);
+extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPoint();
+extern GEOSGeometry GEOS_DLL *GEOSGeom_createLinearRing(GEOSCoordSequence* s);
+extern GEOSGeometry GEOS_DLL *GEOSGeom_createLineString(GEOSCoordSequence* s);
+extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyLineString();
+
+/*
+ * Second argument is an array of GEOSGeometry* objects.
+ * The caller remains owner of the array, but pointed-to
+ * objects become ownership of the returned GEOSGeometry.
+ */
+extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyPolygon();
+extern GEOSGeometry GEOS_DLL *GEOSGeom_createPolygon(GEOSGeometry* shell,
+    GEOSGeometry** holes, unsigned int nholes);
+extern GEOSGeometry GEOS_DLL *GEOSGeom_createCollection(int type,
+    GEOSGeometry* *geoms, unsigned int ngeoms);
+extern GEOSGeometry GEOS_DLL *GEOSGeom_createEmptyCollection(int type);
+
+extern GEOSGeometry GEOS_DLL *GEOSGeom_clone(const GEOSGeometry* g);
+
+/************************************************************************
+ *
+ * Memory management
+ *
+ ***********************************************************************/
+
+extern void GEOS_DLL GEOSGeom_destroy(GEOSGeometry* g);
+
+/************************************************************************
+ *
+ * Topology operations - return NULL on exception.
+ *
+ ***********************************************************************/
+
+extern GEOSGeometry GEOS_DLL *GEOSEnvelope(const GEOSGeometry* g);
+extern GEOSGeometry GEOS_DLL *GEOSIntersection(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern GEOSGeometry GEOS_DLL *GEOSConvexHull(const GEOSGeometry* g);
+extern GEOSGeometry GEOS_DLL *GEOSDifference(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern GEOSGeometry GEOS_DLL *GEOSSymDifference(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern GEOSGeometry GEOS_DLL *GEOSBoundary(const GEOSGeometry* g);
+extern GEOSGeometry GEOS_DLL *GEOSUnion(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern GEOSGeometry GEOS_DLL *GEOSUnaryUnion(const GEOSGeometry* g);
+
+/* @deprecated in 3.3.0: use GEOSUnaryUnion instead */
+extern GEOSGeometry GEOS_DLL *GEOSUnionCascaded(const GEOSGeometry* g);
+extern GEOSGeometry GEOS_DLL *GEOSPointOnSurface(const GEOSGeometry* g);
+extern GEOSGeometry GEOS_DLL *GEOSGetCentroid(const GEOSGeometry* g);
+extern GEOSGeometry GEOS_DLL *GEOSNode(const GEOSGeometry* g);
+
+/*
+ * all arguments remain ownership of the caller
+ * (both Geometries and pointers)
+ */
+extern GEOSGeometry GEOS_DLL *GEOSPolygonize(const GEOSGeometry * const geoms[], unsigned int ngeoms);
+extern GEOSGeometry GEOS_DLL *GEOSPolygonizer_getCutEdges(const GEOSGeometry * const geoms[], unsigned int ngeoms);
+/*
+ * Polygonizes a set of Geometries which contain linework that
+ * represents the edges of a planar graph.
+ *
+ * Any dimension of Geometry is handled - the constituent linework
+ * is extracted to form the edges.
+ *
+ * The edges must be correctly noded; that is, they must only meet
+ * at their endpoints.
+ * The Polygonizer will still run on incorrectly noded input
+ * but will not form polygons from incorrectly noded edges.
+ *
+ * The Polygonizer reports the follow kinds of errors:
+ *
+ * - Dangles - edges which have one or both ends which are
+ *   not incident on another edge endpoint
+ * - Cut Edges - edges which are connected at both ends but
+ *   which do not form part of polygon
+ * - Invalid Ring Lines - edges which form rings which are invalid
+ *   (e.g. the component lines contain a self-intersection)
+ *
+ * Errors are reported to output parameters "cuts", "dangles" and
+ * "invalid" (if not-null). Formed polygons are returned as a
+ * collection. NULL is returned on exception. All returned
+ * geometries must be destroyed by caller.
+ *
+ */
+extern GEOSGeometry GEOS_DLL *GEOSPolygonize_full(const GEOSGeometry* input,
+    GEOSGeometry** cuts, GEOSGeometry** dangles, GEOSGeometry** invalid);
+
+extern GEOSGeometry GEOS_DLL *GEOSLineMerge(const GEOSGeometry* g);
+extern GEOSGeometry GEOS_DLL *GEOSSimplify(const GEOSGeometry* g, double tolerance);
+extern GEOSGeometry GEOS_DLL *GEOSTopologyPreserveSimplify(const GEOSGeometry* g,
+    double tolerance);
+
+/*
+ * Return all distinct vertices of input geometry as a MULTIPOINT.
+ * Note that only 2 dimensions of the vertices are considered when
+ * testing for equality.
+ */
+extern GEOSGeometry GEOS_DLL *GEOSGeom_extractUniquePoints(
+                              const GEOSGeometry* g);
+
+/*
+ * Find paths shared between the two given lineal geometries.
+ *
+ * Returns a GEOMETRYCOLLECTION having two elements:
+ * - first element is a MULTILINESTRING containing shared paths
+ *   having the _same_ direction on both inputs
+ * - second element is a MULTILINESTRING containing shared paths
+ *   having the _opposite_ direction on the two inputs
+ *
+ * Returns NULL on exception
+ */
+extern GEOSGeometry GEOS_DLL *GEOSSharedPaths(const GEOSGeometry* g1,
+  const GEOSGeometry* g2);
+
+/*
+ * Snap first geometry on to second with given tolerance
+ * Returns a newly allocated geometry, or NULL on exception
+ */
+extern GEOSGeometry GEOS_DLL *GEOSSnap(const GEOSGeometry* g1,
+  const GEOSGeometry* g2, double tolerance);
+
+/*
+ * Return a Delaunay triangulation of the vertex of the given geometry
+ *
+ * @param g the input geometry whose vertex will be used as "sites"
+ * @param tolerance optional snapping tolerance to use for improved robustness
+ * @param onlyEdges if non-zero will return a MULTILINESTRING, otherwise it will
+ *                  return a GEOMETRYCOLLECTION containing triangular POLYGONs.
+ *
+ * @return  a newly allocated geometry, or NULL on exception
+ */
+extern GEOSGeometry GEOS_DLL * GEOSDelaunayTriangulation(
+                                  const GEOSGeometry *g,
+                                  double tolerance,
+                                  int onlyEdges);
+
+/*
+ * Returns the Voronoi polygons of a set of Vertices given as input
+ * 
+ * @param g the input geometry whose vertex will be used as sites.
+ * @param tolerance snapping tolerance to use for improved robustness
+ * @param onlyEdges whether to return only edges of the voronoi cells
+ * @param env clipping envelope for the returned diagram, automatically
+ *            determined if NULL.
+ *            The diagram will be clipped to the larger
+ *            of this envelope or an envelope surrounding the sites.
+ * 
+ * @return a newly allocated geometry, or NULL on exception.
+ */
+extern GEOSGeometry GEOS_DLL * GEOSVoronoiDiagram(
+                const GEOSGeometry *g,
+                const GEOSGeometry *env,
+                double tolerance,
+                int onlyEdges);
+
+/************************************************************************
+ *
+ *  Binary predicates - return 2 on exception, 1 on true, 0 on false
+ *
+ ***********************************************************************/
+
+extern char GEOS_DLL GEOSDisjoint(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSTouches(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSIntersects(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSCrosses(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSWithin(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSContains(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSOverlaps(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSEquals(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSEqualsExact(const GEOSGeometry* g1, const GEOSGeometry* g2, double tolerance);
+extern char GEOS_DLL GEOSCovers(const GEOSGeometry* g1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSCoveredBy(const GEOSGeometry* g1, const GEOSGeometry* g2);
+
+/************************************************************************
+ *
+ *  Prepared Geometry Binary predicates - return 2 on exception, 1 on true, 0 on false
+ *
+ ***********************************************************************/
+
+/*
+ * GEOSGeometry ownership is retained by caller
+ */
+extern const GEOSPreparedGeometry GEOS_DLL *GEOSPrepare(const GEOSGeometry* g);
+
+extern void GEOS_DLL GEOSPreparedGeom_destroy(const GEOSPreparedGeometry* g);
+
+extern char GEOS_DLL GEOSPreparedContains(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSPreparedContainsProperly(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSPreparedCoveredBy(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSPreparedCovers(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSPreparedCrosses(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSPreparedDisjoint(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSPreparedIntersects(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSPreparedOverlaps(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSPreparedTouches(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+extern char GEOS_DLL GEOSPreparedWithin(const GEOSPreparedGeometry* pg1, const GEOSGeometry* g2);
+
+/************************************************************************
+ *
+ *  STRtree functions
+ *
+ ***********************************************************************/
+
+/*
+ * GEOSGeometry ownership is retained by caller
+ */
+
+extern GEOSSTRtree GEOS_DLL *GEOSSTRtree_create(size_t nodeCapacity);
+extern void GEOS_DLL GEOSSTRtree_insert(GEOSSTRtree *tree,
+                                        const GEOSGeometry *g,
+                                        void *item);
+extern void GEOS_DLL GEOSSTRtree_query(GEOSSTRtree *tree,
+                                       const GEOSGeometry *g,
+                                       GEOSQueryCallback callback,
+                                       void *userdata);
+extern void GEOS_DLL GEOSSTRtree_iterate(GEOSSTRtree *tree,
+                                       GEOSQueryCallback callback,
+                                       void *userdata);
+extern char GEOS_DLL GEOSSTRtree_remove(GEOSSTRtree *tree,
+                                        const GEOSGeometry *g,
+                                        void *item);
+extern void GEOS_DLL GEOSSTRtree_destroy(GEOSSTRtree *tree);
+
+
+/************************************************************************
+ *
+ *  Unary predicate - return 2 on exception, 1 on true, 0 on false
+ *
+ ***********************************************************************/
+
+extern char GEOS_DLL GEOSisEmpty(const GEOSGeometry* g);
+extern char GEOS_DLL GEOSisSimple(const GEOSGeometry* g);
+extern char GEOS_DLL GEOSisRing(const GEOSGeometry* g);
+extern char GEOS_DLL GEOSHasZ(const GEOSGeometry* g);
+extern char GEOS_DLL GEOSisClosed(const GEOSGeometry *g);
+
+/************************************************************************
+ *
+ *  Dimensionally Extended 9 Intersection Model related
+ *
+ ***********************************************************************/
+
+/* return 2 on exception, 1 on true, 0 on false */
+extern char GEOS_DLL GEOSRelatePattern(const GEOSGeometry* g1, const GEOSGeometry* g2, const char *pat);
+
+/* return NULL on exception, a string to GEOSFree otherwise */
+extern char GEOS_DLL *GEOSRelate(const GEOSGeometry* g1, const GEOSGeometry* g2);
+
+/* return 2 on exception, 1 on true, 0 on false */
+extern char GEOS_DLL GEOSRelatePatternMatch(const char *mat, const char *pat);
+
+/* return NULL on exception, a string to GEOSFree otherwise */
+extern char GEOS_DLL *GEOSRelateBoundaryNodeRule(const GEOSGeometry* g1,
+                                                 const GEOSGeometry* g2,
+                                                 int bnr);
+
+/************************************************************************
+ *
+ *  Validity checking
+ *
+ ***********************************************************************/
+
+/* return 2 on exception, 1 on true, 0 on false */
+extern char GEOS_DLL GEOSisValid(const GEOSGeometry* g);
+
+/* return NULL on exception, a string to GEOSFree otherwise */
+extern char GEOS_DLL *GEOSisValidReason(const GEOSGeometry *g);
+/*
+ * Caller has the responsibility to destroy 'reason' (GEOSFree)
+ * and 'location' (GEOSGeom_destroy) params
+ * return 2 on exception, 1 when valid, 0 when invalid
+ * Use enum GEOSValidFlags values for the flags param.
+ */
+extern char GEOS_DLL GEOSisValidDetail(const GEOSGeometry* g,
+                                       int flags,
+                                       char** reason, GEOSGeometry** location);
+
+/************************************************************************
+ *
+ *  Geometry info
+ *
+ ***********************************************************************/
+
+/* Return NULL on exception, result must be freed by caller. */
+extern char GEOS_DLL *GEOSGeomType(const GEOSGeometry* g);
+
+/* Return -1 on exception */
+extern int GEOS_DLL GEOSGeomTypeId(const GEOSGeometry* g);
+
+/* Return 0 on exception */
+extern int GEOS_DLL GEOSGetSRID(const GEOSGeometry* g);
+
+extern void GEOS_DLL GEOSSetSRID(GEOSGeometry* g, int SRID);
+
+/* May be called on all geometries in GEOS 3.x, returns -1 on error and 1
+ * for non-multi geometries. Older GEOS versions only accept
+ * GeometryCollections or Multi* geometries here, and are likely to crash
+ * when fed simple geometries, so beware if you need compatibility with
+ * old GEOS versions.
+ */
+extern int GEOS_DLL GEOSGetNumGeometries(const GEOSGeometry* g);
+
+/*
+ * Return NULL on exception.
+ * Returned object is a pointer to internal storage:
+ * it must NOT be destroyed directly.
+ * Up to GEOS 3.2.0 the input geometry must be a Collection, in
+ * later version it doesn't matter (getGeometryN(0) for a single will
+ * return the input).
+ */
+extern const GEOSGeometry GEOS_DLL *GEOSGetGeometryN(const GEOSGeometry* g, int n);
+
+/* Return -1 on exception */
+extern int GEOS_DLL GEOSNormalize(GEOSGeometry* g);
+
+/* Return -1 on exception */
+extern int GEOS_DLL GEOSGetNumInteriorRings(const GEOSGeometry* g);
+
+/* Return -1 on exception, Geometry must be a LineString. */
+extern int GEOS_DLL GEOSGeomGetNumPoints(const GEOSGeometry* g);
+
+/* Return -1 on exception, Geometry must be a Point. */
+extern int GEOS_DLL GEOSGeomGetX(const GEOSGeometry *g, double *x);
+extern int GEOS_DLL GEOSGeomGetY(const GEOSGeometry *g, double *y);
+
+/*
+ * Return NULL on exception, Geometry must be a Polygon.
+ * Returned object is a pointer to internal storage:
+ * it must NOT be destroyed directly.
+ */
+extern const GEOSGeometry GEOS_DLL *GEOSGetInteriorRingN(const GEOSGeometry* g, int n);
+
+/*
+ * Return NULL on exception, Geometry must be a Polygon.
+ * Returned object is a pointer to internal storage:
+ * it must NOT be destroyed directly.
+ */
+extern const GEOSGeometry GEOS_DLL *GEOSGetExteriorRing(const GEOSGeometry* g);
+
+/* Return -1 on exception */
+extern int GEOS_DLL GEOSGetNumCoordinates(const GEOSGeometry* g);
+
+/*
+ * Return NULL on exception.
+ * Geometry must be a LineString, LinearRing or Point.
+ */
+extern const GEOSCoordSequence GEOS_DLL *GEOSGeom_getCoordSeq(const GEOSGeometry* g);
+
+/*
+ * Return 0 on exception (or empty geometry)
+ */
+extern int GEOS_DLL GEOSGeom_getDimensions(const GEOSGeometry* g);
+
+/*
+ * Return 2 or 3.
+ */
+extern int GEOS_DLL GEOSGeom_getCoordinateDimension(const GEOSGeometry* g);
+
+/*
+ * Return NULL on exception.
+ * Must be LineString and must be freed by called.
+ */
+extern GEOSGeometry GEOS_DLL *GEOSGeomGetPointN(const GEOSGeometry *g, int n);
+extern GEOSGeometry GEOS_DLL *GEOSGeomGetStartPoint(const GEOSGeometry *g);
+extern GEOSGeometry GEOS_DLL *GEOSGeomGetEndPoint(const GEOSGeometry *g);
+
+/************************************************************************
+ *
+ *  Misc functions
+ *
+ ***********************************************************************/
+
+/* Return 0 on exception, 1 otherwise */
+extern int GEOS_DLL GEOSArea(const GEOSGeometry* g, double *area);
+extern int GEOS_DLL GEOSLength(const GEOSGeometry* g, double *length);
+extern int GEOS_DLL GEOSDistance(const GEOSGeometry* g1, const GEOSGeometry* g2,
+    double *dist);
+extern int GEOS_DLL GEOSHausdorffDistance(const GEOSGeometry *g1,
+        const GEOSGeometry *g2, double *dist);
+extern int GEOS_DLL GEOSHausdorffDistanceDensify(const GEOSGeometry *g1,
+        const GEOSGeometry *g2, double densifyFrac, double *dist);
+extern int GEOS_DLL GEOSGeomGetLength(const GEOSGeometry *g, double *length);
+
+/* Return 0 on exception, the closest points of the two geometries otherwise.
+ * The first point comes from g1 geometry and the second point comes from g2.
+ */
+extern GEOSCoordSequence GEOS_DLL *GEOSNearestPoints(
+  const GEOSGeometry* g1, const GEOSGeometry* g2);
+
+
+/************************************************************************
+ *
+ * Algorithms
+ *
+ ***********************************************************************/
+
+/* Walking from A to B:
+ *  return -1 if reaching P takes a counter-clockwise (left) turn
+ *  return  1 if reaching P takes a clockwise (right) turn
+ *  return  0 if P is collinear with A-B
+ *
+ * On exceptions, return 2.
+ *
+ */
+extern int GEOS_DLL GEOSOrientationIndex(double Ax, double Ay, double Bx, double By,
+    double Px, double Py);
+
+/************************************************************************
+ *
+ * Reader and Writer APIs
+ *
+ ***********************************************************************/
+
+/* WKT Reader */
+extern GEOSWKTReader GEOS_DLL *GEOSWKTReader_create();
+extern void GEOS_DLL GEOSWKTReader_destroy(GEOSWKTReader* reader);
+extern GEOSGeometry GEOS_DLL *GEOSWKTReader_read(GEOSWKTReader* reader, const char *wkt);
+
+/* WKT Writer */
+extern GEOSWKTWriter GEOS_DLL *GEOSWKTWriter_create();
+extern void GEOS_DLL GEOSWKTWriter_destroy(GEOSWKTWriter* writer);
+extern char GEOS_DLL *GEOSWKTWriter_write(GEOSWKTWriter* writer, const GEOSGeometry* g);
+extern void GEOS_DLL GEOSWKTWriter_setTrim(GEOSWKTWriter *writer, char trim);
+extern void GEOS_DLL GEOSWKTWriter_setRoundingPrecision(GEOSWKTWriter *writer, int precision);
+extern void GEOS_DLL GEOSWKTWriter_setOutputDimension(GEOSWKTWriter *writer, int dim);
+extern int  GEOS_DLL GEOSWKTWriter_getOutputDimension(GEOSWKTWriter *writer);
+extern void GEOS_DLL GEOSWKTWriter_setOld3D(GEOSWKTWriter *writer, int useOld3D);
+
+/* WKB Reader */
+extern GEOSWKBReader GEOS_DLL *GEOSWKBReader_create();
+extern void GEOS_DLL GEOSWKBReader_destroy(GEOSWKBReader* reader);
+extern GEOSGeometry GEOS_DLL *GEOSWKBReader_read(GEOSWKBReader* reader, const unsigned char *wkb, size_t size);
+extern GEOSGeometry GEOS_DLL *GEOSWKBReader_readHEX(GEOSWKBReader* reader, const unsigned char *hex, size_t size);
+
+/* WKB Writer */
+extern GEOSWKBWriter GEOS_DLL *GEOSWKBWriter_create();
+extern void GEOS_DLL GEOSWKBWriter_destroy(GEOSWKBWriter* writer);
+
+/* The caller owns the results for these two methods! */
+extern unsigned char GEOS_DLL *GEOSWKBWriter_write(GEOSWKBWriter* writer, const GEOSGeometry* g, size_t *size);
+extern unsigned char GEOS_DLL *GEOSWKBWriter_writeHEX(GEOSWKBWriter* writer, const GEOSGeometry* g, size_t *size);
+
+/*
+ * Specify whether output WKB should be 2d or 3d.
+ * Return previously set number of dimensions.
+ */
+extern int GEOS_DLL GEOSWKBWriter_getOutputDimension(const GEOSWKBWriter* writer);
+extern void GEOS_DLL GEOSWKBWriter_setOutputDimension(GEOSWKBWriter* writer, int newDimension);
+
+/*
+ * Specify whether the WKB byte order is big or little endian.
+ * The return value is the previous byte order.
+ */
+extern int GEOS_DLL GEOSWKBWriter_getByteOrder(const GEOSWKBWriter* writer);
+extern void GEOS_DLL GEOSWKBWriter_setByteOrder(GEOSWKBWriter* writer, int byteOrder);
+
+/*
+ * Specify whether SRID values should be output.
+ */
+extern char GEOS_DLL GEOSWKBWriter_getIncludeSRID(const GEOSWKBWriter* writer);
+extern void GEOS_DLL GEOSWKBWriter_setIncludeSRID(GEOSWKBWriter* writer, const char writeSRID);
+
+/*
+ * Free buffers returned by stuff like GEOSWKBWriter_write(),
+ * GEOSWKBWriter_writeHEX() and GEOSWKTWriter_write().
+ */
+extern void GEOS_DLL GEOSFree(void *buffer);
+
+#endif /* #ifndef GEOS_USE_ONLY_R_API */
+
+
 #ifdef __cplusplus
 } // extern "C"
 #endif



More information about the geos-commits mailing list