From af0172162f7c653cad6a11ed1c1a5459bc154465 Mon Sep 17 00:00:00 2001 From: "Peter S. Mazinger" Date: Sat, 14 Jan 2006 00:58:03 +0000 Subject: hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed --- libc/misc/assert/__assert.c | 3 + libc/misc/ctype/ctype.c | 34 +++--- libc/misc/dirent/alphasort.c | 4 +- libc/misc/dirent/alphasort64.c | 3 +- libc/misc/dirent/closedir.c | 9 +- libc/misc/dirent/dirfd.c | 11 +- libc/misc/dirent/dirstream.h | 4 +- libc/misc/dirent/opendir.c | 19 +-- libc/misc/dirent/readdir.c | 6 +- libc/misc/dirent/readdir64.c | 6 +- libc/misc/dirent/readdir64_r.c | 4 +- libc/misc/dirent/readdir_r.c | 4 +- libc/misc/dirent/rewinddir.c | 3 +- libc/misc/dirent/scandir.c | 40 ++---- libc/misc/dirent/scandir64.c | 13 +- libc/misc/dirent/seekdir.c | 4 +- libc/misc/error/err.c | 48 +++++--- libc/misc/error/error.c | 24 ++-- libc/misc/file/lockf.c | 20 +-- libc/misc/file/lockf64.c | 21 ++-- libc/misc/fnmatch/fnmatch.c | 118 +++++++++--------- libc/misc/fnmatch/fnmatch_loop.c | 6 +- libc/misc/fnmatch/fnmatch_old.c | 11 +- libc/misc/ftw/ftw.c | 65 +++++----- libc/misc/ftw/ftw64.c | 4 +- libc/misc/glob/glob.c | 57 +++++---- libc/misc/glob/glob64.c | 6 +- libc/misc/gnu/obstack.c | 23 ++-- libc/misc/internals/__uClibc_main.c | 45 ++++--- libc/misc/internals/tempname.c | 43 ++++--- libc/misc/locale/locale.c | 119 +++++++++--------- libc/misc/mntent/mntent.c | 37 ++++-- libc/misc/regex/regcomp.c | 5 +- libc/misc/regex/regex.c | 69 ++++++----- libc/misc/regex/regex_old.c | 49 ++++---- libc/misc/search/hsearch.c | 8 +- libc/misc/search/hsearch_r.c | 25 ++-- libc/misc/search/lsearch.c | 13 +- libc/misc/search/tsearch.c | 16 +-- libc/misc/statfs/fstatfs64.c | 19 ++- libc/misc/statfs/fstatvfs.c | 8 +- libc/misc/statfs/fstatvfs64.c | 9 +- libc/misc/statfs/internal_statvfs.c | 48 ++++---- libc/misc/statfs/statfs64.c | 18 ++- libc/misc/statfs/statvfs.c | 7 +- libc/misc/statfs/statvfs64.c | 6 +- libc/misc/syslog/syslog.c | 108 ++++++++++------- libc/misc/sysvipc/ftok.c | 4 +- libc/misc/sysvipc/shm.c | 4 +- libc/misc/time/adjtime.c | 8 +- libc/misc/time/ftime.c | 4 +- libc/misc/time/time.c | 235 +++++++++++++++++++----------------- libc/misc/ttyent/getttyent.c | 30 +++-- libc/misc/utmp/utent.c | 51 ++++---- libc/misc/utmp/wtent.c | 54 ++++----- libc/misc/wchar/Makefile.in | 2 +- libc/misc/wchar/wchar.c | 115 ++++++++++-------- libc/misc/wchar/wstdio.c | 27 +++-- libc/misc/wctype/wctype.c | 175 ++++++++++++++------------- libc/misc/wordexp/wordexp.c | 136 +++++++++++---------- 60 files changed, 1144 insertions(+), 923 deletions(-) (limited to 'libc/misc') diff --git a/libc/misc/assert/__assert.c b/libc/misc/assert/__assert.c index c55f0b6ae..130bb044f 100644 --- a/libc/misc/assert/__assert.c +++ b/libc/misc/assert/__assert.c @@ -33,6 +33,9 @@ #include #include +libc_hidden_proto(fprintf) +libc_hidden_proto(abort) + /* Get the prototype from assert.h as a double-check. */ #undef NDEBUG #include diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c index 69b4c1a6d..3f7bfd859 100644 --- a/libc/misc/ctype/ctype.c +++ b/libc/misc/ctype/ctype.c @@ -156,6 +156,9 @@ int CTYPE_NAME(NAME) (int c) \ #ifdef L___ctype_assert #ifdef __UCLIBC_HAS_CTYPE_ENFORCED__ +libc_hidden_proto(fprintf) +libc_hidden_proto(abort) + void __isctype_assert(int c, int mask) { fprintf(stderr, "%s: __is*{_l}(%d,%#x {locale})\n", __uclibc_progname, c, mask); @@ -266,9 +269,10 @@ IS_FUNC_BODY(xdigit); /**********************************************************************/ #ifdef L_tolower +#undef tolower #ifdef __UCLIBC_HAS_CTYPE_TABLES__ -int attribute_hidden __tolower(int c) +int tolower(int c) { #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__) assert(CTYPE_DOMAIN_CHECK(c)); @@ -278,38 +282,38 @@ int attribute_hidden __tolower(int c) #else /* __UCLIBC_HAS_CTYPE_TABLES__ */ -int attribute_hidden __tolower(int c) +int tolower(int c) { return __C_tolower(c); } #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */ -strong_alias(__tolower,tolower) +libc_hidden_proto(tolower) +libc_hidden_def(tolower) #endif /**********************************************************************/ #ifdef L_tolower_l #undef tolower_l -#undef __tolower_l - -int __tolower_l(int c, __locale_t l) +int tolower_l(int c, __locale_t l) { #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__) assert(CTYPE_DOMAIN_CHECK(c)); #endif return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_tolower[c] : c; } - -weak_alias(__tolower_l, tolower_l) +libc_hidden_proto(tolower_l) +libc_hidden_def(tolower_l) #endif /**********************************************************************/ #ifdef L_toupper +#undef toupper #ifdef __UCLIBC_HAS_CTYPE_TABLES__ -int attribute_hidden __toupper(int c) +int toupper(int c) { #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__) assert(CTYPE_DOMAIN_CHECK(c)); @@ -319,22 +323,21 @@ int attribute_hidden __toupper(int c) #else /* __UCLIBC_HAS_CTYPE_TABLES__ */ -int attribute_hidden __toupper(int c) +int toupper(int c) { return __C_toupper(c); } #endif /* __UCLIBC_HAS_CTYPE_TABLES__ */ -strong_alias(__toupper,toupper) +libc_hidden_proto(toupper) +libc_hidden_def(toupper) #endif /**********************************************************************/ #ifdef L_toupper_l #undef toupper_l -#undef __toupper_l - -int __toupper_l(int c, __locale_t l) +int toupper_l(int c, __locale_t l) { #if defined(__UCLIBC_HAS_CTYPE_ENFORCED__) assert(CTYPE_DOMAIN_CHECK(c)); @@ -342,7 +345,8 @@ int __toupper_l(int c, __locale_t l) return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_toupper[c] : c; } -weak_alias(__toupper_l, toupper_l) +libc_hidden_proto(toupper_l) +libc_hidden_def(toupper_l) #endif /**********************************************************************/ diff --git a/libc/misc/dirent/alphasort.c b/libc/misc/dirent/alphasort.c index feae021e6..ea45829d3 100644 --- a/libc/misc/dirent/alphasort.c +++ b/libc/misc/dirent/alphasort.c @@ -2,9 +2,11 @@ #include #include "dirstream.h" +libc_hidden_proto(strcmp) + int alphasort(const void * a, const void * b) { - return __strcmp ((*(const struct dirent **) a)->d_name, + return strcmp ((*(const struct dirent **) a)->d_name, (*(const struct dirent **) b)->d_name); } diff --git a/libc/misc/dirent/alphasort64.c b/libc/misc/dirent/alphasort64.c index c6cfcdacf..2bba1fcc9 100644 --- a/libc/misc/dirent/alphasort64.c +++ b/libc/misc/dirent/alphasort64.c @@ -16,9 +16,10 @@ #include #include "dirstream.h" +libc_hidden_proto(strcmp) int alphasort64(const void * a, const void * b) { - return __strcmp ((*(const struct dirent64 **) a)->d_name, + return strcmp ((*(const struct dirent64 **) a)->d_name, (*(const struct dirent64 **) b)->d_name); } diff --git a/libc/misc/dirent/closedir.c b/libc/misc/dirent/closedir.c index 8066b5861..870414a87 100644 --- a/libc/misc/dirent/closedir.c +++ b/libc/misc/dirent/closedir.c @@ -4,7 +4,10 @@ #include #include "dirstream.h" -int attribute_hidden __closedir(DIR * dir) +libc_hidden_proto(closedir) +libc_hidden_proto(close) + +int closedir(DIR * dir) { int fd; @@ -24,6 +27,6 @@ int attribute_hidden __closedir(DIR * dir) __pthread_mutex_unlock(&(dir->dd_lock)); free(dir->dd_buf); free(dir); - return __close(fd); + return close(fd); } -strong_alias(__closedir,closedir) +libc_hidden_def(closedir) diff --git a/libc/misc/dirent/dirfd.c b/libc/misc/dirent/dirfd.c index 48e955450..236614642 100644 --- a/libc/misc/dirent/dirfd.c +++ b/libc/misc/dirent/dirfd.c @@ -1,8 +1,14 @@ +/* + * Copyright (C) 2000-2006 Erik Andersen + * + * Licensed under the LGPL v2.1, see the file COPYING.LIB in this tarball. + */ + #include #include #include "dirstream.h" -int attribute_hidden __dirfd(DIR * dir) +int dirfd(DIR * dir) { if (!dir || dir->dd_fd == -1) { __set_errno(EBADF); @@ -11,4 +17,5 @@ int attribute_hidden __dirfd(DIR * dir) return dir->dd_fd; } -strong_alias(__dirfd,dirfd) +libc_hidden_proto(dirfd) +libc_hidden_def(dirfd) diff --git a/libc/misc/dirent/dirstream.h b/libc/misc/dirent/dirstream.h index 15c70858f..713204c03 100644 --- a/libc/misc/dirent/dirstream.h +++ b/libc/misc/dirent/dirstream.h @@ -72,10 +72,10 @@ struct __dirstream { extern ssize_t __getdents(int fd, char *buf, size_t count) attribute_hidden; -extern struct dirent *__readdir (DIR *__dirp) __nonnull ((1)) attribute_hidden; +libc_hidden_proto(readdir) #ifdef __UCLIBC_HAS_LFS__ extern ssize_t __getdents64 (int fd, char *buf, size_t count) attribute_hidden; -extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden; +libc_hidden_proto(readdir64) #endif #endif /* dirent.h */ diff --git a/libc/misc/dirent/opendir.c b/libc/misc/dirent/opendir.c index 82e7f364f..707bf45dc 100644 --- a/libc/misc/dirent/opendir.c +++ b/libc/misc/dirent/opendir.c @@ -7,32 +7,37 @@ #include #include "dirstream.h" +libc_hidden_proto(opendir) +libc_hidden_proto(open) +libc_hidden_proto(fcntl) +libc_hidden_proto(close) +libc_hidden_proto(stat) /* opendir just makes an open() call - it return NULL if it fails * (open sets errno), otherwise it returns a DIR * pointer. */ -DIR attribute_hidden *__opendir(const char *name) +DIR *opendir(const char *name) { int fd; struct stat statbuf; char *buf; DIR *ptr; - if (__stat(name, &statbuf)) + if (stat(name, &statbuf)) return NULL; if (!S_ISDIR(statbuf.st_mode)) { __set_errno(ENOTDIR); return NULL; } - if ((fd = __open(name, O_RDONLY)) < 0) + if ((fd = open(name, O_RDONLY)) < 0) return NULL; /* According to POSIX, directory streams should be closed when * exec. From "Anna Pluzhnikov" . */ - if (__fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) + if (fcntl(fd, F_SETFD, FD_CLOEXEC) < 0) return NULL; if (!(ptr = malloc(sizeof(*ptr)))) { - __close(fd); + close(fd); __set_errno(ENOMEM); return NULL; } @@ -45,7 +50,7 @@ DIR attribute_hidden *__opendir(const char *name) ptr->dd_max = 512; if (!(buf = calloc(1, ptr->dd_max))) { - __close(fd); + close(fd); free(ptr); __set_errno(ENOMEM); return NULL; @@ -54,4 +59,4 @@ DIR attribute_hidden *__opendir(const char *name) __pthread_mutex_init(&(ptr->dd_lock), NULL); return ptr; } -strong_alias(__opendir,opendir) +libc_hidden_def(opendir) diff --git a/libc/misc/dirent/readdir.c b/libc/misc/dirent/readdir.c index 2d4ad4aeb..e26479c13 100644 --- a/libc/misc/dirent/readdir.c +++ b/libc/misc/dirent/readdir.c @@ -7,7 +7,9 @@ #include #include "dirstream.h" -struct dirent attribute_hidden *__readdir(DIR * dir) +libc_hidden_proto(readdir) + +struct dirent *readdir(DIR * dir) { ssize_t bytes; struct dirent *de; @@ -46,4 +48,4 @@ all_done: __pthread_mutex_unlock(&(dir->dd_lock)); return de; } -strong_alias(__readdir,readdir) +libc_hidden_def(readdir) diff --git a/libc/misc/dirent/readdir64.c b/libc/misc/dirent/readdir64.c index 177af3fc9..2134d19fe 100644 --- a/libc/misc/dirent/readdir64.c +++ b/libc/misc/dirent/readdir64.c @@ -20,7 +20,9 @@ #include #include "dirstream.h" -struct dirent64 attribute_hidden *__readdir64(DIR * dir) +libc_hidden_proto(readdir64) + +struct dirent64 *readdir64(DIR * dir) { ssize_t bytes; struct dirent64 *de; @@ -60,4 +62,4 @@ all_done: return de; } -strong_alias(__readdir64,readdir64) +libc_hidden_def(readdir64) diff --git a/libc/misc/dirent/readdir64_r.c b/libc/misc/dirent/readdir64_r.c index 1cbaf3156..b8de4fa6f 100644 --- a/libc/misc/dirent/readdir64_r.c +++ b/libc/misc/dirent/readdir64_r.c @@ -19,6 +19,8 @@ #include #include "dirstream.h" +libc_hidden_proto(memcpy) + int readdir64_r(DIR *dir, struct dirent64 *entry, struct dirent64 **result) { int ret; @@ -59,7 +61,7 @@ int readdir64_r(DIR *dir, struct dirent64 *entry, struct dirent64 **result) if (de == NULL) { *result = NULL; } else { - *result = __memcpy (entry, de, de->d_reclen); + *result = memcpy (entry, de, de->d_reclen); } ret = 0; diff --git a/libc/misc/dirent/readdir_r.c b/libc/misc/dirent/readdir_r.c index 25cb80b63..769352f0a 100644 --- a/libc/misc/dirent/readdir_r.c +++ b/libc/misc/dirent/readdir_r.c @@ -5,6 +5,8 @@ #include #include "dirstream.h" +libc_hidden_proto(memcpy) + int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result) { int ret; @@ -45,7 +47,7 @@ int readdir_r(DIR *dir, struct dirent *entry, struct dirent **result) if (de == NULL) { *result = NULL; } else { - *result = __memcpy (entry, de, de->d_reclen); + *result = memcpy (entry, de, de->d_reclen); } ret = 0; diff --git a/libc/misc/dirent/rewinddir.c b/libc/misc/dirent/rewinddir.c index 18d6547a8..ec89f17a7 100644 --- a/libc/misc/dirent/rewinddir.c +++ b/libc/misc/dirent/rewinddir.c @@ -3,6 +3,7 @@ #include #include "dirstream.h" +libc_hidden_proto(lseek) /* rewinddir() just does an lseek(fd,0,0) - see close for comments */ void rewinddir(DIR * dir) @@ -12,7 +13,7 @@ void rewinddir(DIR * dir) return; } __pthread_mutex_lock(&(dir->dd_lock)); - __lseek(dir->dd_fd, 0, SEEK_SET); + lseek(dir->dd_fd, 0, SEEK_SET); dir->dd_nextoff = dir->dd_nextloc = dir->dd_size = 0; __pthread_mutex_unlock(&(dir->dd_lock)); } 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)) diff --git a/libc/misc/dirent/scandir64.c b/libc/misc/dirent/scandir64.c index e77b88d3c..44252b6f0 100644 --- a/libc/misc/dirent/scandir64.c +++ b/libc/misc/dirent/scandir64.c @@ -20,10 +20,6 @@ /* Modified for uClibc by Erik Andersen */ -#define qsort __qsort -#define opendir __opendir -#define closedir __closedir - #include #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 @@ -47,6 +43,11 @@ #include #include "dirstream.h" +libc_hidden_proto(memcpy) +libc_hidden_proto(opendir) +libc_hidden_proto(closedir) +libc_hidden_proto(qsort) + int scandir64(const char *dir, struct dirent64 ***namelist, int (*selector) (const struct dirent64 *), int (*compar) (const void *, const void *)) @@ -64,7 +65,7 @@ int scandir64(const char *dir, struct dirent64 ***namelist, __set_errno (0); pos = 0; - while ((current = __readdir64 (dp)) != NULL) + while ((current = readdir64 (dp)) != NULL) if (selector == NULL || (*selector) (current)) { struct dirent64 *vnew; @@ -91,7 +92,7 @@ int scandir64(const char *dir, struct dirent64 ***namelist, if (vnew == NULL) break; - names[pos++] = (struct dirent64 *) __memcpy (vnew, current, dsize); + names[pos++] = (struct dirent64 *) memcpy (vnew, current, dsize); } if (unlikely(errno != 0)) diff --git a/libc/misc/dirent/seekdir.c b/libc/misc/dirent/seekdir.c index 6e841291a..5aa848b2a 100644 --- a/libc/misc/dirent/seekdir.c +++ b/libc/misc/dirent/seekdir.c @@ -3,6 +3,8 @@ #include #include "dirstream.h" +libc_hidden_proto(lseek) + void seekdir(DIR * dir, long int offset) { if (!dir) { @@ -10,7 +12,7 @@ void seekdir(DIR * dir, long int offset) return; } __pthread_mutex_lock(&(dir->dd_lock)); - dir->dd_nextoff = __lseek(dir->dd_fd, offset, SEEK_SET); + dir->dd_nextoff = lseek(dir->dd_fd, offset, SEEK_SET); dir->dd_size = dir->dd_nextloc = 0; __pthread_mutex_unlock(&(dir->dd_lock)); } diff --git a/libc/misc/error/err.c b/libc/misc/error/err.c index 43fe60cc6..f27a5e7e8 100644 --- a/libc/misc/error/err.c +++ b/libc/misc/error/err.c @@ -5,8 +5,6 @@ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ -#define vfprintf __vfprintf - #define _GNU_SOURCE #include #include @@ -22,6 +20,18 @@ #warning REMINDER: Deal with wide oriented stderr case. #endif +libc_hidden_proto(vwarn) +libc_hidden_proto(vwarnx) +libc_hidden_proto(err) +libc_hidden_proto(verr) +libc_hidden_proto(verrx) + +libc_hidden_proto(fprintf) +libc_hidden_proto(vfprintf) +libc_hidden_proto(__xpg_strerror_r) +libc_hidden_proto(exit) +libc_hidden_proto(vfprintf) + static void vwarn_work(const char *format, va_list args, int showerr) { /* 0123 45678 9 a b*/ @@ -34,7 +44,7 @@ static void vwarn_work(const char *format, va_list args, int showerr) f = fmt + 11; /* At 11. */ if (showerr) { f -= 4; /* At 7. */ - __xpg_strerror_r_internal(errno, buf, sizeof(buf)); + __xpg_strerror_r(errno, buf, sizeof(buf)); } __STDIO_AUTO_THREADLOCK(stderr); @@ -49,68 +59,68 @@ static void vwarn_work(const char *format, va_list args, int showerr) __STDIO_AUTO_THREADUNLOCK(stderr); } -void attribute_hidden __vwarn(const char *format, va_list args) +void vwarn(const char *format, va_list args) { vwarn_work(format, args, 1); } -strong_alias(__vwarn,vwarn) +libc_hidden_def(vwarn) void warn(const char *format, ...) { va_list args; va_start(args, format); - __vwarn(format, args); + vwarn(format, args); va_end(args); } -void attribute_hidden __vwarnx(const char *format, va_list args) +void vwarnx(const char *format, va_list args) { vwarn_work(format, args, 0); } -strong_alias(__vwarnx,vwarnx) +libc_hidden_def(vwarnx) void warnx(const char *format, ...) { va_list args; va_start(args, format); - __vwarnx(format, args); + vwarnx(format, args); va_end(args); } -void attribute_hidden __verr(int status, const char *format, va_list args) +void verr(int status, const char *format, va_list args) { - __vwarn(format, args); - __exit(status); + vwarn(format, args); + exit(status); } -strong_alias(__verr,verr) +libc_hidden_def(verr) void attribute_noreturn err(int status, const char *format, ...) { va_list args; va_start(args, format); - __verr(status, format, args); + verr(status, format, args); /* This should get optimized away. We'll leave it now for safety. */ /* The loop is added only to keep gcc happy. */ while(1) va_end(args); } -void attribute_hidden __verrx(int status, const char *format, va_list args) +void verrx(int status, const char *format, va_list args) { - __vwarnx(format, args); - __exit(status); + vwarnx(format, args); + exit(status); } -strong_alias(__verrx,verrx) +libc_hidden_def(verrx) void attribute_noreturn errx(int status, const char *format, ...) { va_list args; va_start(args, format); - __verrx(status, format, args); + verrx(status, format, args); /* This should get optimized away. We'll leave it now for safety. */ /* The loop is added only to keep gcc happy. */ while(1) diff --git a/libc/misc/error/error.c b/libc/misc/error/error.c index 60605c212..1c2585345 100644 --- a/libc/misc/error/error.c +++ b/libc/misc/error/error.c @@ -22,17 +22,21 @@ /* Written by David MacKenzie . */ /* Adjusted slightly by Erik Andersen */ -#define strerror __strerror -#define vfprintf __vfprintf -#define fflush __fflush - #include #include #include #include #include "error.h" -extern int __putc(int c, FILE *stream) attribute_hidden; +libc_hidden_proto(strcmp) +libc_hidden_proto(strerror) +libc_hidden_proto(fprintf) +libc_hidden_proto(exit) +libc_hidden_proto(putc) +libc_hidden_proto(vfprintf) +libc_hidden_proto(fflush) +libc_hidden_proto(fputc) +libc_hidden_proto(__fputc_unlocked) /* This variable is incremented each time `error' is called. */ unsigned int error_message_count = 0; @@ -59,9 +63,9 @@ void __error (int status, int errnum, const char *message, ...) if (errnum) { fprintf (stderr, ": %s", strerror (errnum)); } - __putc ('\n', stderr); + putc ('\n', stderr); if (status) - __exit (status); + exit (status); } void __error_at_line (int status, int errnum, const char *file_name, @@ -74,7 +78,7 @@ void __error_at_line (int status, int errnum, const char *file_name, static unsigned int old_line_number; if (old_line_number == line_number && - (file_name == old_file_name || !__strcmp (old_file_name, file_name))) + (file_name == old_file_name || !strcmp (old_file_name, file_name))) /* Simply return and print nothing. */ return; @@ -95,9 +99,9 @@ void __error_at_line (int status, int errnum, const char *file_name, if (errnum) { fprintf (stderr, ": %s", strerror (errnum)); } - __putc ('\n', stderr); + putc ('\n', stderr); if (status) - __exit (status); + exit (status); } /* Use the weaks here in an effort at controlling namespace pollution */ diff --git a/libc/misc/file/lockf.c b/libc/misc/file/lockf.c index 2ba81de9a..6c1184be2 100644 --- a/libc/misc/file/lockf.c +++ b/libc/misc/file/lockf.c @@ -17,7 +17,6 @@ Boston, MA 02111-1307, USA. */ #include -#undef __lockf #include #include @@ -25,14 +24,19 @@ #include #include +libc_hidden_proto(lockf) + +libc_hidden_proto(memset) +libc_hidden_proto(fcntl) +libc_hidden_proto(getpid) + /* lockf is a simplified interface to fcntl's locking facilities. */ -#undef lockf -int attribute_hidden __lockf (int fd, int cmd, off_t len) +int lockf (int fd, int cmd, off_t len) { struct flock fl; - __memset ((char *) &fl, '\0', sizeof (fl)); + memset ((char *) &fl, '\0', sizeof (fl)); /* lockf is always relative to the current file position. */ fl.l_whence = SEEK_CUR; @@ -45,9 +49,9 @@ int attribute_hidden __lockf (int fd, int cmd, off_t len) /* Test the lock: return 0 if FD is unlocked or locked by this process; return -1, set errno to EACCES, if another process holds the lock. */ fl.l_type = F_RDLCK; - if (__fcntl (fd, F_GETLK, &fl) < 0) + if (fcntl (fd, F_GETLK, &fl) < 0) return -1; - if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ()) + if (fl.l_type == F_UNLCK || fl.l_pid == getpid ()) return 0; __set_errno(EACCES); return -1; @@ -70,6 +74,6 @@ int attribute_hidden __lockf (int fd, int cmd, off_t len) return -1; } - return __fcntl(fd, cmd, &fl); + return fcntl(fd, cmd, &fl); } -strong_alias(__lockf,lockf) +libc_hidden_def(lockf) diff --git a/libc/misc/file/lockf64.c b/libc/misc/file/lockf64.c index 1e294d9a6..be5fc6c07 100644 --- a/libc/misc/file/lockf64.c +++ b/libc/misc/file/lockf64.c @@ -17,7 +17,6 @@ Boston, MA 02111-1307, USA. */ #include -#undef __lockf64 #ifdef __UCLIBC_HAS_LFS__ #if defined _FILE_OFFSET_BITS && _FILE_OFFSET_BITS != 64 @@ -43,17 +42,20 @@ #ifdef __NR_fcntl64 #define flock flock64 -#define fcntl __fcntl64 +#define fcntl fcntl64 #define F_GETLK F_GETLK64 #define F_SETLK F_SETLK64 -#else -#define fcntl __fcntl #endif +libc_hidden_proto(lockf64) + +libc_hidden_proto(memset) +libc_hidden_proto(fcntl) +libc_hidden_proto(getpid) + /* lockf is a simplified interface to fcntl's locking facilities. */ -#undef lockf64 -int attribute_hidden __lockf64 (int fd, int cmd, off64_t len64) +int lockf64 (int fd, int cmd, off64_t len64) { struct flock fl; off_t len = (off_t) len64; @@ -65,7 +67,7 @@ int attribute_hidden __lockf64 (int fd, int cmd, off64_t len64) return -1; } - __memset((char *) &fl, '\0', sizeof (fl)); + memset((char *) &fl, '\0', sizeof (fl)); /* lockf is always relative to the current file position. */ fl.l_whence = SEEK_CUR; @@ -80,7 +82,7 @@ int attribute_hidden __lockf64 (int fd, int cmd, off64_t len64) fl.l_type = F_RDLCK; if (fcntl (fd, F_GETLK, &fl) < 0) return -1; - if (fl.l_type == F_UNLCK || fl.l_pid == __getpid ()) + if (fl.l_type == F_UNLCK || fl.l_pid == getpid ()) return 0; __set_errno(EACCES); return -1; @@ -105,5 +107,4 @@ int attribute_hidden __lockf64 (int fd, int cmd, off64_t len64) return fcntl(fd, cmd, &fl); } - -strong_alias(__lockf64,lockf64) +libc_hidden_def(lockf64) diff --git a/libc/misc/fnmatch/fnmatch.c b/libc/misc/fnmatch/fnmatch.c index d5d3e753b..dc18c2f59 100644 --- a/libc/misc/fnmatch/fnmatch.c +++ b/libc/misc/fnmatch/fnmatch.c @@ -17,8 +17,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -#define strcmp __strcmp - #if HAVE_CONFIG_H # include #endif @@ -34,11 +32,6 @@ # define HAVE_STRING_H 1 # define STDC_HEADERS # define HAVE___STRCHRNUL 1 -extern void *__mempcpy (void *__restrict __dest, - __const void *__restrict __src, size_t __n) - __THROW __nonnull ((1, 2)) attribute_hidden; -extern void *__memchr (__const void *__s, int __c, size_t __n) - __THROW __attribute_pure__ __nonnull ((1)) attribute_hidden; # ifdef __UCLIBC_HAS_WCHAR__ # define HAVE_WCHAR_H 1 # define HAVE_WCTYPE_H 1 @@ -64,6 +57,22 @@ extern void *__memchr (__const void *__s, int __c, size_t __n) # include #endif +#ifdef __UCLIBC__ +#define __memset memset +libc_hidden_proto(memchr) +libc_hidden_proto(memset) +libc_hidden_proto(mempcpy) +libc_hidden_proto(strcat) +libc_hidden_proto(strcmp) +/*libc_hidden_proto(strchr)*/ +/*libc_hidden_proto(strchrnul)*/ +libc_hidden_proto(strlen) +libc_hidden_proto(strcoll) +libc_hidden_proto(tolower) +libc_hidden_proto(fnmatch) +libc_hidden_proto(getenv) +#endif + /* For platform which support the ISO C amendement 1 functionality we support user defined character classes. */ #if defined _LIBC || (defined HAVE_WCTYPE_H && defined HAVE_WCHAR_H) @@ -71,24 +80,20 @@ extern void *__memchr (__const void *__s, int __c, size_t __n) # include # include # ifdef __UCLIBC__ -extern wctype_t __wctype (__const char *__property) __THROW attribute_hidden; -extern int __iswctype (wint_t __wc, wctype_t __desc) __THROW attribute_hidden; -extern wint_t __btowc (int __c) __THROW attribute_hidden; +libc_hidden_proto(wctype) +libc_hidden_proto(iswctype) +libc_hidden_proto(btowc) # ifdef __UCLIBC_HAS_LOCALE__ -extern size_t __mbsrtowcs (wchar_t *__restrict __dst, - __const char **__restrict __src, size_t __len, - mbstate_t *__restrict __ps) __THROW attribute_hidden; -extern size_t __wcslen (__const wchar_t *__s) __THROW __attribute_pure__ attribute_hidden; -extern wchar_t *__wmempcpy (wchar_t *__restrict __s1, - __const wchar_t *__restrict __s2, size_t __n) - __THROW attribute_hidden; -extern wchar_t *__wcscat (wchar_t *__restrict __dest, - __const wchar_t *__restrict __src) __THROW attribute_hidden; -extern size_t __strnlen (__const char *__string, size_t __maxlen) - __THROW __attribute_pure__ __nonnull ((1)) attribute_hidden; -extern wchar_t *__wmemchr (__const wchar_t *__s, wchar_t __c, size_t __n) - __THROW __attribute_pure__ attribute_hidden; -extern wint_t __towlower (wint_t __wc) __THROW attribute_hidden; +libc_hidden_proto(wmemchr) +libc_hidden_proto(wmempcpy) +libc_hidden_proto(wcscat) +/*libc_hidden_proto(wcschr)*/ +/*libc_hidden_proto(wcschrnul)*/ +libc_hidden_proto(wcslen) +libc_hidden_proto(wcscoll) +libc_hidden_proto(towlower) +libc_hidden_proto(mbsrtowcs) +libc_hidden_proto(strnlen) # endif # endif #endif @@ -96,21 +101,22 @@ extern wint_t __towlower (wint_t __wc) __THROW attribute_hidden; /* We need some of the locale data (the collation sequence information) but there is no interface to get this information in general. Therefore we support a correct implementation only in glibc. */ -#if defined _LIBC || defined __UCLIBC__ -# ifndef __UCLIBC__ +#if defined _LIBC # include "../locale/localeinfo.h" # include "../locale/elem-hash.h" # include "../locale/coll-lookup.h" # include -# endif # define CONCAT(a,b) __CONCAT(a,b) -# if defined _LIBC || defined __UCLIBC_HAS_LOCALE__ +# if defined _LIBC # define mbsrtowcs __mbsrtowcs # endif # define fnmatch __fnmatch extern int fnmatch (const char *pattern, const char *string, int flags) attribute_hidden; #endif +#ifdef __UCLIBC__ +# define CONCAT(a,b) __CONCAT(a,b) +#endif /* We often have to test for FNM_FILE_NAME and FNM_PERIOD being both set. */ #define NO_LEADING_PERIOD(flags) \ @@ -168,13 +174,13 @@ extern int fnmatch (const char *pattern, const char *string, int flags) attribut # define CHAR_CLASS_MAX_LENGTH 256 # endif -# if defined _LIBC || defined __UCLIBC__ +# if defined _LIBC # define IS_CHAR_CLASS(string) __wctype (string) # else # define IS_CHAR_CLASS(string) wctype (string) # endif -# if defined _LIBC || defined __UCLIBC__ +# if defined _LIBC # define ISWCTYPE(WC, WT) __iswctype (WC, WT) # else # define ISWCTYPE(WC, WT) iswctype (WC, WT) @@ -246,7 +252,7 @@ __wcschrnul (s, c) # endif /* Note that this evaluates C many times. */ -# if defined _LIBC || defined __UCLIBC__ +# if defined _LIBC # define FOLD(c) ((flags & FNM_CASEFOLD) ? __tolower (c) : (c)) # else # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) @@ -258,22 +264,22 @@ __wcschrnul (s, c) # define EXT ext_match # define END end_pattern # define L(CS) CS -# if defined _LIBC || defined __UCLIBC__ +# if defined _LIBC # define BTOWC(C) __btowc (C) # else # define BTOWC(C) btowc (C) # endif -# define STRLEN(S) __strlen (S) -# define STRCAT(D, S) __strcat (D, S) -# define MEMPCPY(D, S, N) __mempcpy (D, S, N) -# define MEMCHR(S, C, N) __memchr (S, C, N) -# define STRCOLL(S1, S2) __strcoll (S1, S2) +# define STRLEN(S) strlen (S) +# define STRCAT(D, S) strcat (D, S) +# define MEMPCPY(D, S, N) mempcpy (D, S, N) +# define MEMCHR(S, C, N) memchr (S, C, N) +# define STRCOLL(S1, S2) strcoll (S1, S2) # include "fnmatch_loop.c" # if HANDLE_MULTIBYTE /* Note that this evaluates C many times. */ -# if defined _LIBC || defined __UCLIBC__ +# if defined _LIBC # define FOLD(c) ((flags & FNM_CASEFOLD) ? __towlower (c) : (c)) # else # define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? towlower (c) : (c)) @@ -286,11 +292,11 @@ __wcschrnul (s, c) # define END end_wpattern # define L(CS) L##CS # define BTOWC(C) (C) -# define STRLEN(S) __wcslen (S) -# define STRCAT(D, S) __wcscat (D, S) -# define MEMPCPY(D, S, N) __wmempcpy (D, S, N) -# define MEMCHR(S, C, N) __wmemchr (S, C, N) -# define STRCOLL(S1, S2) __wcscoll (S1, S2) +# define STRLEN(S) wcslen (S) +# define STRCAT(D, S) wcscat (D, S) +# define MEMPCPY(D, S, N) wmempcpy (D, S, N) +# define MEMCHR(S, C, N) wmemchr (S, C, N) +# define STRCOLL(S1, S2) wcscoll (S1, S2) # ifndef __UCLIBC__ # define WIDE_CHAR_VERSION 1 # endif @@ -354,7 +360,7 @@ is_char_class (const wchar_t *wcs) *cp = '\0'; -# if defined _LIBC || defined __UCLIBC__ +# if defined _LIBC return __wctype (s); # else return wctype (s); @@ -365,15 +371,16 @@ is_char_class (const wchar_t *wcs) # include "fnmatch_loop.c" # endif +extern size_t _stdlib_mb_cur_max (void) __THROW __wur; +libc_hidden_proto(_stdlib_mb_cur_max) -int attribute_hidden +int fnmatch (const char *pattern, const char *string, int flags) { # if HANDLE_MULTIBYTE # ifdef __UCLIBC_HAS_WCHAR__ # undef MB_CUR_MAX -# define MB_CUR_MAX (_stdlib_mb_cur_max_internal ()) -extern size_t _stdlib_mb_cur_max_internal (void) __THROW __wur attribute_hidden; +# define MB_CUR_MAX (_stdlib_mb_cur_max ()) # endif if (__builtin_expect (MB_CUR_MAX, 1) != 1) { @@ -387,9 +394,9 @@ extern size_t _stdlib_mb_cur_max_internal (void) __THROW __wur attribute_hidden; __memset (&ps, '\0', sizeof (ps)); p = pattern; #if defined _LIBC || defined __UCLIBC__ - n = __strnlen (pattern, 1024); + n = strnlen (pattern, 1024); #else - n = __strlen (pattern); + n = strlen (pattern); #endif if (__builtin_expect (n < 1024, 1)) { @@ -418,9 +425,9 @@ extern size_t _stdlib_mb_cur_max_internal (void) __THROW __wur attribute_hidden; assert (mbsinit (&ps)); #if defined _LIBC || defined __UCLIBC__ - n = __strnlen (string, 1024); + n = strnlen (string, 1024); #else - n = __strlen (string); + n = strlen (string); #endif p = string; if (__builtin_expect (n < 1024, 1)) @@ -453,11 +460,11 @@ extern size_t _stdlib_mb_cur_max_internal (void) __THROW __wur attribute_hidden; } # endif /* mbstate_t and mbsrtowcs or _LIBC. */ - return internal_fnmatch (pattern, string, string + __strlen (string), + return internal_fnmatch (pattern, string, string + strlen (string), flags & FNM_PERIOD, flags); } -# if defined _LIBC || defined __UCLIBC__ +# if defined _LIBC # undef fnmatch # ifndef __UCLIBC__ versioned_symbol (libc, __fnmatch, fnmatch, GLIBC_2_2_3); @@ -466,9 +473,10 @@ strong_alias (__fnmatch, __fnmatch_old) compat_symbol (libc, __fnmatch_old, fnmatch, GLIBC_2_0); # endif libc_hidden_ver (__fnmatch, fnmatch) -# else -strong_alias(__fnmatch,fnmatch) # endif +# else +libc_hidden_proto(fnmatch) +libc_hidden_def(fnmatch) # endif #endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/libc/misc/fnmatch/fnmatch_loop.c b/libc/misc/fnmatch/fnmatch_loop.c index 663af1222..191cef50c 100644 --- a/libc/misc/fnmatch/fnmatch_loop.c +++ b/libc/misc/fnmatch/fnmatch_loop.c @@ -214,7 +214,7 @@ FCT (pattern, string, string_end, no_leading_period, flags) UCHAR fn; if (posixly_correct == 0) - posixly_correct = __getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; if (n == string_end) return FNM_NOMATCH; @@ -993,7 +993,7 @@ END (const CHAR *pattern) { /* Handle brackets special. */ if (posixly_correct == 0) - posixly_correct = __getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; /* Skip the not sign. We have to recognize it because of a possibly following ']'. */ @@ -1045,7 +1045,7 @@ EXT (INT opt, const CHAR *pattern, const CHAR *string, const CHAR *string_end, { /* Handle brackets special. */ if (posixly_correct == 0) - posixly_correct = __getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; + posixly_correct = getenv ("POSIXLY_CORRECT") != NULL ? 1 : -1; /* Skip the not sign. We have to recognize it because of a possibly following ']'. */ diff --git a/libc/misc/fnmatch/fnmatch_old.c b/libc/misc/fnmatch/fnmatch_old.c index 2762b3930..47075e914 100644 --- a/libc/misc/fnmatch/fnmatch_old.c +++ b/libc/misc/fnmatch/fnmatch_old.c @@ -28,6 +28,9 @@ Cambridge, MA 02139, USA. */ #include #include +libc_hidden_proto(fnmatch) + +libc_hidden_proto(tolower) /* Comment out all this code if we are using the GNU C Library, and are not actually compiling the library itself. This code is part of the GNU C Library, but also included in many other GNU distributions. Compiling @@ -50,13 +53,13 @@ Cambridge, MA 02139, USA. */ /* Match STRING against the filename pattern PATTERN, returning zero if it matches, nonzero if not. */ -int attribute_hidden __fnmatch(const char *pattern, const char *string, int flags) +int fnmatch(const char *pattern, const char *string, int flags) { register const char *p = pattern, *n = string; register char c; /* Note that this evaluates C many times. */ -# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? __tolower (c) : (c)) +# define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) while ((c = *p++) != '\0') { c = FOLD(c); @@ -116,7 +119,7 @@ int attribute_hidden __fnmatch(const char *pattern, const char *string, int flag c1 = FOLD(c1); for (--p; *n != '\0'; ++n) if ((c == '[' || FOLD(*n) == c1) && - __fnmatch(p, n, flags & ~FNM_PERIOD) == 0) + fnmatch(p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; } @@ -220,5 +223,5 @@ int attribute_hidden __fnmatch(const char *pattern, const char *string, int flag # undef FOLD } -strong_alias(__fnmatch,fnmatch) +libc_hidden_def(fnmatch) #endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/libc/misc/ftw/ftw.c b/libc/misc/ftw/ftw.c index fdea1c208..b2c0c4ee4 100644 --- a/libc/misc/ftw/ftw.c +++ b/libc/misc/ftw/ftw.c @@ -31,17 +31,6 @@ #define HAVE_SYS_PARAM_H 1 #define HAVE_DECL_STPCPY 1 #define HAVE_MEMPCPY 1 -#define dirfd __dirfd -#define tsearch __tsearch -#define tfind __tfind -#define tdestroy __tdestroy -#define getcwd __getcwd -#define chdir __chdir -#define fchdir __fchdir -#define mempcpy __mempcpy -#define opendir __opendir -#define closedir __closedir -#define stpcpy __stpcpy #endif #if __GNUC__ @@ -64,7 +53,7 @@ char *alloca (); #else # if HAVE_DIRENT_H # include -# define NAMLEN(dirent) __strlen ((dirent)->d_name) +# define NAMLEN(dirent) strlen ((dirent)->d_name) # else # define dirent direct # define NAMLEN(dirent) (dirent)->d_namlen @@ -96,6 +85,28 @@ char *alloca (); # include #endif +libc_hidden_proto(memset) +libc_hidden_proto(strchr) +libc_hidden_proto(strlen) +libc_hidden_proto(dirfd) +libc_hidden_proto(tsearch) +libc_hidden_proto(tfind) +libc_hidden_proto(tdestroy) +libc_hidden_proto(getcwd) +libc_hidden_proto(chdir) +libc_hidden_proto(fchdir) +libc_hidden_proto(mempcpy) +libc_hidden_proto(opendir) +#ifdef __UCLIBC_HAS_LFS__ +libc_hidden_proto(readdir64) +libc_hidden_proto(lstat64) +libc_hidden_proto(stat64) +#endif +libc_hidden_proto(closedir) +libc_hidden_proto(stpcpy) +libc_hidden_proto(lstat) +libc_hidden_proto(stat) + #if ! _LIBC && !HAVE_DECL_STPCPY && !defined stpcpy char *stpcpy (); #endif @@ -108,24 +119,30 @@ char *stpcpy (); /* #define NDEBUG 1 */ #include -#if !defined _LIBC && !defined __UCLIBC__ +#if !defined _LIBC # undef __chdir # define __chdir chdir # undef __closedir # define __closedir closedir # undef __fchdir # define __fchdir fchdir -# ifndef __UCLIBC__ # undef __getcwd +# ifndef __UCLIBC__ # define __getcwd(P, N) xgetcwd () extern char *xgetcwd (void); +# else +# define __getcwd getcwd # endif # undef __mempcpy # define __mempcpy mempcpy # undef __opendir # define __opendir opendir # undef __readdir64 +# ifndef __UCLIBC_HAS_LFS__ # define __readdir64 readdir +# else +# define __readdir64 readdir64 +# endif # undef __stpcpy # define __stpcpy stpcpy # undef __tdestroy @@ -136,8 +153,10 @@ extern char *xgetcwd (void); # define __tsearch tsearch # undef internal_function # define internal_function /* empty */ +# ifndef __UCLIBC_HAS_LFS__ # undef dirent64 # define dirent64 dirent +# endif # undef MAX # define MAX(a, b) ((a) > (b) ? (a) : (b)) #endif @@ -167,21 +186,11 @@ int rpl_lstat (const char *, struct stat *); # define LXSTAT __lxstat # define XSTAT __xstat # else -# ifdef __UCLIBC__ -# define LXSTAT(V,f,sb) __lstat(f,sb) -# define XSTAT(V,f,sb) __stat(f,sb) -# define __readdir64 __readdir -# define dirent64 dirent -# else # define LXSTAT(V,f,sb) lstat (f,sb) # define XSTAT(V,f,sb) stat (f,sb) -# endif # endif # define FTW_FUNC_T __ftw_func_t # define NFTW_FUNC_T __nftw_func_t -extern struct dirent *__readdir (DIR *__dirp) __nonnull ((1)) attribute_hidden; -# else -extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden; #endif /* We define PATH_MAX if the system does not provide a definition. @@ -520,7 +529,7 @@ fail: /* Next, update the `struct FTW' information. */ ++data->ftw.level; - startp = __strchr (data->dirbuf, '\0'); + startp = strchr (data->dirbuf, '\0'); /* There always must be a directory name. */ assert (startp != data->dirbuf); if (startp[-1] != '/') @@ -556,7 +565,7 @@ fail: while (result == 0 && *runp != '\0') { - char *endp = __strchr (runp, '\0'); + char *endp = strchr (runp, '\0'); result = process_entry (data, &dir, runp, endp - runp); @@ -633,10 +642,10 @@ ftw_startup (const char *dir, int is_nftw, void *func, int descriptors, data.actdir = 0; data.dirstreams = (struct dir_data **) alloca (data.maxdir * sizeof (struct dir_data *)); - __memset (data.dirstreams, '\0', data.maxdir * sizeof (struct dir_data *)); + memset (data.dirstreams, '\0', data.maxdir * sizeof (struct dir_data *)); /* PATH_MAX is always defined when we get here. */ - data.dirbufsize = MAX (2 * __strlen (dir), PATH_MAX); + data.dirbufsize = MAX (2 * strlen (dir), PATH_MAX); data.dirbuf = (char *) malloc (data.dirbufsize); if (data.dirbuf == NULL) return -1; diff --git a/libc/misc/ftw/ftw64.c b/libc/misc/ftw/ftw64.c index c4edd4d0a..de2fe22d1 100644 --- a/libc/misc/ftw/ftw64.c +++ b/libc/misc/ftw/ftw64.c @@ -24,8 +24,8 @@ #define NFTW_NEW_NAME __new_nftw64 #define INO_T ino64_t #define STAT stat64 -#define LXSTAT(V,f,sb) __lstat64(f,sb) -#define XSTAT(V,f,sb) __stat64(f,sb) +#define LXSTAT(V,f,sb) lstat64(f,sb) +#define XSTAT(V,f,sb) stat64(f,sb) #define FTW_FUNC_T __ftw64_func_t #define NFTW_FUNC_T __nftw64_func_t diff --git a/libc/misc/glob/glob.c b/libc/misc/glob/glob.c index ea87d371c..d55a649ab 100644 --- a/libc/misc/glob/glob.c +++ b/libc/misc/glob/glob.c @@ -15,11 +15,6 @@ License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#define strrchr __strrchr -#define strcoll __strcoll -#define qsort __qsort -#define fnmatch __fnmatch - #include #include #include @@ -33,8 +28,17 @@ Cambridge, MA 02139, USA. */ #define _GNU_SOURCE #include -extern DIR *__opendir (__const char *__name) __nonnull ((1)) attribute_hidden; -extern int __closedir (DIR *__dirp) __nonnull ((1)) attribute_hidden; +libc_hidden_proto(memcpy) +libc_hidden_proto(strcat) +libc_hidden_proto(strcmp) +libc_hidden_proto(strlen) +libc_hidden_proto(strrchr) +libc_hidden_proto(strcoll) +libc_hidden_proto(opendir) +libc_hidden_proto(closedir) +libc_hidden_proto(fnmatch) +libc_hidden_proto(qsort) +libc_hidden_proto(lstat) extern __ptr_t (*__glob_opendir_hook) __P ((const char *directory)); extern void (*__glob_closedir_hook) __P ((__ptr_t stream)); @@ -51,12 +55,15 @@ static int collated_compare __P ((const __ptr_t, const __ptr_t)); #ifdef __GLOB64 extern int __glob_pattern_p(const char *pattern, int quote) attribute_hidden; +libc_hidden_proto(readdir64) +#define __readdir readdir64 #else -extern struct dirent *__readdir (DIR *__dirp) __nonnull ((1)) attribute_hidden; extern int __glob (__const char *__restrict __pattern, int __flags, int (*__errfunc) (__const char *, int), glob_t *__restrict __pglob) __THROW attribute_hidden; extern void __globfree (glob_t *__pglob) __THROW attribute_hidden; +#define __readdir readdir +libc_hidden_proto(readdir) /* Return nonzero if PATTERN contains any metacharacters. Metacharacters can be quoted with backslashes if QUOTE is nonzero. */ int attribute_hidden __glob_pattern_p(const char *pattern, int quote) @@ -138,7 +145,7 @@ __glob (pattern, flags, errfunc, pglob) { dirlen = filename - pattern; dirname = (char *) alloca (dirlen + 1); - __memcpy (dirname, pattern, dirlen); + memcpy (dirname, pattern, dirlen); dirname[dirlen] = '\0'; ++filename; } @@ -230,11 +237,11 @@ __glob (pattern, flags, errfunc, pglob) /* No matches. */ if (flags & GLOB_NOCHECK) { - size_t len = __strlen (pattern) + 1; + size_t len = strlen (pattern) + 1; char *patcopy = (char *) malloc (len); if (patcopy == NULL) return GLOB_NOSPACE; - __memcpy (patcopy, pattern, len); + memcpy (patcopy, pattern, len); pglob->gl_pathv = (char **) realloc (pglob->gl_pathv, @@ -290,9 +297,9 @@ __glob (pattern, flags, errfunc, pglob) int i; struct stat st; for (i = oldcount; i < pglob->gl_pathc; ++i) - if (__lstat (pglob->gl_pathv[i], &st) == 0 && + if (lstat (pglob->gl_pathv[i], &st) == 0 && S_ISDIR (st.st_mode)) - __strcat (pglob->gl_pathv[i], "/"); + strcat (pglob->gl_pathv[i], "/"); } if (!(flags & GLOB_NOSORT)) @@ -364,7 +371,7 @@ prefix_array (dirname, array, n, add_slash) int add_slash; { register size_t i; - size_t dirlen = __strlen (dirname); + size_t dirlen = strlen (dirname); if (dirlen == 1 && dirname[0] == '/') /* DIRNAME is just "/", so normal prepending would get us "//foo". @@ -373,7 +380,7 @@ prefix_array (dirname, array, n, add_slash) for (i = 0; i < n; ++i) { - size_t eltlen = __strlen (array[i]) + 1; + size_t eltlen = strlen (array[i]) + 1; char *new = (char *) malloc (dirlen + 1 + eltlen + (add_slash ? 1 : 0)); if (new == NULL) { @@ -382,9 +389,9 @@ prefix_array (dirname, array, n, add_slash) return 1; } - __memcpy (new, dirname, dirlen); + memcpy (new, dirname, dirlen); new[dirlen] = '/'; - __memcpy (&new[dirlen + 1], array[i], eltlen); + memcpy (&new[dirlen + 1], array[i], eltlen); free ((__ptr_t) array[i]); array[i] = new; } @@ -417,7 +424,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) int meta; stream = (__glob_opendir_hook ? (*__glob_opendir_hook) (directory) - : (__ptr_t) __opendir (directory)); + : (__ptr_t) opendir (directory)); if (stream == NULL) { if ((errfunc != NULL && (*errfunc) (directory, errno)) || @@ -457,7 +464,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) #endif } - if ((!meta && __strcmp (pattern, name) == 0) + if ((!meta && strcmp (pattern, name) == 0) || fnmatch (pattern, name, (!(flags & GLOB_PERIOD) ? FNM_PERIOD : 0) | ((flags & GLOB_NOESCAPE) ? FNM_NOESCAPE : 0)) == 0) @@ -465,12 +472,12 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) struct globlink *new = (struct globlink *) alloca (sizeof (struct globlink)); if (len == 0) - len = __strlen (name); + len = strlen (name); new->name = (char *) malloc (len + ((flags & GLOB_MARK) ? 1 : 0) + 1); if (new->name == NULL) goto memory_error; - __memcpy ((__ptr_t) new->name, name, len); + memcpy ((__ptr_t) new->name, name, len); new->name[len] = '\0'; new->next = names; names = new; @@ -482,14 +489,14 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) if (nfound == 0 && (flags & GLOB_NOCHECK)) { - size_t len = __strlen (pattern); + size_t len = strlen (pattern); nfound = 1; names = (struct globlink *) alloca (sizeof (struct globlink)); names->next = NULL; names->name = (char *) malloc (len + (flags & GLOB_MARK ? 1 : 0) + 1); if (names->name == NULL) goto memory_error; - __memcpy (names->name, pattern, len); + memcpy (names->name, pattern, len); names->name[len] = '\0'; } @@ -517,7 +524,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) if (__glob_closedir_hook) (*__glob_closedir_hook) (stream); else - (void) __closedir ((DIR *) stream); + (void) closedir ((DIR *) stream); errno = save; } return nfound == 0 ? GLOB_NOMATCH : 0; @@ -528,7 +535,7 @@ glob_in_dir (pattern, directory, flags, errfunc, pglob) if (__glob_closedir_hook) (*__glob_closedir_hook) (stream); else - (void) __closedir ((DIR *) stream); + (void) closedir ((DIR *) stream); errno = save; } while (names != NULL) diff --git a/libc/misc/glob/glob64.c b/libc/misc/glob/glob64.c index f0c65abe0..5baf86810 100644 --- a/libc/misc/glob/glob64.c +++ b/libc/misc/glob/glob64.c @@ -18,15 +18,13 @@ #include #include -extern struct dirent64 *__readdir64 (DIR *__dirp) __nonnull ((1)) attribute_hidden; + extern int __glob64 (__const char *__restrict __pattern, int __flags, int (*__errfunc) (__const char *, int), glob64_t *__restrict __pglob) __THROW attribute_hidden; extern void __globfree (glob_t *__pglob) __THROW attribute_hidden; extern void __globfree64 (glob64_t *__pglob) __THROW attribute_hidden; - #define dirent dirent64 -#define __readdir(dirp) __readdir64(dirp) #define glob_t glob64_t #define __glob(pattern, flags, errfunc, pglob) \ @@ -38,7 +36,7 @@ extern void __globfree64 (glob64_t *__pglob) __THROW attribute_hidden; #undef stat #define stat stat64 -#define __lstat __lstat64 +#define lstat lstat64 #define __GLOB64 1 diff --git a/libc/misc/gnu/obstack.c b/libc/misc/gnu/obstack.c index 6521bd1d4..5fc031555 100644 --- a/libc/misc/gnu/obstack.c +++ b/libc/misc/gnu/obstack.c @@ -51,7 +51,7 @@ # endif #endif -#if defined _LIBC && defined USE_IN_LIBIO +#if (defined _LIBC && defined USE_IN_LIBIO) || defined __UCLIBC_HAS_WCHAR__ # include #endif @@ -105,6 +105,14 @@ void (*obstack_alloc_failed_handler) () = print_and_abort; # ifndef EXIT_FAILURE # define EXIT_FAILURE 1 # endif + +libc_hidden_proto(fprintf) +libc_hidden_proto(abort) +libc_hidden_proto(exit) +#ifdef __UCLIBC_HAS_WCHAR__ +libc_hidden_proto(fwprintf) +#endif + int obstack_exit_failure = EXIT_FAILURE; /* The non-GNU-C macros copy the obstack into this global variable @@ -480,15 +488,8 @@ _obstack_memory_used (h) # define fputs(s, f) _IO_fputs (s, f) # endif -# ifndef __attribute__ -/* This feature is available in gcc versions 2.5 and later. */ -# if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 5) -# define __attribute__(Spec) /* empty */ -# endif -# endif - static void -__attribute__ ((noreturn)) +attribute_noreturn print_and_abort () { /* Don't change any of these strings. Yes, it would be possible to add @@ -498,11 +499,11 @@ print_and_abort () a very similar string which requires a separate translation. */ # if defined _LIBC && defined USE_IN_LIBIO if (_IO_fwide (stderr, 0) > 0) - __fwprintf (stderr, L"%s\n", _("memory exhausted")); + fwprintf (stderr, L"%s\n", _("memory exhausted")); else # endif fprintf (stderr, "%s\n", _("memory exhausted")); - __exit (obstack_exit_failure); + exit (obstack_exit_failure); } # if 0 diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c index 414342c79..9987324b2 100644 --- a/libc/misc/internals/__uClibc_main.c +++ b/libc/misc/internals/__uClibc_main.c @@ -13,11 +13,6 @@ * avoided in the static library case. */ -#define getgid __getgid -#define getuid __getuid -#define getegid __getegid -#define geteuid __geteuid - #define _ERRNO_H #include #include @@ -33,6 +28,21 @@ #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(strrchr) +libc_hidden_proto(getgid) +libc_hidden_proto(getuid) +libc_hidden_proto(getegid) +libc_hidden_proto(geteuid) +libc_hidden_proto(fstat) +libc_hidden_proto(abort) +libc_hidden_proto(exit) + +extern int __libc_open (__const char *__file, int __oflag, ...) __nonnull ((1)); +libc_hidden_proto(__libc_open) +extern int __libc_fcntl (int __fd, int __cmd, ...); +libc_hidden_proto(__libc_fcntl) + #ifndef SHARED void *__libc_stack_end=NULL; @@ -84,7 +94,8 @@ weak_alias(__environ, environ) /* TODO: don't export __pagesize; we cant now because libpthread uses it */ size_t __pagesize = 0; -hidden_strong_alias(__pagesize,__pagesize_internal) +libc_hidden_proto(__pagesize) +libc_hidden_def(__pagesize) #ifndef O_NOFOLLOW # define O_NOFOLLOW 0 @@ -95,18 +106,17 @@ hidden_strong_alias(__pagesize,__pagesize_internal) static void __check_one_fd(int fd, int mode) { /* Check if the specified fd is already open */ - if (unlikely(__fcntl(fd, F_GETFD)==-1 && *(__errno_location())==EBADF)) + if (unlikely(__libc_fcntl(fd, F_GETFD)==-1 && *(__errno_location())==EBADF)) { /* The descriptor is probably not open, so try to use /dev/null */ struct stat st; - int nullfd = __open(_PATH_DEVNULL, mode); + int nullfd = __libc_open(_PATH_DEVNULL, mode); /* /dev/null is major=1 minor=3. Make absolutely certain * that is in fact the device that we have opened and not * some other wierd file... */ - if ( (nullfd!=fd) || __fstat(fd, &st) || !S_ISCHR(st.st_mode) || + if ( (nullfd!=fd) || fstat(fd, &st) || !S_ISCHR(st.st_mode) || (st.st_rdev != makedev(1, 3))) { - /* Somebody is trying some trickery here... */ abort(); } } @@ -152,7 +162,7 @@ void __uClibc_init(void) /* Setup an initial value. This may not be perfect, but is * better than malloc using __pagesize=0 for atexit, ctors, etc. */ - __pagesize_internal = PAGE_SIZE; + __pagesize = PAGE_SIZE; #ifdef __UCLIBC_HAS_THREADS__ /* Before we start initializing uClibc we have to call @@ -189,7 +199,8 @@ void __uClibc_init(void) _stdio_init(); } -hidden_strong_alias(__uClibc_init,__uClibc_init_internal) +libc_hidden_proto(__uClibc_init) +libc_hidden_def(__uClibc_init) #ifdef __UCLIBC_CTOR_DTOR__ void attribute_hidden (*__app_fini)(void) = NULL; @@ -237,7 +248,7 @@ __uClibc_main(int (*main)(int, char **, char **), int argc, while (*aux_dat) { ElfW(auxv_t) *auxv_entry = (ElfW(auxv_t) *) aux_dat; if (auxv_entry->a_type <= AT_EGID) { - __memcpy(&(auxvt[auxv_entry->a_type]), auxv_entry, sizeof(ElfW(auxv_t))); + memcpy(&(auxvt[auxv_entry->a_type]), auxv_entry, sizeof(ElfW(auxv_t))); } aux_dat += 2; } @@ -246,11 +257,11 @@ __uClibc_main(int (*main)(int, char **, char **), int argc, /* We need to initialize uClibc. If we are dynamically linked this * may have already been completed by the shared lib loader. We call * __uClibc_init() regardless, to be sure the right thing happens. */ - __uClibc_init_internal(); + __uClibc_init(); #ifdef __ARCH_HAS_MMU__ /* Make certain getpagesize() gives the correct answer */ - __pagesize_internal = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE; + __pagesize = (auxvt[AT_PAGESZ].a_un.a_val)? auxvt[AT_PAGESZ].a_un.a_val : PAGE_SIZE; /* Prevent starting SUID binaries where the stdin. stdout, and * stderr file descriptors are not already opened. */ @@ -267,7 +278,7 @@ __uClibc_main(int (*main)(int, char **, char **), int argc, #ifdef __UCLIBC_HAS_PROGRAM_INVOCATION_NAME__ __progname_full = *argv; - __progname = __strrchr(*argv, '/'); + __progname = strrchr(*argv, '/'); if (__progname != NULL) ++__progname; else @@ -300,5 +311,5 @@ __uClibc_main(int (*main)(int, char **, char **), int argc, /* * Finally, invoke application's main and then exit. */ - __exit(main(argc, argv, __environ)); + exit(main(argc, argv, __environ)); } diff --git a/libc/misc/internals/tempname.c b/libc/misc/internals/tempname.c index 64fa1e14b..b8b421f13 100644 --- a/libc/misc/internals/tempname.c +++ b/libc/misc/internals/tempname.c @@ -31,10 +31,6 @@ * Use brain damaged getpid() if real random fails. */ -#define open64 __open64 -#define mkdir __mkdir -#define gettimeofday __gettimeofday - #include #include #include @@ -49,12 +45,23 @@ #include #include "tempname.h" +libc_hidden_proto(strlen) +libc_hidden_proto(strcmp) +libc_hidden_proto(sprintf) +libc_hidden_proto(mkdir) +libc_hidden_proto(open) +libc_hidden_proto(open64) +libc_hidden_proto(read) +libc_hidden_proto(close) +libc_hidden_proto(getpid) +libc_hidden_proto(stat) +libc_hidden_proto(gettimeofday) /* Return nonzero if DIR is an existent directory. */ static int direxists (const char *dir) { struct stat buf; - return __stat(dir, &buf) == 0 && S_ISDIR (buf.st_mode); + return stat(dir, &buf) == 0 && S_ISDIR (buf.st_mode); } /* Path search algorithm, for tmpnam, tmpfile, etc. If DIR is @@ -76,7 +83,7 @@ int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *di } else { - plen = __strlen (pfx); + plen = strlen (pfx); if (plen > 5) plen = 5; } @@ -98,7 +105,7 @@ int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *di { if (direxists (P_tmpdir)) dir = P_tmpdir; - else if (__strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp")) + else if (strcmp (P_tmpdir, "/tmp") != 0 && direxists ("/tmp")) dir = "/tmp"; else { @@ -107,7 +114,7 @@ int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *di } } - dlen = __strlen (dir); + dlen = strlen (dir); while (dlen > 1 && dir[dlen - 1] == '/') dlen--; /* remove trailing slashes */ @@ -118,7 +125,7 @@ int attribute_hidden ___path_search (char *tmpl, size_t tmpl_len, const char *di return -1; } - __sprintf (tmpl, "%.*s/%.*sXXXXXX", dlen, dir, plen, pfx); + sprintf (tmpl, "%.*s/%.*sXXXXXX", dlen, dir, plen, pfx); return 0; } @@ -131,13 +138,13 @@ static unsigned int fillrand(unsigned char *buf, unsigned int len) { int fd; unsigned int result = -1; - fd = __open("/dev/urandom", O_RDONLY); + fd = open("/dev/urandom", O_RDONLY); if (fd < 0) { - fd = __open("/dev/random", O_RDONLY | O_NONBLOCK); + fd = open("/dev/random", O_RDONLY | O_NONBLOCK); } if (fd >= 0) { - result = __read(fd, buf, len); - __close(fd); + result = read(fd, buf, len); + close(fd); } return result; } @@ -149,7 +156,7 @@ static void brain_damaged_fillrand(unsigned char *buf, unsigned int len) uint32_t high, low, rh; static uint64_t value; gettimeofday(&tv, NULL); - value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ __getpid(); + value += ((uint64_t) tv.tv_usec << 16) ^ tv.tv_sec ^ getpid(); low = value & UINT32_MAX; high = value >> 32; for (i = 0; i < len; ++i) { @@ -188,10 +195,10 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind) unsigned char randomness[6]; size_t len; - len = __strlen (tmpl); + len = strlen (tmpl); /* This is where the Xs start. */ XXXXXX = tmpl + len - 6; - if (len < 6 || __strcmp (XXXXXX, "XXXXXX")) + if (len < 6 || strcmp (XXXXXX, "XXXXXX")) { __set_errno (EINVAL); return -1; @@ -212,7 +219,7 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind) case __GT_NOCREATE: { struct stat st; - if (__stat (tmpl, &st) < 0) { + if (stat (tmpl, &st) < 0) { if (errno == ENOENT) { fd = 0; goto restore_and_ret; @@ -223,7 +230,7 @@ int attribute_hidden __gen_tempname (char *tmpl, int kind) fd = 0; } case __GT_FILE: - fd = __open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); + fd = open (tmpl, O_RDWR | O_CREAT | O_EXCL, S_IRUSR | S_IWUSR); break; #if defined __UCLIBC_HAS_LFS__ case __GT_BIGFILE: diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c index 1a20300db..28ebb3fb2 100644 --- a/libc/misc/locale/locale.c +++ b/libc/misc/locale/locale.c @@ -46,15 +46,10 @@ * locale support had (8-bit codesets only). */ -#define stpcpy __stpcpy -#define strtok_r __strtok_r -/* #define fflush __fflush */ - #define _GNU_SOURCE #define __CTYPE_HAS_8_BIT_LOCALES 1 - #include #include #include @@ -65,6 +60,18 @@ #include #include +libc_hidden_proto(memcpy) +libc_hidden_proto(memset) +libc_hidden_proto(stpcpy) +libc_hidden_proto(strtok_r) +libc_hidden_proto(strlen) +libc_hidden_proto(strcmp) +libc_hidden_proto(strcpy) +libc_hidden_proto(strncmp) +libc_hidden_proto(strchr) +libc_hidden_proto(getenv) +/*libc_hidden_proto(fflush)*/ + #ifdef __UCLIBC_MJN3_ONLY__ #ifdef L_setlocale #warning TODO: Make the link_warning()s a config option? @@ -157,7 +164,7 @@ char *setlocale(int category, register const char *locale) && ( (!locale) /* Request for locale category string. */ || (!*locale) /* Implementation-defined default is C. */ || ((*locale == 'C') && !locale[1]) - || (!__strcmp(locale, "POSIX"))) ) + || (!strcmp(locale, "POSIX"))) ) ? (char *) C_string /* Always in C/POSIX locale. */ : NULL; } @@ -186,6 +193,8 @@ static const char utf8[] = "UTF-8"; */ static char hr_locale[(MAX_LOCALE_CATEGORY_STR * LC_ALL) + MAX_LOCALE_STR]; +libc_hidden_proto(newlocale) + static void update_hr_locale(const unsigned char *spec) { const unsigned char *loc; @@ -228,7 +237,7 @@ static void update_hr_locale(const unsigned char *spec) *n = 0; } else { char at = 0; - __memcpy(n, LOCALE_NAMES + 5*((*loc)-1), 5); + memcpy(n, LOCALE_NAMES + 5*((*loc)-1), 5); if (n[2] != '_') { at = n[2]; n[2] = '_'; @@ -263,9 +272,6 @@ static void update_hr_locale(const unsigned char *spec) } while (!done); } -extern __locale_t __newlocale (int __category_mask, __const char *__locale, - __locale_t __base) __THROW attribute_hidden; - char *setlocale(int category, const char *locale) { if (((unsigned int)(category)) > LC_ALL) { @@ -276,7 +282,7 @@ char *setlocale(int category, const char *locale) } if (locale != NULL) { /* Not just a query... */ - if (!__newlocale((1 << category), locale, __global_locale)) { + if (!newlocale((1 << category), locale, __global_locale)) { return NULL; /* Failed! */ } update_hr_locale(__global_locale->cur_locale); @@ -460,7 +466,7 @@ static int init_cur_collate(int der_num, __collate_t *cur_collate) + cdd->base_idx * sizeof(coldata_base_t) )/2 ); - __memcpy(cur_collate, cdb, offsetof(coldata_base_t,index2weight_offset)); + memcpy(cur_collate, cdb, offsetof(coldata_base_t,index2weight_offset)); cur_collate->undefined_idx = cdd->undefined_idx; cur_collate->ti_mask = (1 << cur_collate->ti_shift)-1; @@ -512,9 +518,9 @@ static int init_cur_collate(int der_num, __collate_t *cur_collate) cur_collate->index2ruleidx = cur_collate->index2weight + cur_collate->max_col_index + 1; - __memcpy(cur_collate->index2weight, cur_collate->index2weight_tbl, + memcpy(cur_collate->index2weight, cur_collate->index2weight_tbl, cur_collate->num_col_base * sizeof(uint16_t)); - __memcpy(cur_collate->index2ruleidx, cur_collate->index2ruleidx_tbl, + memcpy(cur_collate->index2ruleidx, cur_collate->index2ruleidx_tbl, cur_collate->num_col_base * sizeof(uint16_t)); /* now do the overrides */ @@ -599,7 +605,7 @@ int attribute_hidden _locale_set_l(const u