diff options
Diffstat (limited to 'newlib/libc/include')
-rw-r--r-- | newlib/libc/include/stdio.h | 36 | ||||
-rw-r--r-- | newlib/libc/include/wchar.h | 28 |
2 files changed, 62 insertions, 2 deletions
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h index eb2d24939..e336ee6eb 100644 --- a/newlib/libc/include/stdio.h +++ b/newlib/libc/include/stdio.h @@ -371,7 +371,9 @@ int _EXFUN(_fcloseall_r, (struct _reent *)); FILE * _EXFUN(_fdopen_r, (struct _reent *, int, const char *)); int _EXFUN(_fflush_r, (struct _reent *, FILE *)); int _EXFUN(_fgetc_r, (struct _reent *, FILE *)); +int _EXFUN(_fgetc_unlocked_r, (struct _reent *, FILE *)); char * _EXFUN(_fgets_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); +char * _EXFUN(_fgets_unlocked_r, (struct _reent *, char *__restrict, int, FILE *__restrict)); #ifdef _COMPILING_NEWLIB int _EXFUN(_fgetpos_r, (struct _reent *, FILE *__restrict, _fpos_t *__restrict)); int _EXFUN(_fsetpos_r, (struct _reent *, FILE *, const _fpos_t *)); @@ -390,8 +392,11 @@ int _EXFUN(_fprintf_r, (struct _reent *, FILE *__restrict, const char *__restric _ATTRIBUTE ((__format__ (__printf__, 3, 4)))); int _EXFUN(_fpurge_r, (struct _reent *, FILE *)); int _EXFUN(_fputc_r, (struct _reent *, int, FILE *)); +int _EXFUN(_fputc_unlocked_r, (struct _reent *, int, FILE *)); int _EXFUN(_fputs_r, (struct _reent *, const char *__restrict, FILE *__restrict)); +int _EXFUN(_fputs_unlocked_r, (struct _reent *, const char *__restrict, FILE *__restrict)); size_t _EXFUN(_fread_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); +size_t _EXFUN(_fread_unlocked_r, (struct _reent *, _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); int _EXFUN(_fscanf_r, (struct _reent *, FILE *__restrict, const char *__restrict, ...) _ATTRIBUTE ((__format__ (__scanf__, 3, 4)))); int _EXFUN(_fseek_r, (struct _reent *, FILE *, long, int)); @@ -400,6 +405,7 @@ long _EXFUN(_ftell_r, (struct _reent *, FILE *)); _off_t _EXFUN(_ftello_r,(struct _reent *, FILE *)); void _EXFUN(_rewind_r, (struct _reent *, FILE *)); size_t _EXFUN(_fwrite_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); +size_t _EXFUN(_fwrite_unlocked_r, (struct _reent *, const _PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); int _EXFUN(_getc_r, (struct _reent *, FILE *)); int _EXFUN(_getc_unlocked_r, (struct _reent *, FILE *)); int _EXFUN(_getchar_r, (struct _reent *)); @@ -486,6 +492,23 @@ int _EXFUN(fpurge, (FILE *)); ssize_t _EXFUN(__getdelim, (char **, size_t *, int, FILE *)); ssize_t _EXFUN(__getline, (char **, size_t *, FILE *)); +#if __BSD_VISIBLE +void _EXFUN(clearerr_unlocked, (FILE *)); +int _EXFUN(feof_unlocked, (FILE *)); +int _EXFUN(ferror_unlocked, (FILE *)); +int _EXFUN(fileno_unlocked, (FILE *)); +int _EXFUN(fflush_unlocked, (FILE *)); +int _EXFUN(fgetc_unlocked, (FILE *)); +int _EXFUN(fputc_unlocked, (int, FILE *)); +size_t _EXFUN(fread_unlocked, (_PTR __restrict, size_t _size, size_t _n, FILE *__restrict)); +size_t _EXFUN(fwrite_unlocked, (const _PTR __restrict , size_t _size, size_t _n, FILE *)); +#endif + +#if __GNU_VISIBLE +char * _EXFUN(fgets_unlocked, (char *__restrict, int, FILE *__restrict)); +int _EXFUN(fputs_unlocked, (const char *__restrict, FILE *__restrict)); +#endif + #ifdef __LARGE64_FILES #if !defined(__CYGWIN__) || defined(_COMPILING_NEWLIB) FILE * _EXFUN(fdopen64, (int, const char *)); @@ -659,7 +682,13 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) { #define feof(p) __sfeof(p) #define ferror(p) __sferror(p) #define clearerr(p) __sclearerr(p) -#endif + +#if __BSD_VISIBLE +#define feof_unlocked(p) __sfeof(p) +#define ferror_unlocked(p) __sferror(p) +#define clearerr_unlocked(p) __sclearerr(p) +#endif /* __BSD_VISIBLE */ +#endif /* _REENT_SMALL */ #if 0 /*ndef __STRICT_ANSI__ - FIXME: must initialize stdio first, use fn */ #define fileno(p) __sfileno(p) @@ -688,6 +717,11 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) { #define getchar() getc(stdin) #define putchar(x) putc(x, stdout) +#ifndef __STRICT_ANSI__ +#define getchar_unlocked() getc_unlocked(stdin) +#define putchar_unlocked(x) putc_unlocked(x, stdout) +#endif + _END_STD_C #endif /* _STDIO_H_ */ diff --git a/newlib/libc/include/wchar.h b/newlib/libc/include/wchar.h index 4f9a60705..596cce698 100644 --- a/newlib/libc/include/wchar.h +++ b/newlib/libc/include/wchar.h @@ -16,7 +16,7 @@ /* For _mbstate_t definition. */ #include <sys/_types.h> - +#include <sys/cdefs.h> /* For __STDC_ISO_10646__ */ #include <sys/features.h> @@ -160,16 +160,35 @@ wint_t _EXFUN(putwchar, (wchar_t)); wint_t _EXFUN (ungetwc, (wint_t wc, __FILE *)); wint_t _EXFUN(_fgetwc_r, (struct _reent *, __FILE *)); +wint_t _EXFUN(_fgetwc_unlocked_r, (struct _reent *, __FILE *)); wchar_t *_EXFUN(_fgetws_r, (struct _reent *, wchar_t *, int, __FILE *)); +wchar_t *_EXFUN(_fgetws_unlocked_r, (struct _reent *, wchar_t *, int, __FILE *)); wint_t _EXFUN(_fputwc_r, (struct _reent *, wchar_t, __FILE *)); +wint_t _EXFUN(_fputwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); int _EXFUN(_fputws_r, (struct _reent *, const wchar_t *, __FILE *)); +int _EXFUN(_fputws_unlocked_r, (struct _reent *, const wchar_t *, __FILE *)); int _EXFUN (_fwide_r, (struct _reent *, __FILE *, int)); wint_t _EXFUN (_getwc_r, (struct _reent *, __FILE *)); +wint_t _EXFUN (_getwc_unlocked_r, (struct _reent *, __FILE *)); wint_t _EXFUN (_getwchar_r, (struct _reent *ptr)); +wint_t _EXFUN (_getwchar_unlocked_r, (struct _reent *ptr)); wint_t _EXFUN(_putwc_r, (struct _reent *, wchar_t, __FILE *)); +wint_t _EXFUN(_putwc_unlocked_r, (struct _reent *, wchar_t, __FILE *)); wint_t _EXFUN(_putwchar_r, (struct _reent *, wchar_t)); +wint_t _EXFUN(_putwchar_unlocked_r, (struct _reent *, wchar_t)); wint_t _EXFUN (_ungetwc_r, (struct _reent *, wint_t wc, __FILE *)); +#if __GNU_VISIBLE +wint_t _EXFUN(fgetwc_unlocked, (__FILE *)); +wchar_t *_EXFUN(fgetws_unlocked, (wchar_t *__restrict, int, __FILE *__restrict)); +wint_t _EXFUN(fputwc_unlocked, (wchar_t, __FILE *)); +int _EXFUN(fputws_unlocked, (const wchar_t *__restrict, __FILE *__restrict)); +wint_t _EXFUN(getwc_unlocked, (__FILE *)); +wint_t _EXFUN(getwchar_unlocked, (void)); +wint_t _EXFUN(putwc_unlocked, (wchar_t, __FILE *)); +wint_t _EXFUN(putwchar_unlocked, (wchar_t)); +#endif + __FILE *_EXFUN (open_wmemstream, (wchar_t **, size_t *)); __FILE *_EXFUN (_open_wmemstream_r, (struct _reent *, wchar_t **, size_t *)); @@ -220,6 +239,13 @@ int _EXFUN(_wscanf_r, (struct _reent *, const wchar_t *, ...)); #define getwchar() fgetwc(_REENT->_stdin) #define putwchar(wc) fputwc((wc), _REENT->_stdout) +#if __GNU_VISIBLE +#define getwc_unlocked(fp) fgetwc_unlocked(fp) +#define putwc_unlocked(wc,fp) fputwc_unlocked((wc), (fp)) +#define getwchar_unlocked() fgetwc_unlocked(_REENT->_stdin) +#define putwchar_unlocked(wc) fputwc_unlocked((wc), _REENT->_stdout) +#endif + _END_STD_C #endif /* _WCHAR_H_ */ |