summaryrefslogtreecommitdiffstats
path: root/newlib/libc/include/stdlib.h
Commit message (Collapse)AuthorAgeFilesLines
* * libc/include/stdlib.h (__itoa): Declare prototype.Corinna Vinschen2014-12-161-0/+6
| | | | | | | | | | (__utoa): Ditto. (itoa): Ditto, non-strict-ANSI only. (utoa): Ditto. * libc/stdlib/Makefile.am: Add itoa.c and utoa.c. * libc/stdlib/Makefile.in: Regenerate. * libc/stdlib/itoa.c: New file. * libc/stdlib/utoa.c: New file.
* * libc/include/stdlib.h: Include sys/cdefs.h to avoid undefinedCorinna Vinschen2014-12-151-0/+1
| | | | __ASMNAME.
* * libc/include/stdlib.h (__bsd_qsort_r): Declare.Yaakov Selkowitz2014-12-051-0/+16
| | | | | | | | | | | | | | (qsort_r): Declare. * libc/search/Makefile.am (ELIX_2_SOURCES): Rename from ELIX_SOURCES. (ELIX_4_SOURCES): Define. Add bsd_qsort_r.c and qsort_r.c. (libsearch_la_SOURCES): Adapt accordingly. (lib_a_SOURCES): Adapt accordingly. (CHEWOUT_FILES): Add qsort_r.def. * libc/search/Makefile.in: Regenerate. * libc/search/bsd_qsort_r.c: New file. * libc/search/qsort.c: Update from FreeBSD HEAD. Adapt for both BSD and GNU qsort_r flavors. * libc/search/qsort_r.c: New file.
* * libc/include/_ansi.h: _LONG_LONG_TYPE definition removed.Corinna Vinschen2014-10-101-5/+25
| | | | | | * libc/include/math.h: _LONG_LONG_TYPE replaced by "long long". Guards for C99 and C++11 functions fixed. * libc/include/stdlib.h: Guards for C99 and C++11 functions fixed.
* headers: properly decorate attributesEric Blake2014-08-011-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Found by: find -name '*.h' |xargs grep -i 'attribute.*(([a-z]' For an example of the type of bugs this causes, try compiling this valid C11 program (it's valid because 'noreturn' is reserved for use in the user namespace unless you include <stdnoreturn.h>): $ cat foo.c #define noreturn __attribute__((noreturn)) #include <stdlib.h> $ gcc -c -o foo.o -Wall foo.c In file included from /usr/include/stdlib.h:11:0, from foo.c:2: foo.c:1:18: error: expected ')' before '__attribute__' #define noreturn __attribute__((noreturn)) ^ /usr/include/stdlib.h:66:28: error: expected ',' or ';' before ')' token _VOID _EXFUN(abort,(_VOID) _ATTRIBUTE ((noreturn))); ^ * libc/machine/spu/spu_timer_internal.h: Decorate attribute names with __, for namespace safety. * libc/machine/xscale/machine/profile.h: Likewise. * libc/include/stdlib.h: Likewise. * libc/include/_ansi.h: Likewise. * libc/include/sys/unistd.h: Likewise. * libc/sys/linux/linuxthreads/libc-symbols.h: Likewise. * libc/sys/linux/linuxthreads/internals.h: Likewise. * libc/sys/linux/machine/i386/weakalias.h: Likewise. * libc/sys/linux/machine/i386/dl-procinfo.h: Likewise. * libc/sys/linux/machine/i386/dl-machine.h: Likewise. * libc/sys/linux/libc-symbols.h: Likewise. * libc/sys/linux/iconv/gconv_charset.h: Likewise. * libc/sys/linux/include/resolv.h: Likewise. * libc/sys/linux/sys/unistd.h: Likewise. * libc/sys/linux/dl/atomicity.h: Likewise. * libc/sys/linux/dl/dynamic-link.h: Likewise. * libc/sys/linux/dl/ldsodefs.h: Likewise.
* * libc/include/stdlib.h (strtold): Define if _HAVE_LONG_DOUBLE isCorinna Vinschen2014-03-071-2/+2
| | | | | | defined. * libc/stdlib/strtold.c (strtold): Ditto. Call strtod on systems with long double == double, _strtold otherwise.
* 2013-12-22 JF Bastien <jfb@chromium.org>Jeff Johnston2013-12-231-2/+3
| | | | | | | | | | | * libc/include/limits.h: Define LLONG_MIN, LLONG_MAX and ULLONG_MAX for C++11 too. * libc/include/stdlib.h: Define struct lldiv_t, _Exit, atoll, llabs and lldiv for C99 and C++11. Move wcstold to wchar.h. * libc/include/wchar.h: Define WCHAR_MIN and WCHAR_MAX according to __WCHAR_UNSIGNED__ if it is provided, and correct the limit when unsigned (to 32 all-1 bits, not 31). Define FILE as in stdio.h. Move wcstold from stdlib.h here.
* * libc/include/stdlib.h: Declare realpath only if !__STRICT_ANSI__.Corinna Vinschen2013-11-201-1/+1
|
* 2013-11-18 Joel Sherrill <joel.sherrill@oarcorp.com>Joel Sherrill2013-11-191-0/+1
| | | | | * libc/include/stdlib.h: Add prototype of realpath(). * libc/sys/linux/realpath.c: Add restrict keyword.
* 2013-11-18 Sahil Patnayakuni <sahilp@oarcorp.com>Joel Sherrill2013-11-181-18/+18
| | | | | | | | | | | * libc/include/stdlib.h, libc/stdlib/mbstowcs.c, libc/stdlib/mbstowcs_r.c, libc/stdlib/mbtowc.c, libc/stdlib/mbtowc_r.c, libc/stdlib/strtod.c, libc/stdlib/strtol.c, libc/stdlib/strtold.c, libc/stdlib/strtoll.c, libc/stdlib/strtoll_r.c, libc/stdlib/strtoul.c, libc/stdlib/strtoull.c, libc/stdlib/strtoull_r.c, libc/stdlib/wcstombs.c, libc/stdlib/wcstombs_r.c: Add restrict keyword.
* * libc/include/search.h (__compar_fn_t): Add typedef.Yaakov Selkowitz2013-09-081-2/+7
| | | | | | (tdelete, tfind, tsearch): Use it. * libc/include/stdlib.h (__compar_fn_t): Add typedef. (bsearch, qsort): Use it.
* Revert to original patchCorinna Vinschen2013-04-111-4/+4
|
* * libc/include/stdlib.h (strtof, strtoll, strtoull, strtold): AlsoCorinna Vinschen2013-04-111-4/+4
| | | | prototype if C++11 or later.
* * libc/include/locale.h (NULL): Fetch definition via stddef.h.Corinna Vinschen2012-11-011-4/+1
| | | | | | | | | * libc/include/stdio.h (NULL): Ditto. * libc/include/stdlib.h (NULL): Ditto. * libc/include/string.h (NULL): Ditto. * libc/include/wchar.h (NULL): Ditto. * libc/include/rpc/types.h (NULL): Ditto. * libc/include/time.h (NULL): Ditto. Include stddef.h earlier.
* * libc/include/stdlib.h (strtof, strtoll, strtoull, strtold):PrototypeCorinna Vinschen2012-10-221-0/+12
| | | | if not __STRICT_ANSI__ or stdc version C99 or greater.
* Add mkostemp and mkostemps.Eric Blake2010-07-191-2/+6
| | | | | | | | | * libc/stdio/mktemp.c (_gettemp): Add parameter, all callers changed. (mkostemp, _mkostemp_r, mkostemps, _mkostemps_r): New interfaces, for ELIX level 4. * libc/include/stdlib.h (mktemp): Avoid namespace issues. (mkostemp, mkostemps): Declare.
* Extend locale support to maintain wide char values of native stringsCorinna Vinschen2010-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | if __HAVE_LOCALE_INFO_EXTENDED__ is defined. * libc/include/langinfo.h (enum __nl_item): New type. Define all native values accessible through nl_langinfo. Define previously existing POSIX-compatible values as macros as well. * libc/include/stdlib.h (__mb_cur_max): Drop declaration. (__locale_mb_cur_max): Declare. (MB_CUR_MAX): Re-define calling __locale_mb_cur_max. * libc/locale/Makefile.am (ELIX_SOURCES): Add lctype.c. * libc/locale/Makefile.in: Regenerate. * libc/locale/lctype.c: New file to define and load LC_CTYPE category. * libc/locale/lctype.h: New file, matching header. * libc/locale/lmessages.c (_C_messages_locale): Add default values for wide char members. (__messages_load_locale): Add _C_messages_locale in call to __set_lc_messages_from_win. * libc/locale/lmessages.h (struct lc_messages_T): Add wide char members. * libc/locale/lmonetary.c (_C_monetary_locale): Add default values for wide char members. (__monetary_load_locale): Add _C_monetary_locale in call to __set_lc_monetary_from_win. * libc/locale/lmonetary.h (struct lc_monetary_T): Add wide char members. Add numerical values for international currency formatting per POSIX-1.2008, if __HAVE_LOCALE_INFO_EXTENDED__ is defined. * libc/locale/lnumeric.c (_C_numeric_locale): Add default values for wide char members. (__numeric_load_locale): Add _C_numeric_locale in call to __set_lc_numeric_from_win. * libc/locale/lnumeric.h (struct lc_numeric_T): Add wide char members. * libc/locale/locale.c (loadlocale): Return doing nothing if category locale didn't change. Convert category if chain to switch statement. Call __ctype_load_locale in LC_CTYPE case. (__locale_charset): Add (but disable for now) returning codeset from __get_current_ctype_locale. (__locale_mb_cur_max): Add (but disable for now) returning mb_cur_max from __get_current_ctype_locale. (__locale_msgcharset): Add returning codeset from __get_current_messages_locale. (_localeconv_r): Accommodate int_XXX values. * libc/locale/nl_langinfo.c (nl_ext): New array to define what is to be returned for non-POSIX values. (nl_Langinfo): Return correct codeset for each locale category. Return extended values if __HAVE_LOCALE_INFO_EXTENDED__ is defined. * libc/locale/timelocal.c (_C_time_locale): Add default values for wide char members. (__time_load_locale): Add _C_time_locale in call to __set_lc_time_from_win. * libc/locale/timelocal.h (struct lc_time_T): Add wide char members. * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Use wide char decimal point and thousands_sep if __HAVE_LOCALE_INFO_EXTENDED__ is defined. * libc/time/strftime.c: Rework to accommodate availability of wide char strings in LC_TIME category if __HAVE_LOCALE_INFO_EXTENDED__ is defined.
* Fix getsubopt declaration.Eric Blake2009-12-221-0/+4
| | | | | * libc/include/sys/unistd.h (suboptarg, getsubopt): Move... * libc/include/stdlib.h: ...here, to match POSIX for getsubopt.
* 2009-12-17 Jerker Back <jerker.back@gmail.com>Jeff Johnston2009-12-171-1/+1
| | | | | | | | | | | | | | | * libc/include/_ansi.h: Add new _EXFNPTR macro for using with function pointer arguments. * libc/iconv/lib/conv.h: Use _EXFNPTR rather than _EXPARM macro. * libc/iconv/lib/ucsconv.h: Ditto. * libc/include/stdlib.h: Use new _EXFNPTR macro for function pointers. * libc/include/sys/reent.h: Ditto. * libc/include/sys/unistd.h: Ditto. * libc/search/bsearch.c: Ditto. * libc/stdio/fseek.c: Ditto. * libc/stdio64/fseeko64.c: Ditto. * libc/stdlib/atexit.c: Ditto. * libc/stdlib/on_exit.c: Ditto.
* 2009-09-22 Ralf Corsépius <ralf.corsepius@rtems.org>Jeff Johnston2009-09-221-0/+4
| | | | * libc/include/stdlib.h: Add posix_memalign.
* Add mkdtemp, mkstemps.Eric Blake2009-07-031-2/+6
| | | | | | | | | | * libc/stdio/mktemp.c: Fix documentation. (_gettemp): Add domkdir and length parameters. Check for insufficient 'X' suffix. Drop cygwin-specific code. (_mkstemp_r, _mktemp_r, mkstemp, mktemp): Adjust clients. (_mkdtemp_r, _mkstemps_r, mkdtemp, mkstemps): New functions. * libc/include/stdlib.h (_mkdtemp_r, _mkstemps_r, mkdtemp) (mkstemps): Declare them.
* 2009-04-24 Jeff johnston <jjohnstn@redhat.com>Jeff Johnston2009-04-241-3/+3
| | | | | | | | | | | | | * configure.in: Add configuration test for long double equals dbl and set flag _LDBL_EQ_DBL if true. * configure: Regenerated. * newlib.hin: Add _LDBL_EQ_DBL flag. * libc/include/math.h: Use _LDBL_EQ_DBL flag instead of _HAVE_LDBL_MATH. * libc/include/stdlib.h: Use _LDBL_EQ_DBL flag instead of _HAVE_LDBL_STDLIB. * libc/common/local.h: Remove _LDBL_EQ_DBL flag setting. * libc/stdlib/local.h: Ditto.
* 2009-04-21 Mark Mitchell <mark@codesourcery.com>Jeff Johnston2009-04-211-8/+8
| | | | | | | | | | | | | | * libc/include/_ansi.h: Move C++ defines to top of file. (_NOTHROW): New macro. (_EXFUN_NOTHROW): Likewise. * libc/include/stdlib.h (calloc): Declare with _EXFUN_NOTHROW. (free): Likewise. (malloc): Likewise. (realloc): Likewise. (_malloc_r): Likewise. (_callor_r): Likewise. (_free_r): Likewise. (_realloc_r): Likewise.
* 2009-04-20 Jeff johnston <jjohnstn@redhat.com>Jeff Johnston2009-04-201-3/+3
| | | | | | | * libc/include/math.h: Change _LDBL_EQ_DBL flag usage to be _HAVE_LDBL_MATH. * libc/include/stdlib.h: Change _LDBL_EQ_DBL flag usage to be _HAVE_LDBL_STDLIB.
* 2009-04-16 Ken Werner <ken.werner@de.ibm.com>Jeff Johnston2009-04-161-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libm/libm.texinfo: Add long double function support chapter. * libc/include/machine/ieeefp.h: Add _LDBL_EQ_DBL define. * libc/include/stdlib.h: Include <machine/ieeefp.h>. (strtold, wcstold): Declare. * libc/stdlib/strtold.c: New File. * libc/stdlib/wcstold.c: Likewise. * libc/configure.in: Add long double check. * libc/configure: Regenerate. * libc/stdlib/Makefile.am: Add strtold.c and wcstold.c. * libc/stdlib/Makefile.in: Regenerate. * libc/include/math.h (atanl, cosl, sinl, tanl, tanhl): Declare. (frexpl, modfl, ceill, fabsl, floorl, log1pl, expm1l, acosl): Ditto. (asinl, atan2l, coshl, sinhl, expl, ldexpl, logl, log10l, powl): Ditto. (sqrtl, fmodl, hypotl, copysignl, nanl, ilogbl, asinhl, cbrt): Ditto. (nextafterl, rintl, scalbnl, exp2l, scalblnl, tgammal): Ditto. (nearbyintl, lrintl, llrintl, roundl, lroundl, llround): Ditto. (llroundl, truncl, remquol, fdiml, fmaxl, fminl, fmal, acoshl): Ditto. (atanhl, remainderl, lgammal, erfl, erfcl): Ditto. * libm/common/atanl.c: New File. * libm/common/cosl.c: Likewise. * libm/common/sinl.c: Likewise. * libm/common/modfl.c: Likewise. * libm/common/frexpl.c: Likewise. * libm/common/tanhl.c: Likewise. * libm/common/tanl.c: Likewise. * libm/common/expm1l.c: Likewise. * libm/common/log1pl.c: Likewise. * libm/common/ceill.c: Likewise. * libm/common/fabsl.c: Likewise. * libm/common/floorl.c: Likewise. * libm/common/acosl.c: Likewise. * libm/common/asinl.c: Likewise. * libm/common/atan2l.c: Likewise. * libm/common/coshl.c: Likewise. * libm/common/expl.c: Likewise. * libm/common/fmodl.c: Likewise. * libm/common/hypotl.c: Likewise. * libm/common/ldexpl.c: Likewise. * libm/common/log10l.c: Likewise. * libm/common/logl.c: Likewise. * libm/common/powl.c: Likewise. * libm/common/sqrtl.c: Likewise. * libm/common/copysignl.c: Likewise. * libm/common/ilogbl.c: Likewise. * libm/common/nanl.c: Likewise. * libm/common/cbrtl.c: Likewise. * libm/common/asinhl.c: Likewise. * libm/common/nextafterl.c: Likewise. * libm/common/rintl.c: Likewise. * libm/common/scalbnl.c: Likewise. * libm/common/exp2l.c: Likewise. * libm/common/fdiml.c: Likewise. * libm/common/fmal.c: Likewise. * libm/common/fmaxl.c: Likewise. * libm/common/fminl.c: Likewise. * libm/common/lrintl.c: Likewise. * libm/common/lroundl.c: Likewise. * libm/common/nearbyintl.c: Likewise. * libm/common/remquol.c: Likewise. * libm/common/roundl.c: Likewise. * libm/common/scalblnl.c: Likewise. * libm/common/truncl.c: Likewise. * libm/common/acoshl.c: Likewise. * libm/common/atanhl.c: Likewise. * libm/common/erfcl.c: Likewise. * libm/common/erfl.c: Likewise. * libm/common/lgammal.c: Likewise. * libm/common/remainderl.c: Likewise. * libm/common/tgammal.c: Likewise. * libm/common/sinhl.c: Likewise. * libm/common/llroundl.c: Likewise. * libm/configure.in: Add long double check. * libm/configure: Regenerate. * libm/common/Makefile.am: Add new files. * libm/common/Makefile.in: Regenerate.
* * libc/include/stdlib.h (_mkstemp_r, _mktemp_r): Move out ofCorinna Vinschen2009-03-141-2/+2
| | | | !_REENT_ONLY section.
* * libc/include/stdio.h (_mkstemp_r, _mktemp_r): Move declarationsCorinna Vinschen2009-03-141-1/+3
| | | | | | | to stdlib.h. * libc/include/stdlib.h (mktemp, _mktemp_r): Warn when using. * libc/stdio/mktemp.c: Explain the security risk when using mktemp.
* 2008-11-19 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2008-11-191-0/+4
| | | | | | | | | | | | | | | * libc/sys/linux/bits/dirent.h: New header file. * libc/sys/linux/sys/dirent.h: Include <bits/dirent.h> instead of <linux/dirent.h>. * libc/posix/Makefile.am: Remove reallocf. * libc/posix/Makefile.in: Regenerated. * libc/posix/reallocf.c: Moved to... * libc/stdlib/reallocf.c: Here * libc/stdlib/malloc.c: Add reallocf documentation. * libc/include/stdlib.h: Add reallocf and _reallocf_r prototypes. * libc/stdlib/Makefile.am: Add reallocf. * libc/stdlib/Makefile.in: Regenerated. * libc/posix/_isatty.c: Set errno.
* 2008-09-24 Pawel Veselov <pawel.veselov@gmail.com>Jeff Johnston2008-09-251-2/+2
| | | | | | | | | | | | | | | Fix setenv/getenv/unsetenv to be OpenGroup compliant: * libc/include/stdlib.h (unsetenv, _unsetenv_r): Redefine with integer return types. * libc/stdlib/getenv_r.c (_findenv_r): Do no special processing with names that contain equal chars. * libc/stdlib/setenv.c: Redefine _unsetenv_r as returning int. * libc/stdlib/setenv_r.c (_setenv_r): Return -1 and set errno to EINVAL if name contains an equal sign. Do not remove any equal signs from the value. (_unsetenv_r): Modified to return int. Return -1 and set EINVAL if name contains equal sign. Return -1 if no variable(s) were found and return 0 otherwise.
* * libc/include/stdlib.h: Move cygwin declarations to cygwin-specific file.Christopher Faylor2005-12-051-42/+4
| | | | Declare unsetenv and _unsetenv_r when not cygwin.
* 2004-11-24 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2004-11-241-2/+2
| | | | | | | * libc/include/stdlib.h (putenv, _putenv_r): Change to remove const for value string parameter. * libc/stdlib/putenv.c: Ditto. * libc/stdlib/putenv_r.c: Ditto.
* 2003-11-27 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2003-11-271-0/+1
| | | | | * libc/include/stdlib.h (_atoi_r): New prototype. * libc/stdlib/atoi.c (_atoi_r): New reentrant function.
* 2003-11-27 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2003-11-271-0/+2
| | | | | | * libc/include/stdlib.h (_atoll_r, _atol_r): New prototypes. * libc/stdlib/atol.c (_atol_r): New reentrant function. * libc/stdlib/atoll.c (_atoll_r): Ditto.
* 2003-11-27 Artem B. Bityuckiy <mail_lists@mail.ru>Jeff Johnston2003-11-271-0/+11
| | | | | | | | | | | | | Jeff Johnston <jjohnstn@redhat.com> * libc/include/stdlib.h (lldiv_t): New type. (atoll, llabs, lldiv): New prototypes. * libc/stdlib/Makefile.am: Add support for atoll, llabs, and lldiv. * libc/stdlib/stdlib.tex: Ditto. * libc/stdlib/Makefile.in: Regenerated. * libc/stdlib/atoll.c: New file. * libc/stdlib/llabs.c: Ditto. * libc/stdlib/lldiv.c: Ditto.
* * libc/include/stdlib.h (getprogname): Declare for Cygwin.Corinna Vinschen2003-11-171-0/+6
| | | | (setprogname): Ditto.
* 2002-12-06 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2002-12-061-1/+5
| | | | | | | | | | | | | | * libc/include/stdlib.h (strtof): New prototype (from C99). (strtodf): Changed from prototype to macro which redefines to strtof. * libc/stdlib/atof.c: Change documentation to refer to strtof instead of strtodf. * libc/stdlib/atoff.c (atoff): Change to call strtof instead of strtodf. * libc/stdlib/strtod.c (strtodf): Renamed to strtof. (strtof): New function. * libm/test/convert.c (test_strtodf): Renamed to test_strtof which calls strtof.
* * libc/include/malloc.h: On cygwin, define malloc _r functions as wrapperChristopher Faylor2002-08-261-0/+31
| | | | | | macros to standard malloc functions. * libc/include/stdlib.h: Ditto. * configure.host: Always define MALLOC_PROVIDED on cygwin.
* * libc/include/langinfo.h: New file.Thomas Fitzsimmons2002-08-231-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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-06-27 Benjamin Kosnik <bkoz@redhat.com>Jeff Johnston2002-06-271-6/+4
| | | | | | | | | | | | | | | * libc/include/stdio.h: Untangle, add _BEGIN_STD_C and _END_STD_C. * libc/include/time.h: Same. * libc/include/string.h: Same. * libc/include/stdlib.h: Same. * libc/include/signal.h: Same. * libc/include/setjmp.h: Same. * libc/include/math.h: Same. * libc/include/locale.h: Same. * libc/include/ctype.h: Same. * libc/include/machine/setjmp.h: Same. * libc/include/_ansi.h (_BEGIN_STD_C): Add. (_END_STD_C): Add.
* 2002-06-13 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2002-06-131-0/+1
| | | | | | | * libc/include/stdlib.h: Add _Exit prototype. * libc/stdlib/Makefile.am: Add _Exit.c support. * libc/stdlib/Makefile.in: Ditto. * libc/stdlib/_Exit.c: New file.
* 2002-05-15 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2002-05-151-0/+1
| | | | | | | | | | | | | | | | | * libc/include/stdlib.h: Add on_exit prototype. * libc/include/sys/reent.h (struct _atexit): Add argument array and bits to track type of exit routine to support both on_exit and atexit. (_REENT_INIT_PTR): Add missing fields that won't be zeroed out by default and change the setting of the atexit structure. (_REENT_INIT)[!_REENT_SMALL]: Remove extraneous end brace. * libc/stdlib/on_exit.c: New file. * libc/stdlib/Makefile.am: Add support for on_exit. * libc/stdlib/Makefile.in: Regenerated. * libc/stdlib/atexit.c: Change to initialize types field. * libc/stdlib/exit.c: Change to look at types field for each exit routine and either call an atexit-style or an on_exit-style routine accordingly.
* 2002-05-06 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2002-05-061-0/+3
| | | | * libc/include/stdlib.h (a64l, l64a, _l64a_r): Added prototypes.
* 2002-04-19 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2002-04-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | * configure.host: Add support for powerpc-eabialtivec*. * libc/include/malloc.h: Add include of <machine/malloc.h>. * libc/include/stdlib.h: Add include of <machine/stdlib.h>. * libc/include/machine/malloc.h: New file. * libc/include/machine/stdlib.h: Ditto. * libc/include/machine/setjmp.h: Add support for powerpc altivec. * libc/machine/powerpc/Makefile.am: Add conditional objects and sources based on configuration. * libc/machine/powerpc/Makefile.in: Regenerated. * libc/machine/powerpc/configure: Ditto. * libc/machine/powerpc/configure.in: Add check for powerpc-eabialtivec* in which case add in additional source files. * libc/machine/powerpc/setjmp.S: Add altivec support. * libc/machine/powerpc/vec_calloc.c: New file. * libc/machine/powerpc/vec_free.c: Ditto. * libc/machine/powerpc/vec_malloc.c: Ditto. * libc/machine/powerpc/vec_mallocr.c: Ditto. * libc/machine/powerpc/vec_realloc.c: Ditto. * libc/machine/powerpc/machine/malloc.h: Ditto. * libc/machine/powerpc/machine/stdlib.h: Ditto. * libc/machine/powerpc/vfprintf.c: New file that is vfprintf.c with added altivec format specifiers. * libc/machine/powerpc/vfscanf.c: New file that is vfscanf.c with added altivec format specifiers.
* * libc/include/alloca.h: Move libc/sys/linux/include/alloca.hCorinna Vinschen2001-11-141-0/+4
| | | | | | | to here. Rearrange for general inclusion by stdlib.h. * libc/include/stdlib.h: Include <alloca.h> if __STRICT_ANSI__ isn't defined. * libc/sys/linux/include/alloca.h: Move to libc/include.
* 2001-10-01 Charles Wilson <cwilson@ece.gatech.edu>Jeff Johnston2001-10-011-7/+12
| | | | | | | | | | | | | | | | | | | * libc/include/stdlib.h: add declarations for _strtoull_r, _strtoll_r, strtoull, and strtoll. * libc/stdio/local.h: remove declarations of __strtoull_r and __strtoll_r. * libc/stdio/vfscanf.c(__svfscanf_r): call _strtoull_r instead of __strtoull_r. Ditto _strtoll_r vs. __strtoll_r. * libc/stdlib/Makefile.am: add new files to .c list and .def list * libc/stdlib/Makefile.in: regenerate * libc/stdlib/strtoll_r.c: rename __strtoll_r as _strtoll_r * libc/stdlib/strtoull_r.c: rename __strtoull_r as _strtoull_r * libc/stdlib/strtoull.c: new file * libc/stdlib/strtoll.c: new file
* 2001-04-27 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2001-04-271-0/+1
| | | | * libc/include/stdlib.h: Add prototype for _strtod_r.
* 2001-04-20 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston2001-04-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * libc/include/stdio.h[!_REENT_ONLY]: Moved various functions together into one list. [!__STRICT_ANSI__]: Moved non-ANSI I/O functions in this list. (vfscanf, vscanf, vsscanf, _vfscanf_r, _vscanf_r, _vsscanf_r): New function prototypes. (_fscanf_r, _sscanf_r): Ditto. * libc/include/stdlib.h: Added _strtod_r prototype. * libc/stdio/Makefile.am: Add new v*scanf functions. * libc/stdio/Makefile.in: Regenerate. * libc/stdio/fscanf.c: Reorganized so HAVE_STDC only affects prototype and code is shared. Added reentrant _fscanf_r which calls __svfscanf_r. * libc/stdio/scanf.c: Changed to call __svfscanf_r. * libc/stdio/sscanf.c: Changed documentation to add reentrant routines. (sscanf): Changed to call __svfscanf_r with _REENT argument. (_sscanf_r): New routine. * libc/stdio/local.h: Removed __svfscanf prototype and replaced it with __svfscanf_r prototype. * libc/stdio/vfscanf.c (vfscanf, _vfscanf_r: New routines. (__svfscanf_r): Reentrant version of __svfscanf which takes reetrancy structure as argument as calls reentrant versions of helper functions (e.g. _strtol_r, _strtoul_r). Also replaced calls to atol and atof to _strtol_r and _strtod_r respectively. * libc/stdio/vfscanf.c: Also changed __svfscanf to call __svfscanf_r. * libc/stdlib/strtod.c (strtod): Changed to call _strtod_r with _REENT argument. * libc/stdio/vscanf.c: New file. * libc/stdio/vsscanf.c: Ditto.
* 2001-02-14 Kazuhiro Fujieda <fujieda@jaist.ac.jp>Jeff Johnston2001-02-151-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | * libc/include/stdlib.h: Add declarations of rand48 functions and their reentrant versions. * libc/include/sys/reent.h: Move macros from rand48.h. Add struct _rand48 for shared parameters of rand48 functions. (struct _reent): Add a variable _r48 of struct _rand48. (_REENT_INIT): Add _r48 initialization. * libc/stdlib/Makefile.am (lib_a_SOURCES): Add rand48 functions. (CHEWOUT_FILES): Add rand48.def. * libc/stdlib/Makefile.am: Add dependencies for rand48 functions. * libc/stdlib/Makefile.in: Regenerated. * libc/stdlib/drand48.c (drand48, _drand48_r): Derived from the NetBSD C library. * libc/stdlib/erand48.c (erand48, _erand48_r): Ditto. * libc/stdlib/jrand48.c (jrand48, _jrand48_r): Ditto. * libc/stdlib/lcong48.c (lcong48, _lcong48_r): Ditto. * libc/stdlib/lrand48.c (lrand48, _lrand48_r): Ditto. * libc/stdlib/mrand48.c (mrand48, _mrand48_r): Ditto. * libc/stdlib/nrand48.c (nrand48, _nrand48_r): Ditto. * libc/stdlib/seed48.c (seed48, _seed48_r): Ditto. * libc/stdlib/srand48.c (srand48, _srand48_r): Ditto. * libc/stdlib/rand48.c (__dorand48): Ditto. * libc/stdlib/rand48.h: Ditto, and modify declarations of global parameters into macros referring them in the reentrant structure.
* * libc/include/stdlib.h: Add declarations for `mkstemp' and `mktemp'.Corinna Vinschen2000-12-061-0/+6
|
* * libc/include/stdlib.h: Avoid declaring cfree under Cygwin.Christopher Faylor2000-10-301-2/+3
| | | | * libc/include/malloc.h: Ditto. Also remove obsolete declaration.