deps/kb_meme/meme-5.0.1/src/array-list.c
/*
 * arraylst_apply_range
 * Applies a function to each item in a range of the array list.
 */
arraylst_apply_range
Applies a function to each item in a range of the array list.
arraylst_apply_range Applies a function to each item in a range of the array list .
void arraylst_apply_range(void (*fun)(void*), int index, int count, ARRAYLST_T *arraylst) {
  int i;
  if (arraylst == NULL)                       die("arraylst_map_range: arraylst is NULL!\n"); 
  if (fun == NULL)                            die("arraylst_map_range: fun is NULL!\n");
  if (count < 0)                              die("arraylst_map_range: count must be zero or more elements.\n"); 
  if (index < 0 || index > arraylst->size)    die("arraylst_map_range: index must be within bounds.\n");
  if(index + count > arraylst->size)          die("arraylst_map_range: index + count is larger than size!\n");
  for (i = index; i < count; ++i) {
    fun(arraylst->array[i]);
  }
}
void arraylst_apply_range ( void ( * fun ) ( void * ) , int index , int count , ARRAYLST_T * arraylst ) { int i ; if ( arraylst == NULL ) die ( " \n " ) ; if ( fun == NULL ) die ( " \n " ) ; if ( count < 0 ) die ( " \n " ) ; if ( index < 0 || index > arraylst -> size ) die ( " \n " ) ; if ( index + count > arraylst -> size ) die ( " \n " ) ; for ( i = index ; i < count ; ++ i ) { fun ( arraylst -> array [ i ] ) ; } }
arraylst_apply_range
 Applies a function to each item in a range of the array list.
arraylst_apply_range Applies a function to each item in a range of the array list .