SYNOPSIS
#include <limits.h>
#include <stdlib.h>
int sradixsort(unsigned char **base, int nmemb, unsigned char *table, unsigned int endbyte);
DESCRIPTION
The
Applications may specify a sort order by providing the table argument. If non-null, table must reference an array of UCHAR_MAX + 1 bytes which contain the sort weight of each possible byte value. The end-of-string byte must have a sort weight of 0 or 255 (for sorting in reverse order). More than one byte may have the same sort weight. The table argument is useful for applications which wish to sort different characters equally, for example, providing a table with the same weights for A-Z as for a-z results in a case-insensitive sort. If table is NULL, the contents of the array are sorted in ascending order according to the ASCII order of the byte strings they reference, and endbyte has a sorting weight of 0.
The
PARAMETERS
- base
-
Is the table of byte strings to be sorted.
- nmemb
-
Is the number of strings in the table.
- table
-
Is the table of weights for each possibly byte value, or NULL to use a default table.
- endbyte
-
Is the termination byte for each string in the table.
RETURN VALUES
On success,
- EINVAL
-
The value of the endbyte element of table is not 0 or 255.
- ENOMEM
-
Insufficient memory is available to create the table needed to implement the stable sort algorithm.
CONFORMANCE
4.4BSD.
MULTITHREAD SAFETY LEVEL
MT-Safe.
PORTING ISSUES
None.
AVAILABILITY
PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition
SEE ALSO
- Functions:
heapsort() ,mergesort() ,qsort() ,radixsort()
PTC MKS Toolkit 10.4 Documentation Build 39.