PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ rtpg_nmapalgebraexpr_arg_init()

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

Definition at line 1054 of file rtpg_mapalgebra.c.

1054  {
1055  rtpg_nmapalgebraexpr_arg arg = NULL;
1056  int i = 0;
1057 
1058  arg = palloc(sizeof(struct rtpg_nmapalgebraexpr_arg_t));
1059  if (arg == NULL) {
1060  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arguments");
1061  return NULL;
1062  }
1063 
1065  if (arg->bandarg == NULL) {
1066  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arg->bandarg");
1067  return NULL;
1068  }
1069 
1070  arg->callback.kw.count = cnt;
1071  arg->callback.kw.val = kw;
1072 
1073  arg->callback.exprcount = 3;
1074  for (i = 0; i < arg->callback.exprcount; i++) {
1075  arg->callback.expr[i].spi_plan = NULL;
1076  arg->callback.expr[i].spi_argcount = 0;
1077  arg->callback.expr[i].spi_argpos = palloc(cnt * sizeof(uint8_t));
1078  if (arg->callback.expr[i].spi_argpos == NULL) {
1079  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for spi_argpos");
1080  return NULL;
1081  }
1082  memset(arg->callback.expr[i].spi_argpos, 0, sizeof(uint8_t) * cnt);
1083  arg->callback.expr[i].hasval = 0;
1084  arg->callback.expr[i].val = 0;
1085  }
1086 
1087  arg->callback.nodatanodata.hasval = 0;
1088  arg->callback.nodatanodata.val = 0;
1089 
1090  return arg;
1091 }
static rtpg_nmapalgebra_arg rtpg_nmapalgebra_arg_init()
rtpg_nmapalgebraexpr_callback_arg callback
rtpg_nmapalgebra_arg bandarg
struct rtpg_nmapalgebraexpr_callback_arg::@18 expr[3]
struct rtpg_nmapalgebraexpr_callback_arg::@20 kw
struct rtpg_nmapalgebraexpr_callback_arg::@19 nodatanodata
unsigned char uint8_t
Definition: uthash.h:79

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().

Here is the call graph for this function:
Here is the caller graph for this function: