]> granicus.if.org Git - postgis/commitdiff
Added WKB_recv function for binary WKB input
authorSandro Santilli <strk@keybit.net>
Fri, 28 Nov 2003 11:06:49 +0000 (11:06 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 28 Nov 2003 11:06:49 +0000 (11:06 +0000)
git-svn-id: http://svn.osgeo.org/postgis/trunk@394 b70326c6-7e19-0410-871a-916f4a2858ee

Attic/postgis_sql_74_end.sql.in
Attic/postgis_sql_74_start.sql.in
postgis.h
postgis_inout.c

index 5fdaf8040b6f57896d229b875bc891d4b957f306..bc872ba405f3e5af5a431165deaf44d695c902d4 100644 (file)
@@ -12,6 +12,9 @@
 --  
 -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -- $Log$
+-- Revision 1.3  2003/11/28 11:06:49  strk
+-- Added WKB_recv function for binary WKB input
+--
 -- Revision 1.2  2003/11/19 15:29:21  strk
 -- Added default btree operator class for PG7.4
 --
@@ -35,7 +38,8 @@ CREATE TYPE wkb (
        input = wkb_in,
        output = wkb_out,
        storage = extended,
-       send = bytea
+       send = bytea,
+       receive = wkb_recv
 );
 
 --
index a72811d3a8bf7e921d7a14ef625d7f822c6bdc6f..48b91bd1f6dd4705f6c89de7524b537c5da4e318 100644 (file)
@@ -12,6 +12,9 @@
 --  
 -- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
 -- $Log$
+-- Revision 1.2  2003/11/28 11:06:49  strk
+-- Added WKB_recv function for binary WKB input
+--
 -- Revision 1.1  2003/11/11 10:38:23  strk
 -- Postgresql 7.4 enabler scripts.
 --
@@ -106,6 +109,11 @@ CREATE FUNCTION wkb_out(wkb)
        AS '@MODULE_FILENAME@','WKB_out'
        LANGUAGE 'C' WITH (isstrict);
 
+CREATE FUNCTION wkb_recv(internal)
+       RETURNS wkb
+       AS '@MODULE_FILENAME@','WKB_recv'
+       LANGUAGE 'C' WITH (isstrict);
+
 
 -- - - - - - - - - - - - - - - - - - - - - - - - - - - -
 --  CHIP
index 06ea9833403a065d52f25dd15c5e4bd982359888..fd94987d47ff3719e8a3ebbef871b02f4a13d676 100644 (file)
--- a/postgis.h
+++ b/postgis.h
@@ -11,6 +11,9 @@
  *
  **********************************************************************
  * $Log$
+ * Revision 1.39  2003/11/28 11:06:49  strk
+ * Added WKB_recv function for binary WKB input
+ *
  * Revision 1.38  2003/11/19 15:44:51  strk
  * added prototypes for geometry_{le,ge,cmp}
  *
@@ -559,6 +562,8 @@ Datum postgis_gist_sel(PG_FUNCTION_ARGS);
 Datum WKB_in(PG_FUNCTION_ARGS);
 Datum WKB_out(PG_FUNCTION_ARGS);
 
+Datum WKB_recv(PG_FUNCTION_ARGS);
+
 Datum CHIP_in(PG_FUNCTION_ARGS);
 Datum CHIP_out(PG_FUNCTION_ARGS);
 Datum CHIP_to_geom(PG_FUNCTION_ARGS);
index c7a16045656c12199d4fe59b0dcda5cd5f9d3e8d..4d37d4b8869d8a3e376cf160a65a8dd8f08d0fe9 100644 (file)
@@ -11,6 +11,9 @@
  *
  **********************************************************************
  * $Log$
+ * Revision 1.29  2003/11/28 11:06:49  strk
+ * Added WKB_recv function for binary WKB input
+ *
  * Revision 1.28  2003/10/06 18:09:08  dblasby
  * Fixed typo in add_to_geometry().  With very poorly aligned sub-objects, it
  * wouldnt allocate enough memory.  Fixed it so its pesimistic and will allocate
@@ -3536,6 +3539,17 @@ Datum WKB_out(PG_FUNCTION_ARGS)
 }
 
 
+PG_FUNCTION_INFO_V1(WKB_recv);
+Datum WKB_recv(PG_FUNCTION_ARGS)
+{
+       bytea *in = (bytea *)PG_DETOAST_DATUM(PG_GETARG_DATUM(0));
+        WellKnownBinary *result;
+
+       result = (WellKnownBinary *) palloc(in->vl_len);
+       memcpy(result, in, in->vl_len);
+        PG_RETURN_POINTER(result);
+}
+
 PG_FUNCTION_INFO_V1(WKBtoBYTEA);
 Datum WKBtoBYTEA(PG_FUNCTION_ARGS)
 {