Commit Graph

22 Commits

Author SHA1 Message Date
Corinna Vinschen 2e10d61ccb * libc/include/wchar.h (mbsnrtowcs): Declare.
(_mbsnrtowcs_r): Declare.
	(wcsnrtombs): Declare.
	(_wcsnrtombs_r): Declare.
	* libc/stdlib/Makefile.am (ELIX_2_SOURCES): Add mbsnrtowcs.c
	and wcsnrtombs.c.
	* libc/stdlib/Makefile.in: Regenerate.
	* libc/stdlib/mbsnrtowcs.c: New file, implementing _mbsnrtowcs_r
	and mbsnrtowcs.  Document mbsnrtowcs and mbsrtowcs.
	* libc/stdlib/mbsrtowcs.c (_mbsrtowcs_r): Just call _mbsnrtowcs_r.
	(mbsrtowcs): Ditto.
	* libc/stdlib/wcsnrtombs.c: New file, implementing _wcsnrtombs_r
	and wcsnrtombs.  Document wcsrtombs and wcsnrtombs.
	* libc/stdlib/wcsrtombs.c (_wcsrtombs_r): Just call _wcsnrtombs_r.
	(wcsrtombs): Ditto.
	* libc/stdlib/stdlib.tex: Accommodate new documentation.
2009-02-19 09:19:42 +00:00
Corinna Vinschen 84e851fd64 * libc/stdio/open_memstream.c: Add open_wmemstream to doumentation.
(struct memstream): Add wide element.
	Change saved to a union to take char and wchar_t values.
	(memwriter): Accommodate wide-oriented oeprations.
	(memseeker): Ditto.
	(memseeker64): Ditto.
	(memcloser): Ditto.
	(internal_open_memstream_r): New static function.  Take functionality
	from former _open_memstream_r and handle additional "wide" parameter.
	(_open_memstream_r): Just call internal_open_memstream_r with wide==-1
	from here.
	(_open_wmemstream_r): New function.
	(open_wmemstream): Ditto.
	* libc/include/wchar.h (open_wmemstream): Declare.
	(_open_wmemstream_r): Declare.
2009-02-18 17:35:24 +00:00
Jeff Johnston 77ea728b96 2009-02-12 Corinna Vinschen <corinna@vinschen.de>
* libc/include/wchar.h (_wcstod_r): Declare.
        (_wcstof_r): Declare.
        (wcstod): Declare.
        (wcstof): Declare.
        * libc/stdlib/Makefile.am (GENERAL_SOURCES): Add wcstod.c.
        (CHEWOUT_FILES): Add wcstod.def.
        * libc/stdlib/Makefile.in: Regenerate.
        * libc/stdlib/stdlib.tex: Add wcstod.
        * libc/stdlib/wcstod.c: New file.
2009-02-12 23:10:01 +00:00
Jeff Johnston a1631dba6c 2008-12-12 Craig Howland <howland@LGSInnovations.com>
* libc/include/wchar.h:  Added wcstok() declaration.
        * libc/string/wcstok.c: New file, implementing wcstok.
        * libc/string/Makefile.am: Add wcstok support.
        * libc/string/wcstrings.tex: Ditto.
        * libc/string/Makefile.in: Regenerated.
2008-12-12 19:47:05 +00:00
Jeff Johnston 0751f22675 2008-12-10 Corinna Vinschen <corinna@vinschen.de>
Implement basic wide char stdio functionality, based on FreeBSD.
        * libc/include/stdio.h (__SORD): Define.
        (__SWID): Define.
        * libc/include/wchar.h: Add declarations for new wide char functions.
        (getwc): Define as macro.
        (getwchar): Ditto.
        (putwc): Ditto.
        (putwchar): Ditto.
        * libc/include/sys/reent.h (struct __sFILE): Add _mbstate member.
        (struct __sFILE64): Ditto.
        * libc/stdio/Makefile.am (ELIX_4_SOURCES): Add fgetwc.c, fgetws.c,
        fputwc.c, fputws.c, fwide.c, getwc.c, getwchar.c, putwc.c, putwchar.c
        and ungetwc.c.
        (CHEWOUT_FILES): Add fgetwc.def, fgetws.def, fputwc.def, fputws.def,
        fwide.def, getwc.def, getwchar.def, putwc.def, putwchar.def and
        ungetwc.def.
        Add header dependency rules for the new files.
        * libc/stdio/Makefile.in: Regenerate.
        * libc/stdio/fgetwc.c: New file, implementing fgetwc and _fgetwc_r.
        * libc/stdio/fgetws.c: New file, implementing fgetws and _fgetws_r.
        * libc/stdio/findfp.c (std): Initialize FILE's _mbstate member.
        (__sfmoreglue): Ditto.
        * libc/stdio/fputs.c (_fputs_r): Set stream orientation.
        * libc/stdio/fputwc.c: New file, implementing fputwc and _fputwc_r.
        * libc/stdio/fputws.c: New file, implementing fputws and _fputws_r.
        * libc/stdio/fread.c (_fread_r): Set stream orientation.
        * libc/stdio/freopen.c (_freopen_r): Reset stream orientation.  Reset
        _mbstate.
        * libc/stdio/fseek.c (_fseek_r): Reset _mbstate.
        * libc/stdio/fwide.c: New file, implementing fwide and _fwide_r.
        * libc/stdio/fwrite.c (_fwrite_r): Set stream orientation.
        * libc/stdio/getwc.c: New file, implementing getwc and _getwc_r.
        * libc/stdio/getwchar.c: New file, implementing getwchar and
        _getwchar_r.
        * libc/stdio/local.h (ORIENT): New macro.
        * libc/stdio/puts.c (_puts_r): Set stream orientation.
        * libc/stdio/putwc.c: New file, implementing putwc and _putwc_r.
        * libc/stdio/putwchar.c: New file, implementing putwchar and
        _putwchar_r.
        * libc/stdio/refill.c (__srefill_r): Set stream orientation.
        * libc/stdio/stdio.tex: Add documentation for new functions.
        * libc/stdio/ungetc.c (_ungetc_r): Set stream orientation.
        * libc/stdio/ungetwc.c: New file, implementing ungetwc and _ungetwc_r.
        * libc/stdio/vfscanf.c (__SVFSCANF_R): Set stream orientation.
        * libc/stdio/wbuf.c (__swbuf_r): Ditto.
2008-12-10 23:43:12 +00:00
Jeff Johnston bad5c314f7 2008-11-27 Craig Howland <howland@LGSInnovations.com>
* libc/argz/argz_add.c:  Added #include <argz.h> to get function
        prototypes.
        * libc/argz/argz_append.c: Ditto.
        * libc/argz/argz_count.c: Ditto.
        * libc/argz/argz_create.c: Ditto.
        * libc/argz/argz_create_sep.c: Ditto.
        * libc/argz/argz_delete.c: Ditto.
        * libc/argz/argz_next.c: Ditto.
        * libc/argz/argz_stringify.c: Ditto
        * libc/stdlib/strtod.c: Added #include <stdlib.h> to get function
        prototypes.
        * libc/stdlib/wcstoul.c: Added #include <wchar.h> to get function
        prototypes, corrected traditional usage comment.
        * libc/include/wchar.h: Added _mbsrtowcs_r() prototype.
2008-11-27 20:45:37 +00:00
Corinna Vinschen ac26b72723 * libc/include/wchar.h: Add prototypes for wcpcpy and wcpncpy.
* libc/string/Makefile.am (ELIX_SOURCES): Add wcpcpy.c and
	wcpncpy.c.
	(CHEWOUT_FILES): Add wcpcpy.def and wcpncpy.def.
	* libc/string/Makefile.in: Regenerate.
	* libc/string/wcpcpy.c: New file.
	* libc/string/wcpncpy.c: New file.
	* libc/string/wcstrings.tex: Add wcpcpy and wcpncpy.
2007-12-19 17:33:12 +00:00
Corinna Vinschen dec27025b2 * libc/include/wchar.h: Declare wcstol, wcstoll, wcstoul,
wcstoull, _wcstol_r, _wcstoll_r, _wcstoul_r and _wcstoull_r.
	* libc/stdlib/Makefile.am (GENERAL_SOURCES): Add wcstol.c and wcstoul.c.
	(EXTENDED_SOURCES): Add wcstoll.c, wcstoll_r.c, wcstoull.c and
	wcstoull_r.c.
	(CHEWOUT_FILES): Add .def files accordingly.
	* libc/stdlib/Makefile.in: Regenerate.
	* libc/stdlib/stdlib.tex: Add documentation links for above functions.
	* libc/stdlib/strtoll.c: Fix portability note.
	* libc/stdlib/strtoull.c: Ditto.
	* libc/stdlib/wcstol.c: New file.
	* libc/stdlib/wcstoll.c: New file.
	* libc/stdlib/wcstoll_r.c: New file.
	* libc/stdlib/wcstoul.c: New file.
	* libc/stdlib/wcstoull.c: New file.
	* libc/stdlib/wcstoull_r.c: New file.
2007-07-06 20:03:28 +00:00
Corinna Vinschen a37215120b * libc/include/wchar.h: Add prototype for wcsxfrm.
* libc/string/Makefile.am (GENERAL_SOURCES): Add wcsxfrm.c.
	(CHEWOUT_FILES): Add wcsxfrm.def.
	* libc/string/Makefile.in: Regenerate.
	* libc/string/wcsxfrm.c: New file.
	* libc/string/wcstrings.tex: Add wcsxfrm.
2007-07-04 16:18:34 +00:00
Jeff Johnston 25c7dad1fb 2003-12-05 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/wchar.h: Include <sys/reent.h>.
2003-12-05 20:51:57 +00:00
Jeff Johnston 3aca088831 2003-12-04 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/wchar.h: Add prototypes for _mbrtowc_r,
        _wcrtomb_r, and _wcsrtombs_r.
2003-12-05 01:36:32 +00:00
Jeff Johnston 4340b63bc1 2003-10-23 Artem B. Bityuckiy <mail_lists@mail.ru>
* libc/string/wcsnlen.c: New file.
        * libc/include/wchar.h: Add wcsnlen prototype.
        * libc/string/Makefile.am: Add wcsnlen support.
        * libc/string/Makefile.in: Regenerated.
        * libc/string/wcstrings.tex: Add wcsnlen documentation.
2003-10-23 18:07:13 +00:00
Corinna Vinschen 8f8d09c041 * libc/include/wchar.h: Add definitions for wcswidth and wcwidth.
* libc/string/Makefile.am: Add wcswidth.c and wcwidth.c
	* libc/string/Makefile.in: Regenerated.
	* libc/string/wcswidth.c: New file.
	* libc/string/wcwidth.c: New file.
	* libc/string/wcstrings.tex: Add wcswidth and wcwidth.
2003-04-09 10:42:12 +00:00
Corinna Vinschen d122b1cc73 * libc/include/wchar.h: Add definition for wcscoll.
* libc/string/Makefile.am: Add wcscoll.c.
	* libc/string/Makefile.in: Regenerated.
	* libc/string/wcscoll.c: New file.
	* libc/string/wcstrings.tex: Add wcscoll.
2003-04-03 08:26:07 +00:00
Jeff Johnston 18cd62b7fb 2002-11-06 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* libc/include/wchar.h: Use _{BEGIN,END}_STD_C instead of extern "C".
        * libc/include/wctype.h: Ditto.
2002-11-07 00:44:31 +00:00
Jeff Johnston d28888120d 2002-11-04 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/wchar.h: Add extern "C" specifier if C++.
        * libc/include/wctype.h: Ditto.
2002-11-04 19:04:09 +00:00
Jeff Johnston 9211a1adec 2002-09-16 Jeff Johnston <jjohnstn@redhat.com>
* libc/include/wchar.h (mbstate_t): Change protective flag to
        be _MBSTATE_T.
        * libc/include/sys/_types.h (_mbstate_t): Remove protective flag.
        [__CYGWIN__]: Remove special code that defines mbstate_t and WEOF
        for Cygwin.
        * libc/sys/linux/sys/_types.h (_mbstate_t): Remove protective flag.
2002-09-16 18:55:25 +00:00
Jeff Johnston c210a6ea06 2002-09-05 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* libc/include/wchar.h (WCHAR_MAX): Only define if not already
        defined.
2002-09-05 15:26:42 +00:00
Jeff Johnston efa077ce22 2002-09-04 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* libc/include/sys/config.h: Define accordingly __WCHAR_MAX__.
        * libc/include/wchar.h: Define WCHAR_MIN as 0 and WCHAR_MAX as
        __WCHAR_MAX__ or 0x7fffffffu.
        * libc/string/wcscmp.c: Delete wrong and unnecessary type cast.
        * libc/string/wcsncmp.c: Ditto.
2002-09-04 18:16:55 +00:00
Jeff Johnston 890e7a1d1a 2002-08-29 Kazuhiro Fujieda <fujieda@jaist.ac.jp>
* libc/include/wchar.h: Define NULL. Define WEOF more general
        way. Declare functions in newlib manner.
        * libc/stdlib/Makefile.am: Delete wmem*.c
        * libc/stdlib/Makefile.in: Regenerated.
        * libc/stdlib/wmemchr.c: Delete.
        * libc/stdlib/wmemcmp.c: Ditto.
        * libc/stdlib/wmemcpy.c: Ditto.
        * libc/stdlib/wmemmove.c: Ditto.
        * libc/stdlib/wmemset.c: Ditto.
        * libc/string/Makefile.am: Add wmem*.c and wcs*.c.
        * libc/string/Makefile.in: Regenerated.
        * libc/string/wcscat.c: New file derived from the NetBSD C Library.
        * libc/string/wcschr.c: Ditto.
        * libc/string/wcscmp.c: Ditto.
        * libc/string/wcscpy.c: Ditto.
        * libc/string/wcscspn.c: Ditto.
        * libc/string/wcslcat.c: Ditto.
        * libc/string/wcslcpy.c: Ditto.
        * libc/string/wcslen.c: Ditto.
        * libc/string/wcsncat.c: Ditto.
        * libc/string/wcsncmp.c: Ditto.
        * libc/string/wcsncpy.c: Ditto.
        * libc/string/wcspbrk.c: Ditto.
        * libc/string/wcsrchr.c: Ditto.
        * libc/string/wcsspn.c: Ditto.
        * libc/string/wcsstr.c: Ditto.
        * libc/string/wmemchr.c: Ditto.
        * libc/string/wmemcmp.c: Ditto.
        * libc/string/wmemcpy.c: Ditto.
        * libc/string/wmemmove.c: Ditto.
        * libc/string/wmemset.c: Ditto.
2002-08-29 19:38:25 +00:00
Jeff Johnston 7d08241b68 2002-08-27 Egor Duda <deo@logos-m.ru>
* libc/stdlib/wmemchr.c: New file.
        * libc/stdlib/wmemcmp.c: Ditto.
        * libc/stdlib/wmemcpy.c: Ditto.
        * libc/stdlib/wmemmove.c: Ditto.
        * libc/stdlib/wmemset.c: Ditto.
        * libc/stdlib/Makefile.am (GENERAL_SOURCES): Add new files.
        * configure.host: Default -DMB_CAPABLE for cygwin.
        * libc/include/wchar.h: Declare wmemchr(), wmemcmp(), wmemcpy(),
        wmemmove() and wmemset().  Add include of <_ansi.h>.
        * libc/stdlib/Makefile.in: Regenerate.
2002-08-27 21:20:10 +00:00
Thomas Fitzsimmons 8d9112f2f3 * 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.
2002-08-23 01:56:05 +00:00