PostGIS  2.1.10dev-r@@SVN_REVISION@@
static rtpg_nmapalgebraexpr_arg rtpg_nmapalgebraexpr_arg_init ( int  cnt,
char **  kw 
)
static

Definition at line 17054 of file rt_pg.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().

17054  {
17055  rtpg_nmapalgebraexpr_arg arg = NULL;
17056  int i = 0;
17057 
17058  arg = palloc(sizeof(struct rtpg_nmapalgebraexpr_arg_t));
17059  if (arg == NULL) {
17060  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arguments");
17061  return NULL;
17062  }
17063 
17065  if (arg->bandarg == NULL) {
17066  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arg->bandarg");
17067  return NULL;
17068  }
17069 
17070  arg->callback.kw.count = cnt;
17071  arg->callback.kw.val = kw;
17072 
17073  arg->callback.exprcount = 3;
17074  for (i = 0; i < arg->callback.exprcount; i++) {
17075  arg->callback.expr[i].spi_plan = NULL;
17076  arg->callback.expr[i].spi_argcount = 0;
17077  arg->callback.expr[i].spi_argpos = palloc(cnt * sizeof(uint8_t));
17078  if (arg->callback.expr[i].spi_argpos == NULL) {
17079  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for spi_argpos");
17080  return NULL;
17081  }
17082  memset(arg->callback.expr[i].spi_argpos, 0, sizeof(uint8_t) * cnt);
17083  arg->callback.expr[i].hasval = 0;
17084  arg->callback.expr[i].val = 0;
17085  }
17086 
17087  arg->callback.nodatanodata.hasval = 0;
17088  arg->callback.nodatanodata.val = 0;
17089 
17090  return arg;
17091 }
struct rtpg_nmapalgebraexpr_callback_arg::@17 expr[3]
rtpg_nmapalgebra_arg bandarg
Definition: rt_pg.c:17049
struct rtpg_nmapalgebraexpr_callback_arg::@18 nodatanodata
static rtpg_nmapalgebra_arg rtpg_nmapalgebra_arg_init()
Definition: rt_pg.c:16302
struct rtpg_nmapalgebraexpr_callback_arg::@19 kw
rtpg_nmapalgebraexpr_callback_arg callback
Definition: rt_pg.c:17051

Here is the call graph for this function:

Here is the caller graph for this function: