limb 0.2.0

2024-01-09

genalloc_qsort_full(3)
limb manual
genalloc_qsort_full(3)

NAME

genalloc_qsort_full, genalloc_qsort_r_full, genalloc_qsort, genalloc_qsort_r - sort a genalloc using qsort/qsort_r

SYNOPSIS

#include <limb/genalloc.h>
int (*cmp_fn) (const void *p1, const void *p2);
int (*cmp_r_fn) (const void *p1, const void *p2, void *ctx);

void genalloc_qsort_full(type, genalloc *ga, size_t from, size_t len, cmp_fn cmp)
void genalloc_qsort_r_full(type, genalloc *ga, size_t from, size_t len, cmp_r_fn cmp_r, void *ctx)

void genalloc_qsort(type, genalloc *ga,  cmp_fn cmp)
void genalloc_qsort_r(type, genalloc *ga,  cmp_r_fn cmp_r, void *ctx)

DESCRIPTION

The genalloc_qsort_full() macro sorts len elements of the genalloc pointed by ga, starting at element from (counting from 0), using qsort(3) with comparison function pointed to by cmp.

The genalloc_qsort_r_full() macro is similar to genalloc_qsort_full() but using qsort_r(3) with comparison function pointed to by cmp_r which will receive ctx as its third argument.

For more information about comparison functions, refer to qsort(3) and qsort_r(3).

The genalloc_qsort() macro is similar to genalloc_qsort_full() but to sort the full array.

The genalloc_qsort_r() macro is similar to genalloc_qsort_r_full() but to sort the full array.

limb 0.1.0
2023-07-24
genalloc_qsort_full(3)