summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc/include')
-rw-r--r--newlib/libc/include/stdio.h4
-rw-r--r--newlib/libc/include/sys/reent.h2
-rw-r--r--newlib/libc/include/wchar.h32
3 files changed, 38 insertions, 0 deletions
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h
index b62bc851f..95bceed34 100644
--- a/newlib/libc/include/stdio.h
+++ b/newlib/libc/include/stdio.h
@@ -78,11 +78,15 @@ typedef _fpos64_t fpos64_t;
#define __SOPT 0x0400 /* do fseek() optimisation */
#define __SNPT 0x0800 /* do not do fseek() optimisation */
#define __SOFF 0x1000 /* set iff _offset is in fact correct */
+#define __SORD 0x2000 /* true => stream orientation (byte/wide) decided */
#if defined(__CYGWIN__)
# define __SCLE 0x4000 /* convert line endings CR/LF <-> NL */
#endif
#define __SL64 0x8000 /* is 64-bit offset large file */
+/* _flags2 flags */
+#define __SWID 0x2000 /* true => stream orientation wide, false => byte, only valid if __SORD in _flags is true */
+
/*
* The following three definitions are for ANSI C, which took them
* from System V, which stupidly took internal interface macros and
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index b5d5c7da5..55fb9ff2a 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -212,6 +212,7 @@ struct __sFILE {
#ifndef __SINGLE_THREAD__
_flock_t _lock; /* for thread-safety locking */
#endif
+ _mbstate_t _mbstate; /* for wide char stdio functions. */
int _flags2; /* for future use */
};
@@ -265,6 +266,7 @@ struct __sFILE64 {
#ifndef __SINGLE_THREAD__
_flock_t _lock; /* for thread-safety locking */
#endif
+ _mbstate_t _mbstate; /* for wide char stdio functions. */
};
typedef struct __sFILE64 __FILE;
#else
diff --git a/newlib/libc/include/wchar.h b/newlib/libc/include/wchar.h
index d132f730e..d5b63e95e 100644
--- a/newlib/libc/include/wchar.h
+++ b/newlib/libc/include/wchar.h
@@ -91,6 +91,38 @@ long long _EXFUN(_wcstoll_r, (struct _reent *, const wchar_t *, wchar_t **, int)
unsigned long _EXFUN(_wcstoul_r, (struct _reent *, const wchar_t *, wchar_t **, int));
unsigned long long _EXFUN(_wcstoull_r, (struct _reent *, const wchar_t *, wchar_t **, int));
+wint_t _EXFUN(fgetwc, (__FILE *));
+wchar_t *_EXFUN(fgetws, (wchar_t *, int, __FILE *));
+wint_t _EXFUN(fputwc, (wchar_t, __FILE *));
+int _EXFUN(fputws, (const wchar_t *, __FILE *));
+int _EXFUN (fwide, (__FILE *, int));
+wint_t _EXFUN (getwc, (__FILE *));
+wint_t _EXFUN (getwchar, (void));
+wint_t _EXFUN(putwc, (wchar_t, __FILE *));
+wint_t _EXFUN(putwchar, (wchar_t));
+wint_t _EXFUN (ungetwc, (wint_t wc, __FILE *));
+
+wint_t _EXFUN(_fgetwc_r, (struct _reent *, __FILE *));
+wchar_t *_EXFUN(_fgetws_r, (struct _reent *, wchar_t *, int, __FILE *));
+wint_t _EXFUN(_fputwc_r, (struct _reent *, wchar_t, __FILE *));
+int _EXFUN(_fputws_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 (_getwchar_r, (struct _reent *ptr));
+wint_t _EXFUN(_putwc_r, (struct _reent *, wchar_t, __FILE *));
+wint_t _EXFUN(_putwchar_r, (struct _reent *, wchar_t));
+wint_t _EXFUN (_ungetwc_r, (struct _reent *, wint_t wc, __FILE *));
+
+#define getwc(fp) fgetwc(fp)
+#define putwc(wc,fp) fputwc((wc), (fp))
+#ifndef _REENT_ONLY
+#define getwchar() fgetwc(_REENT->_stdin)
+#define putwchar(wc) fputwc((wc), _REENT->_stdout)
+#else
+#define getwchar() fgetwc(_impure_ptr->_stdin)
+#define putwchar(wc) fputwc((wc), _impure_ptr->_stdout)
+#endif
+
_END_STD_C
#endif /* _WCHAR_H_ */