PostGIS  2.5.0dev-r@@SVN_REVISION@@

◆ PGISDirectFunctionCall2()

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 386 of file lwgeom_accum.c.

Referenced by pgis_geometry_clusterwithin_finalfn().

387 {
388  FunctionCallInfoData fcinfo;
389  Datum result;
390 
391 #if POSTGIS_PGSQL_VERSION > 90
392 
393  InitFunctionCallInfoData(fcinfo, NULL, 2, InvalidOid, NULL, NULL);
394 #else
395 
396  InitFunctionCallInfoData(fcinfo, NULL, 2, NULL, NULL);
397 #endif
398 
399  fcinfo.arg[0] = arg1;
400  fcinfo.arg[1] = arg2;
401  fcinfo.argnull[0] = false;
402  fcinfo.argnull[1] = false;
403 
404  result = (*func) (&fcinfo);
405 
406  /* Check for null result, returning a "NULL" Datum if indicated */
407  if (fcinfo.isnull)
408  return (Datum) 0;
409 
410  return result;
411 }
Here is the caller graph for this function: