X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=libc%2Fmisc%2Fdirent%2Fscandir.c;h=41491baeec1e5b51cb7f41561ac976146e3f9f22;hb=af0172162f7c653cad6a11ed1c1a5459bc154465;hp=72929fb57abfddad0795aaf13de8b53effdf03b8;hpb=c8609543a9a8bf6559c2931dbbef6b3c41b3fbf2;p=uclinux-h8%2FuClibc.git diff --git a/libc/misc/dirent/scandir.c b/libc/misc/dirent/scandir.c index 72929fb57..41491baee 100644 --- a/libc/misc/dirent/scandir.c +++ b/libc/misc/dirent/scandir.c @@ -1,28 +1,8 @@ -/* Copyright (C) 1992-1998, 2000 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - The GNU C Library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with the GNU C Library; if not, write to the Free - Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA - 02111-1307 USA. - */ - -/* Modified for uClibc by Erik Andersen - */ - -#define qsort __qsort -#define opendir __opendir -#define closedir __closedir +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ #include #include @@ -32,6 +12,12 @@ #include #include "dirstream.h" +libc_hidden_proto(memcpy) +libc_hidden_proto(readdir) +libc_hidden_proto(opendir) +libc_hidden_proto(closedir) +libc_hidden_proto(qsort) + int scandir(const char *dir, struct dirent ***namelist, int (*selector) (const struct dirent *), int (*compar) (const void *, const void *)) @@ -49,7 +35,7 @@ int scandir(const char *dir, struct dirent ***namelist, __set_errno (0); pos = 0; - while ((current = __readdir (dp)) != NULL) + while ((current = readdir (dp)) != NULL) if (selector == NULL || (*selector) (current)) { struct dirent *vnew; @@ -76,7 +62,7 @@ int scandir(const char *dir, struct dirent ***namelist, if (vnew == NULL) break; - names[pos++] = (struct dirent *) __memcpy (vnew, current, dsize); + names[pos++] = (struct dirent *) memcpy (vnew, current, dsize); } if (unlikely(errno != 0))