about summary refs log tree commit diff
path: root/src/time/strftime.c
Commit message (Collapse)AuthorAgeFilesLines
* fix semantically incorrect use of LC_GLOBAL_LOCALERich Felker2013-07-281-1/+1
| | | | | | | | | | | | | LC_GLOBAL_LOCALE refers to the global locale, controlled by setlocale, not the thread-local locale in effect which these functions should be using. neither LC_GLOBAL_LOCALE nor 0 has an argument to the *_l functions has behavior defined by the standard, but 0 is a more logical choice for requesting the callee to lookup the current locale. in the future I may move the current locale lookup the the caller (the non-_l-suffixed wrapper). at this point, all of the locale logic is dummied out, so no harm was done, but it should at least avoid misleading usage.
* reorder strftime to eliminate the incorrect indention levelRich Felker2013-07-271-5/+5
| | | | | this change is in preparation for possibly adding support for the field width and padding specifiers added in POSIX 2008.
* rework langinfo code for ABI compat and for use by time codeRich Felker2013-07-241-4/+4
|
* move strftime_l into strftime.c and add __-prefixed versionRich Felker2013-07-241-1/+10
| | | | | | the latter is both for ABI purposes, and to facilitate eventually adding LC_TIME support. it's also nice to eliminate an extra source file.
* the big time handling overhaulRich Felker2013-07-171-6/+2
| | | | | | | | | | this commit has two major user-visible parts: zoneinfo-format time zones are now supported, and overflow handling is intended to be complete in the sense that all functions return a correct result if and only if the result fits in the destination type, and otherwise return an error. also, some noticable bugs in the way DST detection and normalization worked have been fixed, and performance may be better than before, but it has not been tested.
* implement week-based-year year numbers in strftimeRich Felker2013-06-281-27/+34
| | | | | | in the process, I refactored the week-number code so it can be used by the week-based-year formats to determine year adjustments at the boundary values. this also improves indention/code readability.
* fix breakage in last commit to strftime due to missing INT_MAXRich Felker2013-06-281-0/+1
| | | | | that's what I get for changing a hard-coded threshold to a proper non-magic-number without testing.
* implement week numbers and half of the week-based-year logic for strftimeRich Felker2013-06-281-3/+38
| | | | | | | | | output for plain week numbers (%U and %W) has been sanity-checked, and output for the week-based-year week numbers (%V) has been checked extensively against known-good data for the full non-negative range of 32-bit time_t. year numbers for week-based years (%g and %G) are not yet implemented.
* use restrict everywhere it's required by c99 and/or posix 2008Rich Felker2012-09-061-1/+1
| | | | | | | | to deal with the fact that the public headers may be used with pre-c99 compilers, __restrict is used in place of restrict, and defined appropriately for any supported compiler. we also avoid the form [restrict] since older versions of gcc rejected it due to a bug in the original c99 standard, and instead use the form *restrict.
* initial check-in, version 0.5.0 v0.5.0Rich Felker2011-02-121-0/+172