PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ PGISDirectFunctionCall1()

Datum PGISDirectFunctionCall1 ( PGFunction  func,
Datum  arg1 
)

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

Definition at line 384 of file lwgeom_accum.c.

Referenced by pgis_geometry_clusterintersecting_finalfn(), pgis_geometry_collect_finalfn(), pgis_geometry_makeline_finalfn(), pgis_geometry_polygonize_finalfn(), and pgis_geometry_union_finalfn().

385 {
386 #if POSTGIS_PGSQL_VERSION < 120
387  FunctionCallInfoData fcinfo;
388  Datum result;
389 
390 
391  InitFunctionCallInfoData(fcinfo, NULL, 1, InvalidOid, NULL, NULL);
392 
393 
394  fcinfo.arg[0] = arg1;
395  fcinfo.argnull[0] = false;
396 
397  result = (*func) (&fcinfo);
398 
399  /* Check for null result, returning a "NULL" Datum if indicated */
400  if (fcinfo.isnull)
401  return (Datum) 0;
402 
403  return result;
404 #else
405  LOCAL_FCINFO(fcinfo, 1);
406  Datum result;
407 
408  InitFunctionCallInfoData(*fcinfo, NULL, 1, InvalidOid, NULL, NULL);
409 
410  fcinfo->args[0].value = arg1;
411  fcinfo->args[0].isnull = false;
412 
413  result = (*func)(fcinfo);
414 
415  /* Check for null result, returning a "NULL" Datum if indicated */
416  if (fcinfo->isnull)
417  return (Datum)0;
418 
419  return result;
420 #endif /* POSTGIS_PGSQL_VERSION < 120 */
421 }
Here is the caller graph for this function: