NAME scandir, alphasort - scan a directory


SYNOPSIS

       #include <sys/types.h>
       #include <dirent.h>
       #include <direntx.h>

       int
       scandir(const char *dir, struct dirent ***list,
            int (*Selector)(const struct dirent *), 
            int (*Sorter)(const struct dirent **, const struct dirent **));

       int
       alphasort(const struct dirent **d1, const struct dirent **d2 )


DESCRIPTION
       Scandir() scans directory dir and collects all - if Selector is NULL -
       or the items selected by this function returning non-zero into the malloced 
       array pointed to by *list, stored at the adress list; optionally sorted by 
       Sorteror NULL. 
       The user supplied function Sorter must behave like in qsort.
       For greater typesafety both function pointers do not accept void* 
       arguments.

       Alphasort() is an alphabetic order comparison routine, usable as Sorter.

RETURNS
       Scandir() returns the number of items in the array list or (-1) in case
       of error.

