diff options
author | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-14 00:58:03 +0000 |
---|---|---|
committer | Peter S. Mazinger <ps.m@gmx.net> | 2006-01-14 00:58:03 +0000 |
commit | af0172162f7c653cad6a11ed1c1a5459bc154465 (patch) | |
tree | 70031dad1e7286d58762da7b9e3d3f93d043c278 /libc/stdio | |
parent | c8609543a9a8bf6559c2931dbbef6b3c41b3fbf2 (diff) |
hidden_def/hidden_proto: convert all users (I hope) termios split, add some missing headers, other jump relocs removed
Diffstat (limited to 'libc/stdio')
87 files changed, 640 insertions, 474 deletions
diff --git a/libc/stdio/_READ.c b/libc/stdio/_READ.c index e27309c11..0c7febb3c 100644 --- a/libc/stdio/_READ.c +++ b/libc/stdio/_READ.c @@ -5,10 +5,11 @@ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ -#define read __read - #include "_stdio.h" +libc_hidden_proto(read) +libc_hidden_proto(abort) + /* Given a reading stream without its end-of-file indicator set and * with no buffered input or ungots, read at most 'bufsize' bytes * into 'buf' (which may be the stream's __bufstart). diff --git a/libc/stdio/__fsetlocking.c b/libc/stdio/__fsetlocking.c index 5b6070cc3..74f253626 100644 --- a/libc/stdio/__fsetlocking.c +++ b/libc/stdio/__fsetlocking.c @@ -15,7 +15,7 @@ * glibc treats invalid locking_mode args as FSETLOCKING_INTERNAL. */ -int attribute_hidden __fsetlocking_internal(FILE *stream, int locking_mode) +int __fsetlocking(FILE *stream, int locking_mode) { #ifdef __UCLIBC_HAS_THREADS__ int current = 1 + (stream->__user_locking & 1); @@ -44,4 +44,5 @@ int attribute_hidden __fsetlocking_internal(FILE *stream, int locking_mode) #endif } -strong_alias(__fsetlocking_internal,__fsetlocking) +libc_hidden_proto(__fsetlocking) +libc_hidden_def(__fsetlocking) diff --git a/libc/stdio/_cs_funcs.c b/libc/stdio/_cs_funcs.c index ef92048c0..38a8351e5 100644 --- a/libc/stdio/_cs_funcs.c +++ b/libc/stdio/_cs_funcs.c @@ -7,20 +7,29 @@ #include "_stdio.h" +libc_hidden_proto(read) +libc_hidden_proto(write) +libc_hidden_proto(close) +#ifdef __UCLIBC_HAS_LFS__ +libc_hidden_proto(lseek64) +#else +libc_hidden_proto(lseek) +#endif + /**********************************************************************/ #ifdef __UCLIBC_HAS_GLIBC_CUSTOM_STREAMS__ /**********************************************************************/ ssize_t attribute_hidden _cs_read(void *cookie, char *buf, size_t bufsize) { - return __read(*((int *) cookie), buf, bufsize); + return read(*((int *) cookie), buf, bufsize); } /**********************************************************************/ ssize_t attribute_hidden _cs_write(void *cookie, const char *buf, size_t bufsize) { - return __write(*((int *) cookie), (char *) buf, bufsize); + return write(*((int *) cookie), (char *) buf, bufsize); } /**********************************************************************/ @@ -30,9 +39,9 @@ int attribute_hidden _cs_seek(void *cookie, register __offmax_t *pos, int whence __offmax_t res; #ifdef __UCLIBC_HAS_LFS__ - res = __lseek64(*((int *) cookie), *pos, whence); + res = lseek64(*((int *) cookie), *pos, whence); #else - res = __lseek(*((int *) cookie), *pos, whence); + res = lseek(*((int *) cookie), *pos, whence); #endif return (res >= 0) ? ((*pos = res), 0) : ((int) res); @@ -42,7 +51,7 @@ int attribute_hidden _cs_seek(void *cookie, register __offmax_t *pos, int whence int attribute_hidden _cs_close(void *cookie) { - return __close(*((int *) cookie)); + return close(*((int *) cookie)); } /**********************************************************************/ @@ -54,9 +63,9 @@ int attribute_hidden __stdio_seek(FILE *stream, register __offmax_t *pos, int wh __offmax_t res; #ifdef __UCLIBC_HAS_LFS__ - res = __lseek64(stream->__filedes, *pos, whence); + res = lseek64(stream->__filedes, *pos, whence); #else - res = __lseek(stream->__filedes, *pos, whence); + res = lseek(stream->__filedes, *pos, whence); #endif return (res >= 0) ? ((*pos = res), 0) : ((int) res); diff --git a/libc/stdio/_flushlbf.c b/libc/stdio/_flushlbf.c index 31ed2fc55..8a551a746 100644 --- a/libc/stdio/_flushlbf.c +++ b/libc/stdio/_flushlbf.c @@ -8,6 +8,8 @@ #include "_stdio.h" #include <stdio_ext.h> +libc_hidden_proto(fflush_unlocked) + /* Solaris function -- * Flush all line buffered (writing) streams. */ diff --git a/libc/stdio/_fopen.c b/libc/stdio/_fopen.c index b4f4d46c7..02051eff9 100644 --- a/libc/stdio/_fopen.c +++ b/libc/stdio/_fopen.c @@ -5,10 +5,12 @@ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ -#define isatty __isatty - #include "_stdio.h" +libc_hidden_proto(isatty) +libc_hidden_proto(open) +libc_hidden_proto(fcntl) + /* * Cases: * fopen64 : filename != NULL, stream == NULL, filedes == -2 @@ -121,7 +123,7 @@ FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode, /* NOTE: fopencookie needs changing if the basic check changes! */ if (((i & (((int) fname_or_mode) + 1)) != i) /* Basic agreement? */ || (((open_mode & ~((__mode_t) fname_or_mode)) & O_APPEND) - && __fcntl(filedes, F_SETFL, O_APPEND)) /* Need O_APPEND. */ + && fcntl(filedes, F_SETFL, O_APPEND)) /* Need O_APPEND. */ ) { goto DO_EINVAL; } @@ -130,7 +132,7 @@ FILE attribute_hidden *_stdio_fopen(intptr_t fname_or_mode, & O_LARGEFILE) ); } else { __STDIO_WHEN_LFS( if (filedes < -1) open_mode |= O_LARGEFILE ); - if ((stream->__filedes = __open(((const char *) fname_or_mode), + if ((stream->__filedes = open(((const char *) fname_or_mode), open_mode, 0666)) < 0) { goto FREE_STREAM; } diff --git a/libc/stdio/_fpmaxtostr.c b/libc/stdio/_fpmaxtostr.c index 99fc9a9dd..03fe6b1db 100644 --- a/libc/stdio/_fpmaxtostr.c +++ b/libc/stdio/_fpmaxtostr.c @@ -11,6 +11,8 @@ #include <locale.h> #include <bits/uClibc_fpmax.h> +libc_hidden_proto(memset) + typedef size_t (__fp_outfunc_t)(FILE *fp, intptr_t type, intptr_t len, intptr_t buf); @@ -417,7 +419,7 @@ ssize_t attribute_hidden _fpmaxtostr(FILE * fp, __fpmax_t x, struct printf_info if (mode == 'f') { round += exp; if (round < -1) { - __memset(buf, '0', DECIMAL_DIG); /* OK, since 'f' -> decimal case. */ + memset(buf, '0', DECIMAL_DIG); /* OK, since 'f' -> decimal case. */ exp = -1; round = -1; } diff --git a/libc/stdio/_fwrite.c b/libc/stdio/_fwrite.c index 600b15e6d..1e0f7ceee 100644 --- a/libc/stdio/_fwrite.c +++ b/libc/stdio/_fwrite.c @@ -5,11 +5,12 @@ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ -#define memrchr __memrchr -#define memchr __memchr - #include "_stdio.h" +libc_hidden_proto(memchr) +libc_hidden_proto(memcpy) +libc_hidden_proto(memrchr) + #ifdef __STDIO_BUFFERS /* Either buffer data or (commit buffer if necessary and) write. */ @@ -35,7 +36,7 @@ size_t attribute_hidden __stdio_fwrite(const unsigned char * __restrict buffer, if (pending > bytes) { pending = bytes; } - __memcpy(stream->__bufpos, buffer, pending); + memcpy(stream->__bufpos, buffer, pending); stream->__bufpos += pending; __STDIO_STREAM_VALIDATE(stream); return bytes; @@ -43,7 +44,7 @@ size_t attribute_hidden __stdio_fwrite(const unsigned char * __restrict buffer, /* RETRY: */ if (bytes <= __STDIO_STREAM_BUFFER_WAVAIL(stream)) { - __memcpy(stream->__bufpos, buffer, bytes); + memcpy(stream->__bufpos, buffer, bytes); stream->__bufpos += bytes; if (__STDIO_STREAM_IS_LBF(stream) && memrchr(buffer, '\n', bytes) /* Search backwards. */ diff --git a/libc/stdio/_stdio.c b/libc/stdio/_stdio.c index 54319118f..6454b3f3b 100644 --- a/libc/stdio/_stdio.c +++ b/libc/stdio/_stdio.c @@ -5,10 +5,11 @@ * Dedicated to Toni. See uClibc/DEDICATION.mjn3 for details. */ -#define isatty __isatty - #include "_stdio.h" +libc_hidden_proto(memcpy) +libc_hidden_proto(isatty) + /* This is pretty much straight from uClibc, but with one important * difference. * @@ -169,7 +170,7 @@ void attribute_hidden __stdio_init_mutex(pthread_mutex_t *m) static const pthread_mutex_t __stdio_mutex_initializer = PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP; - __memcpy(m, &__stdio_mutex_initializer, sizeof(__stdio_mutex_initializer)); + memcpy(m, &__stdio_mutex_initializer, sizeof(__stdio_mutex_initializer)); } #endif diff --git a/libc/stdio/_stdio.h b/libc/stdio/_stdio.h index 0badc9fd1..d6b68b3bb 100644 --- a/libc/stdio/_stdio.h +++ b/libc/stdio/_stdio.h @@ -18,36 +18,8 @@ #include <stdlib.h> #include <string.h> #include <unistd.h> - -extern int __vfprintf (FILE *__restrict __s, __const char *__restrict __format, - __gnuc_va_list __arg) attribute_hidden; - -extern int __vsnprintf (char *__restrict __s, size_t __maxlen, - __const char *__restrict __format, __gnuc_va_list __arg) - __THROW __attribute__ ((__format__ (__printf__, 3, 0))) attribute_hidden; - -extern int __vfscanf (FILE *__restrict __s, __const char *__restrict __format, - __gnuc_va_list __arg) - __attribute__ ((__format__ (__scanf__, 2, 0))) attribute_hidden; - -extern int __vsscanf (__const char *__restrict __s, - __const char *__restrict __format, __gnuc_va_list __arg) - __THROW __attribute__ ((__format__ (__scanf__, 2, 0))) attribute_hidden; - #ifdef __UCLIBC_HAS_WCHAR__ #include <wchar.h> - -extern int __vfwprintf (__FILE *__restrict __s, - __const wchar_t *__restrict __format, - __gnuc_va_list __arg) attribute_hidden; - -extern int __vfwscanf (__FILE *__restrict __s, - __const wchar_t *__restrict __format, - __gnuc_va_list __arg) attribute_hidden; - -extern int __vswscanf (__const wchar_t *__restrict __s, - __const wchar_t *__restrict __format, - __gnuc_va_list __arg) __THROW attribute_hidden; #endif #ifdef __UCLIBC_HAS_THREADS__ @@ -287,8 +259,6 @@ extern int __stdio_trans2w(FILE *__restrict stream) attribute_hidden; extern int __stdio_trans2r_o(FILE *__restrict stream, int oflag) attribute_hidden; extern int __stdio_trans2w_o(FILE *__restrict stream, int oflag) attribute_hidden; -extern int __setvbuf (FILE *__restrict __stream, char *__restrict __buf, - int __modes, size_t __n) __THROW attribute_hidden; /**********************************************************************/ #ifdef __STDIO_BUFFERS @@ -376,46 +346,11 @@ extern int __setvbuf (FILE *__restrict __stream, char *__restrict __buf, #endif /* __STDIO_BUFFERS */ /**********************************************************************/ -extern int __fputs_unlocked(const char *__restrict s, FILE *__restrict stream) attribute_hidden; - -extern int __putchar_unlocked(int c); - - -extern size_t __fwrite_unlocked(const void *__restrict ptr, size_t size, - size_t nmemb, FILE *__restrict stream) attribute_hidden; - -extern size_t __fread_unlocked(void *__restrict ptr, size_t size, - size_t nmemb, FILE *__restrict stream) attribute_hidden; - -extern int __fputc_unlocked_internal(int c, FILE *stream) attribute_hidden; - -extern int __fflush_unlocked(FILE *stream) attribute_hidden; - extern int __stdio_adjust_position(FILE *__restrict stream, __offmax_t *pos) attribute_hidden; -extern void __clearerr_unlocked(FILE *stream); -extern int __feof_unlocked(FILE *stream); -extern int __ferror_unlocked(FILE *stream); - -extern int __fgetc_unlocked_internal(FILE *stream) attribute_hidden; -extern int __getc_unlocked(FILE *stream) attribute_hidden; -extern char *__fgets_unlocked(char *__restrict s, int n, - FILE * __restrict stream) attribute_hidden; - -extern int __fileno_unlocked(FILE *stream) attribute_hidden; - -extern int __getchar_unlocked(void) attribute_hidden; - -extern int __fseek(FILE *stream, long int offset, int whence) attribute_hidden; -extern long int __ftell(FILE *stream) attribute_hidden; -#ifdef __UCLIBC_HAS_LFS__ -extern int __fseeko64(FILE *stream, __off64_t offset, int whence) attribute_hidden; -extern __off64_t __ftello64(FILE *stream) attribute_hidden; -#endif - #ifdef __STDIO_HAS_OPENLIST /* Uses an implementation hack!!! */ -#define __STDIO_FLUSH_LBF_STREAMS __fflush_unlocked((FILE *) &_stdio_openlist) +#define __STDIO_FLUSH_LBF_STREAMS fflush_unlocked((FILE *) &_stdio_openlist) #else #define __STDIO_FLUSH_LBF_STREAMS ((void)0) #endif @@ -453,9 +388,6 @@ extern FILE *_stdio_fopen(intptr_t fname_or_mode, #ifdef __UCLIBC_HAS_WCHAR__ extern size_t _wstdio_fwrite(const wchar_t *__restrict ws, size_t n, FILE *__restrict stream) attribute_hidden; - -extern wint_t __fgetwc_unlocked(register FILE *stream) attribute_hidden; -extern wint_t __fputwc_unlocked(wchar_t wc, FILE *stream) attribute_hidden; #endif /**********************************************************************/ diff --git a/libc/stdio/_trans2w.c b/libc/stdi |