From 89a9e37b7a7a2134cedb6d27db265a8ab774f9d1 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 20 Mar 1998 12:06:55 +0000 Subject: Update. 1998-03-20 11:58 Ulrich Drepper * dirent/Makefile (routines): Add scandir64, alphasort64, and versionsort64. * dirent/alphasort64.c: New file. * dirent/scandir64.c: New file. * dirent/versionsort64.c: New file. * dirent/dirent.h: Add LFS support for scandir, alphasort, and versionsort. * sysdeps/generic/readdir64.c: Rename to __readdir64 and make old name weak alias. * sysdeps/unix/sysv/linux/readdir64.c: Likewise. * dirent/alphasort.c: Use strcoll instead of strcmp. * dirent/scandir.c: Optimize a bit. * dirent/versionsort.c: Pretty print. 1998-03-20 Ulrich Drepper * string/string.h: Add prototype for __strtok_r. --- dirent/dirent.h | 46 +++++++++++++++++++++++++++++++++++++++------- 1 file changed, 39 insertions(+), 7 deletions(-) (limited to 'dirent/dirent.h') diff --git a/dirent/dirent.h b/dirent/dirent.h index 63986bfc0f..07d543b6e2 100644 --- a/dirent/dirent.h +++ b/dirent/dirent.h @@ -135,6 +135,7 @@ extern struct dirent *readdir __P ((DIR *__dirp)) __asm__ ("readdir64"); #endif #ifdef __USE_LARGEFILE64 +extern struct dirent64 *__readdir64 __P ((DIR *__dirp)); extern struct dirent64 *readdir64 __P ((DIR *__dirp)); #endif @@ -199,18 +200,49 @@ extern int dirfd __P ((DIR *__dirp)); 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 scandir __P ((__const char *__dir, - struct dirent ***__namelist, - int (*__selector) __P ((__const struct dirent *)), - int (*__cmp) __P ((__const __ptr_t, - __const __ptr_t)))); +# ifndef __USE_FILE_OFFSET64 +extern int scandir __P ((__const char *__dir, struct dirent ***__namelist, + int (*__selector) (__const struct dirent *), + int (*__cmp) (__const __ptr_t, __const __ptr_t))); +# else +extern int scandir __P ((__const char *__dir, struct dirent ***__namelist, + int (*__selector) (__const struct dirent *), + int (*__cmp) (__const __ptr_t, __const __ptr_t))) + __asm__ ("scandir64"); +# endif + +# if defined __USE_GNU && defined __USE_LARGEFILE64 +/* This function is like `scandir' but it uses the 64bit dirent structure. + Please note that the CMP function must now work with struct dirent64 **. */ +extern int scandir64 __P ((__const char *__dir, struct dirent64 ***__namelist, + int (*__selector) (__const struct dirent64 *), + int (*__cmp) (__const __ptr_t, __const __ptr_t))); +# endif /* Function to compare two `struct dirent's alphabetically. */ -extern int alphasort __P ((__const __ptr_t, __const __ptr_t)); +# ifndef __USE_FILE_OFFSET64 +extern int alphasort __P ((__const __ptr_t __e1, __const __ptr_t __e2)); +# else +extern int alphasort __P ((__const __ptr_t __e1, __const __ptr_t __e2)) + __asm__ ("alphasort64"); +# endif + +# if defined __USE_GNU && defined __USE_LARGEFILE64 +extern int alphasort64 __P ((__const __ptr_t __e1, __const __ptr_t __e2)); +# endif # ifdef __USE_GNU /* Function to compare two `struct dirent's by name & version. */ -extern int versionsort __P ((__const __ptr_t, __const __ptr_t)); +# ifndef __USE_FILE_OFFSET64 +extern int versionsort __P ((__const __ptr_t __e1, __const __ptr_t __e2)); +# else +extern int versionsort __P ((__const __ptr_t __e1, __const __ptr_t __e2)) + __asm__ ("versionsort64"); +# endif + +# ifdef __USE_LARGEFILE64 +extern int versionsort64 __P ((__const __ptr_t __e1, __const __ptr_t __e2)); +# endif # endif /* Read directory entries from FD into BUF, reading at most NBYTES. -- cgit v1.2.1