1/* -*- buffer-read-only: t -*- vi: set ro: */ 2/* DO NOT EDIT! GENERATED AUTOMATICALLY! */ 3#line 1 4/* Reentrant time functions like localtime_r. 5 6 Copyright (C) 2003, 2006, 2007, 2009, 2010 Free Software Foundation, Inc. 7 8 This program is free software; you can redistribute it and/or modify 9 it under the terms of the GNU General Public License as published by 10 the Free Software Foundation; either version 3, or (at your option) 11 any later version. 12 13 This program is distributed in the hope that it will be useful, 14 but WITHOUT ANY WARRANTY; without even the implied warranty of 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 GNU General Public License for more details. 17 18 You should have received a copy of the GNU General Public License along 19 with this program; if not, write to the Free Software Foundation, 20 Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ 21 22/* Written by Paul Eggert. */ 23 24#include <config.h> 25 26#include <time.h> 27 28#include <string.h> 29 30static struct tm * 31copy_tm_result (struct tm *dest, struct tm const *src) 32{ 33 if (! src) 34 return 0; 35 *dest = *src; 36 return dest; 37} 38 39 40struct tm * 41gmtime_r (time_t const * restrict t, struct tm * restrict tp) 42{ 43 return copy_tm_result (tp, gmtime (t)); 44} 45 46struct tm * 47localtime_r (time_t const * restrict t, struct tm * restrict tp) 48{ 49 return copy_tm_result (tp, localtime (t)); 50} 51