--
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-- $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
--
input = wkb_in,
output = wkb_out,
storage = extended,
- send = bytea
+ send = bytea,
+ receive = wkb_recv
);
--
--
-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-- $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.
--
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
*
**********************************************************************
* $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}
*
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);
*
**********************************************************************
* $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
}
+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)
{