alphasort

Name

alphasort -- compare two directory entries alphabetically (LSB deprecated)

Synopsis

#include <dirent.h>

int alphasort(const struct dirent **a, const struct dirent **b);

Description

The alphasort interface is expected to disappear from a future version of the LSB; applications should provide their own routine to sort filenames.[1]

The alphasort() function can be used as the comparison function for the scandir() function to sort the directory entries into alphabetical order. Its parameters are the two directory entries, a and b, to compare.

Return Value

The alphasort() function returns an integer less than, equal to, or greater than zero if the first argument is considered to be respectively less than, equal to, or greater than the second.

Errors

ENOMEM

Insufficient memory to complete the operation.

Notes

[1]

The LSB never has contained scandir().