PostGIS  2.4.9dev-r@@SVN_REVISION@@

◆ rtpg_nmapalgebraexpr_arg_init()

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

Definition at line 1045 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().

1045  {
1046  rtpg_nmapalgebraexpr_arg arg = NULL;
1047  int i = 0;
1048 
1049  arg = palloc(sizeof(struct rtpg_nmapalgebraexpr_arg_t));
1050  if (arg == NULL) {
1051  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arguments");
1052  return NULL;
1053  }
1054 
1056  if (arg->bandarg == NULL) {
1057  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arg->bandarg");
1058  return NULL;
1059  }
1060 
1061  arg->callback.kw.count = cnt;
1062  arg->callback.kw.val = kw;
1063 
1064  arg->callback.exprcount = 3;
1065  for (i = 0; i < arg->callback.exprcount; i++) {
1066  arg->callback.expr[i].spi_plan = NULL;
1067  arg->callback.expr[i].spi_argcount = 0;
1068  arg->callback.expr[i].spi_argpos = palloc(cnt * sizeof(uint8_t));
1069  if (arg->callback.expr[i].spi_argpos == NULL) {
1070  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for spi_argpos");
1071  return NULL;
1072  }
1073  memset(arg->callback.expr[i].spi_argpos, 0, sizeof(uint8_t) * cnt);
1074  arg->callback.expr[i].hasval = 0;
1075  arg->callback.expr[i].val = 0;
1076  }
1077 
1078  arg->callback.nodatanodata.hasval = 0;
1079  arg->callback.nodatanodata.val = 0;
1080 
1081  return arg;
1082 }
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()
unsigned char uint8_t
Definition: uthash.h:79
Here is the call graph for this function:
Here is the caller graph for this function: