PostGIS  2.2.7dev-r@@SVN_REVISION@@
Datum PGISDirectFunctionCall2 ( PGFunction  func,
Datum  arg1,
Datum  arg2 
)

A modified version of PostgreSQL's DirectFunctionCall2 which allows NULL results; this is required for aggregates that return NULL.

Definition at line 400 of file lwgeom_accum.c.

Referenced by pgis_geometry_clusterwithin_finalfn().

401 {
402  FunctionCallInfoData fcinfo;
403  Datum result;
404 
405 #if POSTGIS_PGSQL_VERSION > 90
406 
407  InitFunctionCallInfoData(fcinfo, NULL, 1, InvalidOid, NULL, NULL);
408 #else
409 
410  InitFunctionCallInfoData(fcinfo, NULL, 1, NULL, NULL);
411 #endif
412 
413  fcinfo.arg[0] = arg1;
414  fcinfo.arg[1] = arg2;
415  fcinfo.argnull[0] = false;
416  fcinfo.argnull[1] = false;
417 
418  result = (*func) (&fcinfo);
419 
420  /* Check for null result, returning a "NULL" Datum if indicated */
421  if (fcinfo.isnull)
422  return (Datum) 0;
423 
424  return result;
425 }

Here is the caller graph for this function: