usr/kevin/code/develop/sim_gil_obj.c
int gil_react_create(int nreact, int nprod, gil_react_t ** pobj) {

  gil_react_t * p = NULL;

  dbg_return_if(nreact < 0, -1);
  dbg_return_if(nprod < 0, -1);
  dbg_return_if(pobj == NULL, -1);

  err_err_if((p = u_calloc(1, sizeof(gil_react_t))) == NULL);
  p->nreactant = nreact;
  p->nproduct = nprod;

  dbg_err_if(u_list_create(&p->reactants));
  dbg_err_if(u_list_create(&p->products));
  *pobj = p;

  return 0;

 err:
  if (p->products) u_list_free(p->products);
  if (p->reactants) u_list_free(p->reactants);
  u_free(p);

  return -1;
}
/*****************************************************************************
 *
 *  \brief Create and return a Gillespie reaction
 *
 *  The reaction is expected to have the given number of reactants
 *  and products, although the creation of the lists is deferred.
 *
 *  \param nreact      the number of reactants
 *  \param nprod       the number of products
 *
 *  \retval 0          a success
 *  \retval -1         a failure
 *
 *****************************************************************************/
\brief Create and return a Gillespie reaction
The reaction is expected to have the given number of reactants
and products, although the creation of the lists is deferred.

\param nreact      the number of reactants
\param nprod       the number of products

\retval 0          a success
\retval -1         a failure
\ brief Create and return a Gillespie reaction The reaction is expected to have the given number of reactants and products although the creation of the lists is deferred . \ param nreact the number of reactants \ param nprod the number of products \ retval 0 a success \ retval - 1 a failure
int gil_react_create(int nreact, int nprod, gil_react_t ** pobj) {
  gil_react_t * p = NULL;
  dbg_return_if(nreact < 0, -1);
  dbg_return_if(nprod < 0, -1);
  dbg_return_if(pobj == NULL, -1);
  err_err_if((p = u_calloc(1, sizeof(gil_react_t))) == NULL);
  p->nreactant = nreact;
  p->nproduct = nprod;
  dbg_err_if(u_list_create(&p->reactants));
  dbg_err_if(u_list_create(&p->products));
  *pobj = p;
  return 0;
 err:
  if (p->products) u_list_free(p->products);
  if (p->reactants) u_list_free(p->reactants);
  u_free(p);
  return -1;
}
int gil_react_create ( int nreact , int nprod , gil_react_t * * pobj ) { gil_react_t * p = NULL ; dbg_return_if ( nreact < 0 , -1 ) ; dbg_return_if ( nprod < 0 , -1 ) ; dbg_return_if ( pobj == NULL , -1 ) ; err_err_if ( ( p = u_calloc ( 1 , sizeof ( gil_react_t ) ) ) == NULL ) ; p -> nreactant = nreact ; p -> nproduct = nprod ; dbg_err_if ( u_list_create ( & p -> reactants ) ) ; dbg_err_if ( u_list_create ( & p -> products ) ) ; * pobj = p ; return 0 ; err : if ( p -> products ) u_list_free ( p -> products ) ; if ( p -> reactants ) u_list_free ( p -> reactants ) ; u_free ( p ) ; return -1 ; }
\brief Create and return a Gillespie reaction
  The reaction is expected to have the given number of reactants
  and products, although the creation of the lists is deferred.
\ brief Create and return a Gillespie reaction The reaction is expected to have the given number of reactants and products although the creation of the lists is deferred .