PostGIS  2.5.0dev-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 410 of file lwgeom_accum.c.

Referenced by pgis_geometry_clusterwithin_finalfn().

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

Here is the caller graph for this function: