carrays.h
static inline void* gca_min(void *base, size_t nel, size_t es,
                            int (*compar)(const void *_a, const void *_b,
                                          void *_arg),
                            void *arg)
{
  char *b = (char*)base, *end = b+es*nel, *ptr, *min = base;
  for(ptr = b+es; ptr < end; ptr += es)
    if(compar(min, ptr, arg) > 0)
      min = ptr;
  return min;
}
// Get pointer to min entry using comparison function
Get pointer to min entry using comparison function
Get pointer to min entry using comparison function
static inline void* gca_min(void *base, size_t nel, size_t es,
                            int (*compar)(const void *_a, const void *_b,
                                          void *_arg),
                            void *arg)
{
  char *b = (char*)base, *end = b+es*nel, *ptr, *min = base;
  for(ptr = b+es; ptr < end; ptr += es)
    if(compar(min, ptr, arg) > 0)
      min = ptr;
  return min;
}
static inline void * gca_min ( void * base , size_t nel , size_t es , int ( * compar ) ( const void * _a , const void * _b , void * _arg ) , void * arg ) { char * b = ( char * ) base , * end = b + es * nel , * ptr , * min = base ; for ( ptr = b + es ; ptr < end ; ptr += es ) if ( compar ( min , ptr , arg ) > 0 ) min = ptr ; return min ; }
Get pointer to min entry using comparison function
Get pointer to min entry using comparison function