]> granicus.if.org Git - postgis/commitdiff
Put PG_LWGEOM stuff where it belongs (out of liblwgeom) [RT-SIGTA]
authorSandro Santilli <strk@keybit.net>
Mon, 8 Aug 2011 08:59:32 +0000 (08:59 +0000)
committerSandro Santilli <strk@keybit.net>
Mon, 8 Aug 2011 08:59:32 +0000 (08:59 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@7706 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/liblwgeom.h
postgis/lwgeom_pg.h

index ad0a5d50af14a16d855426c433162bf8710251a1..e61d3109b85aa5843291e51cebd13a1ebdb5b66e 100644 (file)
@@ -944,29 +944,6 @@ extern int  lwgeom_getType(uchar type); /* returns the tttt value */
 extern uchar lwgeom_makeType(char hasZ, char hasM, char has_srid, int type);
 extern uchar lwgeom_makeType_full(char hasZ, char hasM, char has_srid, int type, char hasBBOX);
 
-/*
- * This is the binary representation of lwgeom compatible
- * with postgresql varlena struct
- */
-typedef struct
-{
-       uint32 size;        /* varlena header (do not touch directly!) */
-       uchar type;         /* encodes ndims, type, bbox presence,
-                                       srid presence */
-       uchar data[1];
-}
-PG_LWGEOM;
-
-/*
- * Construct a full PG_LWGEOM type (including size header)
- * from a serialized form.
- * The constructed PG_LWGEOM object will be allocated using palloc
- * and the serialized form will be copied.
- * If you specify a SRID other then -1 it will be set.
- * If you request bbox (wantbbox=1) it will be extracted or computed
- * from the serialized form.
- */
-
 /*
  * Compute bbox of serialized geom
  */
index 00c2b0381504430376e7fa14703b13d0abf4bcc4..d7302271df2933e2caec6100f2fac6d587d26410 100644 (file)
@@ -16,6 +16,19 @@ void pg_free(void *ptr);
 void pg_error(const char *msg, va_list vp);
 void pg_notice(const char *msg, va_list vp);
 
+/*
+ * This is the binary representation of lwgeom compatible
+ * with postgresql varlena struct
+ */
+typedef struct
+{
+       uint32 size;        /* varlena header (do not touch directly!) */
+       uchar type;         /* encodes ndims, type, bbox presence,
+                                       srid presence */
+       uchar data[1];
+}
+PG_LWGEOM;
+
 
 /* Debugging macros */
 #if POSTGIS_DEBUG_LEVEL > 0
@@ -90,6 +103,19 @@ GSERIALIZED* gserialized_drop_gidx(GSERIALIZED *g);
 /* Serialize/deserialize a PG_LWGEOM (postgis datatype) */
 extern PG_LWGEOM *pglwgeom_serialize(LWGEOM *lwgeom);
 extern LWGEOM *pglwgeom_deserialize(PG_LWGEOM *pglwgeom);
+
+/*
+ * Construct a full PG_LWGEOM type (including size header)
+ * from a serialized form.
+ * The constructed PG_LWGEOM object will be allocated using palloc
+ * and the serialized form will be copied.
+ * If you specify a SRID other then -1 it will be set.
+ * If you request bbox (wantbbox=1) it will be extracted or computed
+ * from the serialized form.
+ * 
+ * NOTE: only available when GSERIALIZED_ON is undefined
+ * TODO: wrap in #ifndef GSERIALIZED_ON
+ */
 extern PG_LWGEOM *PG_LWGEOM_construct(uchar *serialized, int srid, int wantbbox);
 
 /* PG_LWGEOM SRID get/set */