Logo Search packages:      
Sourcecode: tablix2 version File versions  Download package

int outputext_update ( outputext ex,
table tab 
)

Update output extension with new data from a timetable.

Parameters:
ex Pointer to the output extension structure to update.
tab Pointer to the table with the new data.
Returns:
0 on success and -1 on error.

Definition at line 969 of file data.c.

References resourcetype_t::c_lookup, resourcetype_t::c_num, table_t::chr, outputext_t::con_typeid, outputext_t::connum, chromo_t::gen, chromo_t::gennum, outputext_t::list, chromo_t::restype, tuplelist_add(), tuplelist_free(), tuplelist_new(), outputext_t::var_typeid, and outputext_t::varnum.

{
      chromo *con_chr, *var_chr;
      resourcetype *con_restype;
      int tupleid;
      int con_resid, var_resid;
      int resid;
      int n,r;
      
      assert(ex!=NULL);
      assert(tab!=NULL);

      for(var_resid=0;var_resid<ex->varnum;var_resid++) {
            for(con_resid=0;con_resid<ex->connum;con_resid++) {
                  if(ex->list[var_resid][con_resid]!=NULL) {
                        tuplelist_free(ex->list[var_resid][con_resid]);
                  }
                  ex->list[var_resid][con_resid]=tuplelist_new();
                  if(ex->list[var_resid][con_resid]==NULL) {
                        return(-1);
                  }
            }
      }

      con_chr=&tab->chr[ex->con_typeid];
      var_chr=&tab->chr[ex->var_typeid];

      con_restype=con_chr->restype;

        for(tupleid=0;tupleid<var_chr->gennum;tupleid++) {
            var_resid=var_chr->gen[tupleid];
            con_resid=con_chr->gen[tupleid];

                  for(n=0;n<con_restype->c_num[con_resid];n++) {
                  resid=con_restype->c_lookup[con_resid][n];

                  r=tuplelist_add(ex->list[var_resid][resid], tupleid);
                  if(r) return(-1);
            }
        }
      return(0);
}


Generated by  Doxygen 1.6.0   Back to index