summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include/sys/reent.h
diff options
context:
space:
mode:
authorThomas Fitzsimmons <fitzsim@redhat.com>2002-08-23 01:56:05 +0000
committerThomas Fitzsimmons <fitzsim@redhat.com>2002-08-23 01:56:05 +0000
commit8d9112f2f3ac7c0aa656ceb8da7b4248df228833 (patch)
tree237c3983e83fb5bd0ccbfff91a30844b7906afd3 /newlib/libc/include/sys/reent.h
parent1c5dcf3b0a42efcc8a7fcac148e2714d9766b871 (diff)
downloadcygnal-8d9112f2f3ac7c0aa656ceb8da7b4248df228833.tar.gz
cygnal-8d9112f2f3ac7c0aa656ceb8da7b4248df228833.tar.bz2
cygnal-8d9112f2f3ac7c0aa656ceb8da7b4248df228833.zip
* libc/include/langinfo.h: New file.
* libc/include/wchar.h: Likewise. * libc/include/sys/syslimits.h: Likewise. * libc/locale/fix_grouping.c: Likewise. * libc/locale/ldpart.c: Likewise. * libc/locale/ldpart.h: Likewise. * libc/locale/lmessages.c: Likewise. * libc/locale/lmessages.h: Likewise. * libc/locale/lmonetary.c: Likewise. * libc/locale/lmonetary.h: Likewise. * libc/locale/lnumeric.c: Likewise. * libc/locale/lnumeric.h: Likewise. * libc/locale/nl_langinfo.3: Likewise. * libc/locale/nl_langinfo.c: Likewise. * libc/locale/timelocal.c: Likewise. * libc/locale/timelocal.h: Likewise. * libc/stdlib/btowc.c: Likewise. * libc/stdlib/mbrlen.c: Likewise. * libc/stdlib/mbrtowc.c: Likewise. * libc/stdlib/mbsinit.c: Likewise. * libc/stdlib/mbsrtowcs.c: Likewise. * libc/stdlib/wcrtomb.c: Likewise. * libc/stdlib/wcsrtombs.c: Likewise. * libc/stdlib/wctob.c: Likewise. * libc/sys/linux/prof-freq.c: Likewise. * libc/sys/linux/profile.c: Likewise. * libc/sys/linux/machine/i386/dl-procinfo.c: Likewise. * libc/sys/linux/machine/i386/dl-procinfo.h: Likewise. * libc/include/stdlib.h: Change re-entrant functions to take mbstate_t pointers. * libc/include/sys/_types.h: Define _mbstate_t. * libc/include/sys/config.h (MB_LEN_MAX): New macro. * libc/include/sys/errno.h (EILSEQ): New error code. * libc/include/sys/reent.h: Include wchar.h. Change reentrant structure to use mbstate_t. * libc/locale/Makefile.am (LIB_SOURCES): Add new files. * libc/machine/powerpc/vfprintf.c: Use mbstate_t. * libc/machine/powerpc/vfscanf.c: Likewise. * libc/stdio/getdelim.c: Reallocate buffer only when necessary. * libc/stdio/vfprintf.c: Likewise. * libc/stdio/vfscanf.c: Likewise. * libc/stdlib/Makefile.am (LIB_SOURCES): Add new files. * libc/stdlib/mblen.c: Use mbstate_t. * libc/stdlib/mblen_r.c: Likewise. * libc/stdlib/mbstowcs.c: Likewise. * libc/stdlib/mbstowcs_r.c: Likewise. * libc/stdlib/mbtowc.c: Likewise. * libc/stdlib/mbtowc_r.c: Likewise. * libc/stdlib/wcstombs.c: Likewise. * libc/stdlib/wcstombs_r.c: Likewise. * libc/stdlib/wctomb_r.c: Likewise. * libc/sys/linux/Makefile.am (LIB_SOURCES): Add prof-freq.c and profile.c. * libc/sys/linux/machine/i386/Makefile.am (LIB_SOURCES): Add dl-procinfo.c. * libc/sys/linux/sys/errno.h (EILSEQ): New error code. * libc/sys/linux/sys/types.h (off_t): Define type. * testsuite/newlib.locale/UTF-8.c: Change locale name from UTF-8 to C-UTF-8. * testsuite/newlib.locale/UTF-8.exp: Likewise.
Diffstat (limited to 'newlib/libc/include/sys/reent.h')
-rw-r--r--newlib/libc/include/sys/reent.h32
1 files changed, 19 insertions, 13 deletions
diff --git a/newlib/libc/include/sys/reent.h b/newlib/libc/include/sys/reent.h
index 4b570cee7..ebdf32a8e 100644
--- a/newlib/libc/include/sys/reent.h
+++ b/newlib/libc/include/sys/reent.h
@@ -307,9 +307,9 @@ struct _misc_reent
{
/* miscellaneous reentrant data */
char *_strtok_last;
- int _mblen_state;
- int _wctomb_state;
- int _mbtowc_state;
+ _mbstate_t _mblen_state;
+ _mbstate_t _wctomb_state;
+ _mbstate_t _mbtowc_state;
char _l64a_buf[8];
int _getdate_err;
};
@@ -463,9 +463,12 @@ struct _reent
#define _REENT_INIT_MISC(var) do { \
struct _reent *_r = (var); \
_r->_misc->_strtok_last = _NULL; \
- _r->_misc->_mblen_state = 0; \
- _r->_misc->_wctomb_state = 0; \
- _r->_misc->_mbtowc_state = 0; \
+ _r->_misc->_mblen_state.__count = 0; \
+ _r->_misc->_mblen_state.__value.__wch = 0; \
+ _r->_misc->_wctomb_state.__count = 0; \
+ _r->_misc->_wctomb_state.__value.__wch = 0; \
+ _r->_misc->_mbtowc_state.__count = 0; \
+ _r->_misc->_mbtowc_state.__value.__wch = 0; \
_r->_misc->_l64a_buf[0] = '\0'; \
_r->_misc->_getdate_err = 0; \
} while (0)
@@ -537,9 +540,9 @@ struct _reent
int _gamma_signgam;
__extension__ unsigned long long _rand_next;
struct _rand48 _r48;
- int _mblen_state;
- int _mbtowc_state;
- int _wctomb_state;
+ _mbstate_t _mblen_state;
+ _mbstate_t _mbtowc_state;
+ _mbstate_t _wctomb_state;
char _l64a_buf[8];
char _signal_buf[_REENT_SIGNAL_SIZE];
int _getdate_err;
@@ -575,7 +578,7 @@ struct _reent
{ 0,0,0,0,0,0,0,0}, 0, 1, \
{{_RAND48_SEED_0, _RAND48_SEED_1, _RAND48_SEED_2}, \
{_RAND48_MULT_0, _RAND48_MULT_1, _RAND48_MULT_2}, _RAND48_ADD}, \
- 0, 0, 0, "", "", 0} } }
+ {0, {0}}, {0, {0}}, {0, {0}}, "", "", 0} } }
#define _REENT_INIT_PTR(var) \
{ int i; \
@@ -612,9 +615,12 @@ struct _reent
var->_new._reent._r48._mult[1] = _RAND48_MULT_1; \
var->_new._reent._r48._mult[2] = _RAND48_MULT_2; \
var->_new._reent._r48._add = _RAND48_ADD; \
- var->_new._reent._mblen_state = 0; \
- var->_new._reent._mbtowc_state = 0; \
- var->_new._reent._wctomb_state = 0; \
+ var->_new._reent._mblen_state.__count = 0; \
+ var->_new._reent._mblen_state.__value.__wch = 0; \
+ var->_new._reent._mbtowc_state.__count = 0; \
+ var->_new._reent._mbtowc_state.__value.__wch = 0; \
+ var->_new._reent._wctomb_state.__count = 0; \
+ var->_new._reent._wctomb_state.__value.__wch = 0; \
var->_new._reent._l64a_buf[0] = '\0'; \
var->_new._reent._signal_buf[0] = '\0'; \
var->_new._reent._getdate_err = 0; \