PostGIS  2.2.8dev-r@@SVN_REVISION@@

◆ rtpg_nmapalgebraexpr_arg_init()

static rtpg_nmapalgebraexpr_arg rtpg_nmapalgebraexpr_arg_init ( int  cnt,
char **  kw 
)
static

Definition at line 995 of file rtpg_mapalgebra.c.

References rtpg_nmapalgebraexpr_arg_t::bandarg, rtpg_nmapalgebraexpr_arg_t::callback, rtpg_nmapalgebraexpr_callback_arg::count, rtpg_nmapalgebraexpr_callback_arg::expr, rtpg_nmapalgebraexpr_callback_arg::exprcount, rtpg_nmapalgebraexpr_callback_arg::hasval, rtpg_nmapalgebraexpr_callback_arg::kw, rtpg_nmapalgebraexpr_callback_arg::nodatanodata, rtpg_nmapalgebra_arg_init(), rtpg_nmapalgebraexpr_callback_arg::spi_argcount, rtpg_nmapalgebraexpr_callback_arg::spi_argpos, rtpg_nmapalgebraexpr_callback_arg::spi_plan, and rtpg_nmapalgebraexpr_callback_arg::val.

Referenced by RASTER_nMapAlgebraExpr().

995  {
996  rtpg_nmapalgebraexpr_arg arg = NULL;
997  int i = 0;
998 
999  arg = palloc(sizeof(struct rtpg_nmapalgebraexpr_arg_t));
1000  if (arg == NULL) {
1001  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arguments");
1002  return NULL;
1003  }
1004 
1006  if (arg->bandarg == NULL) {
1007  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arg->bandarg");
1008  return NULL;
1009  }
1010 
1011  arg->callback.kw.count = cnt;
1012  arg->callback.kw.val = kw;
1013 
1014  arg->callback.exprcount = 3;
1015  for (i = 0; i < arg->callback.exprcount; i++) {
1016  arg->callback.expr[i].spi_plan = NULL;
1017  arg->callback.expr[i].spi_argcount = 0;
1018  arg->callback.expr[i].spi_argpos = palloc(cnt * sizeof(uint8_t));
1019  if (arg->callback.expr[i].spi_argpos == NULL) {
1020  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for spi_argpos");
1021  return NULL;
1022  }
1023  memset(arg->callback.expr[i].spi_argpos, 0, sizeof(uint8_t) * cnt);
1024  arg->callback.expr[i].hasval = 0;
1025  arg->callback.expr[i].val = 0;
1026  }
1027 
1028  arg->callback.nodatanodata.hasval = 0;
1029  arg->callback.nodatanodata.val = 0;
1030 
1031  return arg;
1032 }
rtpg_nmapalgebra_arg bandarg
struct rtpg_nmapalgebraexpr_callback_arg::@18 kw
struct rtpg_nmapalgebraexpr_callback_arg::@17 nodatanodata
struct rtpg_nmapalgebraexpr_callback_arg::@16 expr[3]
rtpg_nmapalgebraexpr_callback_arg callback
static rtpg_nmapalgebra_arg rtpg_nmapalgebra_arg_init()
Here is the call graph for this function:
Here is the caller graph for this function: