417 Pointer box2d_ptr = PG_GETARG_POINTER(0);
418 Pointer geom_ptr = PG_GETARG_POINTER(1);
423 if ( (box2d_ptr == NULL) && (geom_ptr == NULL) )
428 result = (
GBOX *)palloc(
sizeof(
GBOX));
430 if (box2d_ptr == NULL)
432 lwgeom = PG_GETARG_GSERIALIZED_P(1);
435 memcpy(result, &box,
sizeof(
GBOX));
436 PG_RETURN_POINTER(result);
440 if (geom_ptr == NULL)
442 memcpy(result, (
char *)PG_GETARG_DATUM(0),
sizeof(
GBOX));
443 PG_RETURN_POINTER(result);
448 lwgeom = PG_GETARG_GSERIALIZED_P(1);
452 memcpy(result, (
char *)PG_GETARG_DATUM(0),
sizeof(
GBOX));
453 PG_RETURN_POINTER(result);
456 a = (
GBOX *)PG_GETARG_DATUM(0);
464 PG_RETURN_POINTER(result);
int gserialized_get_gbox_p(const GSERIALIZED *g, GBOX *gbox)
Read the box from the GSERIALIZED or calculate it if necessary.