annotate lib/time_r.c @ 112360:3215a5cff4dd

Declare some DEFVARs globally, not locally * gtkutil.h (x_gtk_use_old_file_dialog, x_gtk_show_hidden_files) (x_gtk_file_dialog_help_text, x_gtk_whole_detached_tool_bar): Declare. * gtkutil.c (xg_uses_old_file_dialog): (xg_get_file_with_chooser): (xg_tool_bar_detach_callback): Don't redeclare globals.
author Tom Tromey <tromey@redhat.com>
date Tue, 18 Jan 2011 10:28:28 -0700
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 }