deps/kb_meme/meme-5.0.1/src/array-list.c
/*
 * arraylst_accumulate
 * Applies a function to each item of the array list combining it with an 
 * accumulated value. The accumulated value is returned.
 */
arraylst_accumulate
Applies a function to each item of the array list combining it with an
accumulated value. The accumulated value is returned.
arraylst_accumulate Applies a function to each item of the array list combining it with an accumulated value . The accumulated value is returned .
void* arraylst_accumulate(void (*accumulator_fun)(void*, void*), void *initval, ARRAYLST_T *arraylst) {
  int i;
  void *val;
  if (arraylst == NULL)                       die("arraylst_accumulate: arraylst is NULL!\n"); 
  if (accumulator_fun == NULL)                die("arraylst_accumulate: accumulator_fun is NULL!\n");
  val = initval;
  for (i = 0; i < arraylst->size; ++i) {
    accumulator_fun(arraylst->array[i], val);
  }
  return val;
}
void * arraylst_accumulate ( void ( * accumulator_fun ) ( void * , void * ) , void * initval , ARRAYLST_T * arraylst ) { int i ; void * val ; if ( arraylst == NULL ) die ( " \n " ) ; if ( accumulator_fun == NULL ) die ( " \n " ) ; val = initval ; for ( i = 0 ; i < arraylst -> size ; ++ i ) { accumulator_fun ( arraylst -> array [ i ] , val ) ; } return val ; }
arraylst_accumulate
 Applies a function to each item of the array list combining it with an
 accumulated value.
arraylst_accumulate Applies a function to each item of the array list combining it with an accumulated value .