annotate lib/time_r.c @ 112356:fa69cea85c66

Small updates for manual Ack section. * doc/emacs/ack.texi, doc/emacs/emacs.texi (Acknowledgments): Update for ERT addition. * doc/emacs/ack.texi (Acknowledgments): Remove mention of replaced prolog.el.
author Glenn Morris <rgm@gnu.org>
date Tue, 18 Jan 2011 00:22:22 -0800
parents 474d5026a5a2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
112308
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
1 /* Reentrant time functions like localtime_r.
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
2
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
3 Copyright (C) 2003, 2006-2007, 2010-2011 Free Software Foundation, Inc.
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
4
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
5 This program is free software; you can redistribute it and/or modify
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
6 it under the terms of the GNU General Public License as published by
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
7 the Free Software Foundation; either version 3, or (at your option)
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
8 any later version.
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
9
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
10 This program is distributed in the hope that it will be useful,
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
13 GNU General Public License for more details.
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
14
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
15 You should have received a copy of the GNU General Public License along
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
16 with this program; if not, write to the Free Software Foundation,
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
17 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
18
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
19 /* Written by Paul Eggert. */
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
20
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
21 #include <config.h>
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
22
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
23 #include <time.h>
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
24
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
25 static struct tm *
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
26 copy_tm_result (struct tm *dest, struct tm const *src)
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
27 {
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
28 if (! src)
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
29 return 0;
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
30 *dest = *src;
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
31 return dest;
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
32 }
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
33
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
34
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
35 struct tm *
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
36 gmtime_r (time_t const * restrict t, struct tm * restrict tp)
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
37 {
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
38 return copy_tm_result (tp, gmtime (t));
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
39 }
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
40
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
41 struct tm *
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
42 localtime_r (time_t const * restrict t, struct tm * restrict tp)
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
43 {
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
44 return copy_tm_result (tp, localtime (t));
474d5026a5a2 Regenerate.
Paul Eggert <eggert@cs.ucla.edu>
parents:
diff changeset
45 }