PostGIS  2.3.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 414 of file lwgeom_accum.c.

Referenced by pgis_geometry_clusterwithin_finalfn().

415 {
416  FunctionCallInfoData fcinfo;
417  Datum result;
418 
419 #if POSTGIS_PGSQL_VERSION > 90
420 
421  InitFunctionCallInfoData(fcinfo, NULL, 2, InvalidOid, NULL, NULL);
422 #else
423 
424  InitFunctionCallInfoData(fcinfo, NULL, 2, NULL, NULL);
425 #endif
426 
427  fcinfo.arg[0] = arg1;
428  fcinfo.arg[1] = arg2;
429  fcinfo.argnull[0] = false;
430  fcinfo.argnull[1] = false;
431 
432  result = (*func) (&fcinfo);
433 
434  /* Check for null result, returning a "NULL" Datum if indicated */
435  if (fcinfo.isnull)
436  return (Datum) 0;
437 
438  return result;
439 }

Here is the caller graph for this function: