From: roland Date: Thu, 14 May 1992 06:36:14 +0000 (+0000) Subject: Formerly ../dirent/dirent.h.~9~ X-Git-Tag: jems-14oct94~4532 X-Git-Url: http://git.csclub.uwaterloo.ca/?p=kopensolaris-gnu%2Fglibc.git;a=commitdiff_plain;h=243e93f6f583466db1c5b058370e2f885e145954 Formerly ../dirent/dirent.h.~9~ --- diff --git a/dirent/dirent.h b/dirent/dirent.h index 3c60268011..b6348e9c2d 100644 --- a/dirent/dirent.h +++ b/dirent/dirent.h @@ -102,6 +102,29 @@ extern void EXFUN(seekdir, (DIR *__dirp, __off_t __pos)); /* Return the current position of DIRP. */ extern __off_t EXFUN(telldir, (DIR *__dirp)); +/* Scan the directory DIR, calling SELECT on each directory entry. + Entries for which SELECT returns nonzero are individually malloc'd, + sorted using qsort with CMP, and collected in a malloc'd array in + *NAMELIST. Returns the number of entries selected, or -1 on error. */ +extern int EXFUN(scandir, (CONST char *__dir, + struct dirent ***__namelist, + int EXFUN((*__select), (struct dirent *)); + int EXFUN((*__cmp), (CONST PTR, CONST PTR)))); + +/* Function to compare two `struct dirent's alphabetically. */ +extern int EXFUN(alphasort, (CONST PTR, CONST PTR)); + + +/* Read directory entries from FD into BUF, reading at most NBYTES. + Reading starts at offset *BASEP, and *BASEP is updated with the new + position after reading. Returns the number of bytes read; zero when at + end of directory; or -1 for errors. */ +extern __ssize_t EXFUN(__getdirentries, (int __fd, char *__buf, + size_t __nbytes, __off_t *__basep)); +extern __ssize_t EXFUN(getdirentries, (int __fd, char *__buf, + size_t __nbytes, __off_t *__basep)); + + #endif /* Use BSD or misc. */ #ifdef __cplusplus