PostGIS  2.5.0beta2dev-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 412 of file lwgeom_accum.c.

Referenced by pgis_geometry_clusterwithin_finalfn().

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