History log of /freebsd-10.0-release/lib/libc/stdtime/strftime.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 259065 07-Dec-2013 gjb

- Copy stable/10 (r259064) to releng/10.0 as part of the
10.0-RELEASE cycle.
- Update __FreeBSD_version [1]
- Set branch name to -RC1

[1] 10.0-CURRENT __FreeBSD_version value ended at '55', so
start releng/10.0 at '100' so the branch is started with
a value ending in zero.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 256281 10-Oct-2013 gjb

Copy head (r256279) to stable/10 as part of the 10.0-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation


# 237211 17-Jun-2012 jilles

libc: Reduce relative relocations in strftime().


# 227753 20-Nov-2011 theraven

Implement xlocale APIs from Darwin, mainly for use by libc++. This adds a
load of _l suffixed versions of various standard library functions that use
the global locale, making them take an explicit locale parameter. Also
adds support for per-thread locales. This work was funded by the FreeBSD
Foundation.

Please test any code you have that uses the C standard locale functions!

Reviewed by: das (gdtoa changes)
Approved by: dim (mentor)


# 193817 09-Jun-2009 delphij

Spacing fixes. No actual change.


# 192625 23-May-2009 edwin

MFV of tzcode2009e:

Upgrade of the tzcode from 2004a to 2009e.

Changes are numerous, but include...

- New format of the output of zic, which supports both 32 and 64
bit time_t formats.

- zdump on 64 bit platforms will actually produce some output instead
of doing nothing for a looooooooong time.

- linux_base-fX, with X >= at least 8, will work without problems related
to the local time again.

The original patch, based on the 2008e, has been running for a long
time on both my laptop and desktop machine and have been tested by
other people.

After the installation of this code and the running of zic(8), you
need to run tzsetup(8) again to install the new datafile.

Approved by: wollman@ for usr.sbin/zic
MFC after: 1 month


# 184458 29-Oct-2008 delphij

Pass a pointer to warn2 so the warn2 == IN_ALL would not be an
always-false condition.


# 137190 04-Nov-2004 delphij

Add glibc-style strftime(3) padding specifiers, namely, -(no padding),
_(use space as padding), and 0(zero padding).

These GNU extensions are widely used ones that is worthy for us to
have.

Discussed with: stefanf, roam, -current
Approved by: murray
Prodded by: ports/72722, ports/72723
MFC After: 1 month


# 130461 14-Jun-2004 stefanf

Merge changes from the tzcode2004a import. Wherever possible I tried to bring
us closer to the vendor branch.

Requested by: wollman


# 130414 13-Jun-2004 stefanf

Remove a stale reference to %Ef and %EF from a comment.


# 103012 06-Sep-2002 tjr

Style: One space between "restrict" qualifier and "*".


# 101888 14-Aug-2002 robert

- Add the 'restrict' qualifier to the function definition of
strftime(3) for IEEE Std 1003.1-2001 compliance and remove
excessive usage of the 'const' qualifier that was neither
present in the prototype in the publice header, nor in the
local prototype just above the function definition.
- Replace the K&R function definition with a ANSI-C one.
- Update the prototype of strftime(3) in its manual page.


# 97423 28-May-2002 alfred

Remove use of __P() (actually P()) from code now that it's no longer
available.


# 92986 22-Mar-2002 obrien

Fix the style of the SCM ID's.
I believe have made all of libc .c's as consistent as possible.


# 74578 21-Mar-2001 ache

Get rid of non-standard %E[Ff] formats, userland apps already fixed


# 74412 18-Mar-2001 ache

Relax local FreeBSD restrictions on 3 chars abbrev. name length and %c format
since they not allows POSIXly legal locale data. Currently, if relaxed form
POSIXly legal locale data will be used right now, some programs will be broken,
but it means that either locale data or programs must be fixed, not the library.

Introduce non-standard md_order (month/day order) locale field to be used later
via nl_langinfo(). Currently %EF and %Ef emulated using this field, but they
planned for remove in future in favour of nl_langinfo() test field.

Implement %F per POSIX


# 73359 02-Mar-2001 ache

Implement ampm_fmt (%r) per POSIX


# 72619 18-Feb-2001 kris

Back out snprintf -> sprintf change until I have time to look at it.


# 72183 08-Feb-2001 ache

Hardcode c_fmt in a different way since used in nl_langinfo now


# 72168 08-Feb-2001 phantom

Catch up to latest chanage in timelocal structures exporting.


# 71579 24-Jan-2001 deischen

Remove _THREAD_SAFE and make libc thread-safe by default by
adding (weak definitions to) stubs for some of the pthread
functions. If the threads library is linked in, the real
pthread functions will pulled in.

Use the following convention for system calls wrapped by the
threads library:
__sys_foo - actual system call
_foo - weak definition to __sys_foo
foo - weak definition to __sys_foo

Change all libc uses of system calls wrapped by the threads
library from foo to _foo. In order to define the prototypes
for _foo(), we introduce namespace.h and un-namespace.h
(suggested by bde). All files that need to reference these
system calls, should include namespace.h before any standard
includes, then include un-namespace.h after the standard
includes and before any local includes. <db.h> is an exception
and shouldn't be included in between namespace.h and
un-namespace.h namespace.h will define foo to _foo, and
un-namespace.h will undefine foo.

Try to eliminate some of the recursive calls to MT-safe
functions in libc/stdio in preparation for adding a mutex
to FILE. We have recursive mutexes, but would like to avoid
using them if possible.

Remove uneeded includes of <errno.h> from a few files.

Add $FreeBSD$ to a few files in order to pass commitprep.

Approved by: -arch


# 69196 26-Nov-2000 kris

sprintf -> snprintf


# 67623 26-Oct-2000 ache

Force %c to be "%a %Ef %T %Y" to eliminate problems with bad c_fmt

Submitted by: ru


# 56756 28-Jan-2000 joerg

There were so far only 42 different conversion specifications in
strftime(3), add another one. :) %z yields the local timezone's offset
in hours and minutes, as used in RFC822 headers. There's a precedence
for this in Lunux' libc, and Internet software (like Perl scripts)
start using it.

OKed by (wrt. the code freeze): jkh


# 53960 30-Nov-1999 ache

%Ex -> %Ef to not conflict with POSIX
Add %EF (long months name / day order)
Check that O and E not intermixed
Add missing POSIX extension to example


# 53940 30-Nov-1999 ache

Add %Ex extension to determine "%e %b" or "%b %e" order
Separate alternative for O and E cases


# 51186 11-Sep-1999 dt

Implement new format specifier for strftime: %OB, alternative national
representation of the full month name. In the Russian locale, this alternative
will be "nominative case", useful when the date designate month as a whole.
E.g. month heading in a calendar. I hope it can be useful for some other
locales too.

Discussed with: wollman, ache


# 50476 27-Aug-1999 peter

$Id$ -> $FreeBSD$


# 37299 30-Jun-1998 bde

Fixed printf format errors. Don't assume so many things about time_t.

Obtained from: partial merge of ADO version tzcode96h (was fully merged
in 1.10 but backed out in 1.11; the FreeBSD code for %s
was earlier, prettier but buggier).


# 30089 03-Oct-1997 helbig

Merged in better support of ISO 8601 from elsie.nci.nih.gov.
Added the conversion specifiers %g and %G, that are replaced
by the year which contains the greater part of the week in question.


# 28021 09-Aug-1997 joerg

Import strptime(3) into libc. We've got permission by Kevin Ruddy to
modify the original `no modifications' copyright message, and i've
included his mail into the source file.

The common localization functions between strptime(3) and strftime(3)
have been broken out into timelocal.[ch].


# 22993 22-Feb-1997 peter

Revert $FreeBSD$ to $Id$


# 22402 07-Feb-1997 ache

Include "setlocale.h" for _PathLocale like other parts already did

Should go in 2.2


# 22305 05-Feb-1997 ache

Update the comment why range checking is not needed

Should go in 2.2


# 21673 14-Jan-1997 jkh

Make the long-awaited change from $Id$ to $FreeBSD$

This will make a number of things easier in the future, as well as (finally!)
avoiding the Id-smashing problem which has plagued developers for so long.

Boy, I'm glad we're not using sup anymore. This update would have been
insane otherwise.


# 20961 28-Dec-1996 ache

Add comment that range checking is already done at upper level
Kill snprintf left in collate.c from previous backout

Should go in 2.2


# 19965 26-Nov-1996 ache

Move PATH_LOCALE handling to setlocale.c, simplify locale path building,
don't treat empty encoding as C encoding


# 17224 19-Jul-1996 wollman

Revert to old version of strftime.c; the new one doesn't work right.


# 17209 18-Jul-1996 wollman

Merge the recently-imported tzcode96h distribution (libc portion). The
part that does zic(8)/zdump(8) is still yet to be imported (but the old
zic and zdump will work just fine with these header files and the
data format has not changed).


# 17141 12-Jul-1996 jkh

General -Wall warning cleanup, part I.
Submitted-By: Kent Vander Velden <graphix@iastate.edu>


# 15927 27-May-1996 scrappy

Removed false copyrights...


# 15923 27-May-1996 scrappy

Added in appropriate Berkeley copyright and RCS Id: string

Closes PR#doc/536


# 11735 23-Oct-1995 ache

Don't reset LC_TIME to C when it isn't neccessary


# 9988 07-Aug-1995 ache

Restore %s format support from previous version


# 9964 06-Aug-1995 ache

Fix default %c to be ctime-compatible as supposed (by Solaris too)


# 9912 04-Aug-1995 wollman

Implement locale-sensitive strftime () from ADO (heavily modified
by me). This probably loses for multibyte characters, but I have no
way of telling. I'll let ache decide whether to add this support to
startup_setlocale. Note that for this to make any sense at all, the
symlinks in /usr/share/locale must go. (For the moment, this doesn't
make any difference since there are no locales supplied.)

Obtained from: Arthur David Olson <ado@elsie.nci.nih.gov>


# 6815 01-Mar-1995 joerg

On snap 950210, format %s (print seconds from the epoch) is missing
from the code in strftime.c . This affects both the library code
and all the commands using it (e.g. date +%s).

Note that %s is not required by ANSI, but we've already got it in 1.1.5.1.

Suggested by: luigi@labinfo.iet.unipi.it (Luigi Rizzo)


# 2709 13-Sep-1994 wollman

This commit was generated by cvs2svn to compensate for changes in r2708,
which included commits to RCS files with non-trunk default branches.


# 2708 13-Sep-1994 wollman

The rest of tzcode94g from Arthur David Olson.

Obtained From: Arthur David Olson, ftp://elsie.nci.nih.gov/pub/tzcode94g.tar.gz