aboutsummaryrefslogtreecommitdiff
path: root/newlib/libc/time/strptime.c
AgeCommit message (Collapse)AuthorFilesLines
2022-10-24strptime.c(strptime_l): add %q GNU quarterBrian Inglis1-1/+9
2018-01-17ansification: remove _CONSTYaakov Selkowitz1-1/+1
Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
2017-08-25newlib/libc/time/strptime.c(strptime_l) add %F %s support for strptimeBrian Inglis1-2/+32
2016-08-23Implement GNU extension strptime_lCorinna Vinschen1-39/+41
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15Consolidate wctomb/mbtowc calls for POSIX-1.2008Corinna Vinschen1-1/+1
- Remove charset parameter from low level __foo_wctomb/__foo_mbtowc calls. - Instead, create array of function for ISO and Windows codepages to point to function which does not require to evaluate the charset string on each call. Create matching helper functions. I.e., __iso_wctomb, __iso_mbtowc, __cp_wctomb and __cp_mbtowc are functions returning the right function pointer now. - Create __WCTOMB/__MBTOWC macros utilizing per-reent locale and replace calls to __wctomb/__mbtowc with calls to __WCTOMB/__MBTOWC. - Drop global __wctomb/__mbtowc vars. - Utilize aforementioned changes in Cygwin to get rid of charset in other, calling functions and simplify the code. - In Cygwin restrict global cygheap locale info to the job performed by internal_setlocale. Use UTF-8 instead of ASCII on the fly in internal conversion functions. - In Cygwin dll_entry, make sure to initialize a TLS area with a NULL _REENT->_locale pointer. Add comment to explain why. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2016-08-15POSIX-1.2008 per-thread locales, groundwork part 2Corinna Vinschen1-2/+2
Move all locale category structure definitions into setlocale.h and remove other headers in locale subdir. Create inline accessor functions for current category struct pointers and use throughout. Use pointers to "C" locale category structs by default in __global_locale. Signed-off by: Corinna Vinschen <corinna@vinschen.de>
2014-09-04 * libc/time/clock.c (clock): Fix warnings about signed-unsignedCorinna Vinschen1-1/+1
comparisons. * libc/time/strftime.c (strftime): Likewise. * libc/time/strptime.c (match_string): Fix warning about discarding 'restrict' qualifier from pointer target type.
2013-11-252013-11-25 Sahil Patnayakuni <sahil.patnayakuni@gmail.com>Joel Sherrill1-3/+3
* libc/include/time.h (time): Add restrict keyword. * libc/include/wchar.h (wcsftime): Add restrict keyword. * libc/time/asctime_r.c (asctime_r): Same. * libc/time/gmtime_r.c (gmtime_r): Same. * libc/time/lcltime_r.c (lcltime_r): Same. * libc/time/strftime.c (strftime): Same. * libc/time/strptime.c (strptime): Same. * libc/sys/linux/linuxthreads/timer_create.c (timer_create): Same. * libc/sys/linux/linuxthreads/timer_settime.c (timer_settime): Same.
2012-08-08 Throughout, run newlib with -Wall -Werror option and fix bugs andCorinna Vinschen1-2/+2
compiler warnings found this way. * libc/stdio/freopen.c (_freopen_r): Fix bug setting _flags. * libc/include/stdio.h (_rename): Define when building newlib. * libc/include/sys/signal.h (_kill): Ditto. * libc/include/sys/stat.h (_mkdir): Ditto. * libc/include/sys/time.h (_gettimeofday): Ditto. * libc/include/sys/times.h (_times): Ditto. * libc/include/sys/wait.h (_wait): Ditto. * libc/locale/lmessages.c (empty): Don't define for Cygwin. * libc/locale/lmonetary.c (cnv): Ditto. * libc/locale/nl_langinfo.c (nl_langinfo): Ditto for variable s. * libc/posix/collate.c: Throughout cast to avoid compiler warning. * libc/posix/engine.c (matcher): Initialize dp to avoid compiler warning. * libc/posix/glob.c: Disable on Cygwin. Explain why. * libc/posix/regcomp.c: Fix "uninitialized" compiler warnings. (dissect): Deliberately silence gcc compiler warning. Add comment to explain why. * libc/posix/wordexp.c (wordexp): Remove num_bytes variable since result is never used. * libc/posix/popen.c (popen): Ditto for variable last. * libc/reent/mkdirr.c: Include sys/stat.h. * libc/reent/renamer.c: Include stdio.h. * libc/search/hash.c: Throughout use underscored variants of the stat function family. (init_hash): Add missing definition for the __USE_INTERNAL_STAT64 case. * libc/search/hash_bigkey.c (__big_insert): Add parenthesis to avoid compiler warning. * libc/search/hash_page.c (overflow_page): Initalize freep to NULL to avoid compiler warning. * libc/stdio/asiprintf.c (_asiprintf_r): Cast unsigned char * to char * to avoid compiler warning. (asiprintf): Ditto. * libc/stdio/asprintf.c (_asprintf_r): Ditto. (asprintf): Ditto. * libc/stdio/vasiprintf.c (_vasiprintf_r): Ditto. * libc/stdio/vasprintf.c (_vasprintf_r): Ditto. * libc/stdio/mktemp.c (_gettemp): Cast to unsigned char in call to isdigit to avoid compiler warning. * libc/stdio/vfprintf.c (_VFPRINTF_R): Initialize variables used for grouping to avoid compiler warning. Only define and set nseps and nrepeats if they are really used. * libc/stdio/vfwprintf.c (_VFWPRINTF_R): Ditto. Only define state if it is really used. * libc/stdio/vfscanf.c (u_char): Revert to be defined as unsigned char. (__SVFSCANF_R): Cast fmt in call to __mbtowc. * libc/stdlib/mbtowc_r.c (JIS_state_table): Disable when building Cygwin. (JIS_action_table): Ditto. * libc/stdlib/wctomb_r.c (__utf8_wctomb): Add parenthesis to avoid compiler warning. * libc/string/strcasestr.c: Deliberately silence gcc compiler warning. Add comment to explain why. * libc/time/strptime.c (strptime): Cast to unsigned char in calls to isspace to avoid compiler warning. * libm/math/e_atan2.c (__ieee754_atan2): Add parenthesis to avoid compiler warning. * libm/math/e_exp.c (__ieee754_exp): Initialize k to 0 to avoid compiler warning. Drop setting it to 0 later. * libm/math/ef_exp.c (__ieee754_expf): Ditto. * libm/math/e_pow.c (__ieee754_pow): Add braces to avoid compiler warning. * libm/math/ef_pow.c (__ieee754_powf): Ditto. * libm/math/er_lgamma.c (__ieee754_lgamma_r): Initialize nadj to 0 to avoid compiler warning. * libm/math/erf_lgamma.c (__ieee754_lgammaf_r): Ditto. * libm/math/e_rem_pio2.c (__ieee754_rem_pio2): Ditto for variable z. * libm/common/sf_round.c (roundf): Remove signbit variable since result is never used.
2011-08-192011-08-19 Ralf Corsépius <ralf.corsepius@rtems.org>Ralf Corsepius1-0/+1
* libc/string/bcmp.c: Include <strings.h> for "bcmp". * libc/string/bcopy.c: Include <strings.h> for "bcopy". * libc/string/strcasestr.c: Include <strings.h> for "strncasecmp". * libc/time/strptime.c: Include <strings.h> for "strncasecmp".
2011-05-12 * libc/time/strptime.c (strptime): Fill in tm_yday when all of tm_year,Corinna Vinschen1-0/+81
tm_mon and tm_mday are updated. Fill in tm_mon, tm_mday and tm_wday when both of tm_year and tm_yday are updated.
2011-05-12 * libc/time/strptime.c (first_day): Actually return the wdayCorinna Vinschen1-2/+2
of the first day of the year.
2010-01-22 * libc/locale/lmonetary.c (__monetary_load_locale): Take additionalCorinna Vinschen1-68/+17
parameters for wide char to multibyte conversion. Call __set_lc_monetary_from_win on Cygwin. * libc/locale/lmonetary.h: Make C++-safe. (__monetary_load_locale): Change declaration. * libc/locale/lnumeric.c (__numeric_load_locale): Take additional parameters for wide char to multibyte conversion. Call __set_lc_numeric_from_win on Cygwin. * libc/locale/lnumeric.h: Make C++-safe. (__numeric_load_locale): Change declaration. * libc/locale/locale.c (lconv): De-constify for Cygwin. (__set_charset_from_locale): Rename from __set_charset_from_codepage. Take locale as parameter instead of a codepage. (loadlocale): Allow "EUC-JP" for "EUCJP" and "EUC-KR" for "EUCKR". Change documnetation accordingly. Enable LC_COLLATE, LC_MONETARY, LC_NUMERIC, and LC_TIME handling on Cygwin. (_localeconv_r): On Cygwin, copy values from monetary and numeric domain if change has been noted. * libc/locale/nl_langinfo.c (nl_langinfo): Accommodate change of am/pm layout in struct lc_time_T. * libc/locale/timelocal.c (_C_time_locale): Accommodate redefinition of am/pm members. (__time_load_locale): Take additional parameters for wide char to multibyte conversion. Call __set_lc_time_from_win on Cygwin. * libc/locale/timelocal.h: Make C++-safe. (struct lc_time_T): Convert am and pm to a am_pm array for easier consumption by strftime and strptime. (__time_load_locale): Change declaration. * libc/time/strftime.c: Change documentation to reflect changes to strftime. Remove locale constant strings in favor of access to locale-specifc data. (_ctloc): Define access method for locale-specifc data. (TOLOWER): Define for tolower conversion. (strftime): Throughout, convert locale-specific formats to use locale-specific data. Add GNU-specific "%P" format. * libc/time/strptime.c: Remove locale constant strings in favor of access to locale-specifc data. (_ctloc): Define access method for locale-specifc data. (strptime): Throughout, convert locale-specific formats to use locale-specific data.
2005-11-182005-11-18 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston1-3/+8
* libc/time/strptime.c (strptime): Don't abort for %c and %Z. Treat %c as "%a %b %e %H:%M:%S %Y" and ignore %Z.
2004-07-292004-07-29 Jeff Johnston <jjohnstn@redhat.com>Jeff Johnston1-1/+1
* libc/time/strptime.c: Correct full-name of "March" typo.
2004-04-022004-04-01 Artem B. Bityuckiy <abitytsky@softminecorp.com>Jeff Johnston1-0/+3
* libc/time/strptime.c: Add standard includes to avoid warning messages at compilation time.
2002-04-092002-04-09 Mark Bradshaw <bradshaw@staff.crosswalk.com>Jeff Johnston1-0/+438
* libc/include/time.h: Fix strptime declaration. * libc/time/Makefile.am: Add strptime.c. * libc/time/Makefile.in: Regenerated. * libc/time/strptime.c: New file.