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

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

992  {
993  rtpg_nmapalgebraexpr_arg arg = NULL;
994  int i = 0;
995 
996  arg = palloc(sizeof(struct rtpg_nmapalgebraexpr_arg_t));
997  if (arg == NULL) {
998  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arguments");
999  return NULL;
1000  }
1001 
1003  if (arg->bandarg == NULL) {
1004  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for arg->bandarg");
1005  return NULL;
1006  }
1007 
1008  arg->callback.kw.count = cnt;
1009  arg->callback.kw.val = kw;
1010 
1011  arg->callback.exprcount = 3;
1012  for (i = 0; i < arg->callback.exprcount; i++) {
1013  arg->callback.expr[i].spi_plan = NULL;
1014  arg->callback.expr[i].spi_argcount = 0;
1015  arg->callback.expr[i].spi_argpos = palloc(cnt * sizeof(uint8_t));
1016  if (arg->callback.expr[i].spi_argpos == NULL) {
1017  elog(ERROR, "rtpg_nmapalgebraexpr_arg_init: Could not allocate memory for spi_argpos");
1018  return NULL;
1019  }
1020  memset(arg->callback.expr[i].spi_argpos, 0, sizeof(uint8_t) * cnt);
1021  arg->callback.expr[i].hasval = 0;
1022  arg->callback.expr[i].val = 0;
1023  }
1024 
1025  arg->callback.nodatanodata.hasval = 0;
1026  arg->callback.nodatanodata.val = 0;
1027 
1028  return arg;
1029 }
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: