xref: /dflybsd-src/contrib/cvs-1.12/lib/time_r.h (revision 86d7f5d305c6adaa56ff4582ece9859d73106103)
186d7f5d3SJohn Marino /* Reentrant time functions like localtime_r.
286d7f5d3SJohn Marino 
386d7f5d3SJohn Marino    Copyright (C) 2003, 2005 Free Software Foundation, Inc.
486d7f5d3SJohn Marino 
586d7f5d3SJohn Marino    This program is free software; you can redistribute it and/or modify
686d7f5d3SJohn Marino    it under the terms of the GNU General Public License as published by
786d7f5d3SJohn Marino    the Free Software Foundation; either version 2, or (at your option)
886d7f5d3SJohn Marino    any later version.
986d7f5d3SJohn Marino 
1086d7f5d3SJohn Marino    This program is distributed in the hope that it will be useful,
1186d7f5d3SJohn Marino    but WITHOUT ANY WARRANTY; without even the implied warranty of
1286d7f5d3SJohn Marino    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
1386d7f5d3SJohn Marino    GNU General Public License for more details.
1486d7f5d3SJohn Marino 
1586d7f5d3SJohn Marino    You should have received a copy of the GNU General Public License along
1686d7f5d3SJohn Marino    with this program; if not, write to the Free Software Foundation,
1786d7f5d3SJohn Marino    Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.  */
1886d7f5d3SJohn Marino 
1986d7f5d3SJohn Marino /* Written by Paul Eggert.  */
2086d7f5d3SJohn Marino 
2186d7f5d3SJohn Marino #ifndef _TIME_R_H
2286d7f5d3SJohn Marino #define _TIME_R_H
2386d7f5d3SJohn Marino 
2486d7f5d3SJohn Marino /* Include <time.h> first, since it may declare these functions with
2586d7f5d3SJohn Marino    signatures that disagree with POSIX, and we don't want to rename
2686d7f5d3SJohn Marino    those declarations.  */
2786d7f5d3SJohn Marino #include <time.h>
2886d7f5d3SJohn Marino 
2986d7f5d3SJohn Marino #if !HAVE_TIME_R_POSIX
3086d7f5d3SJohn Marino # undef asctime_r
3186d7f5d3SJohn Marino # undef ctime_r
3286d7f5d3SJohn Marino # undef gmtime_r
3386d7f5d3SJohn Marino # undef localtime_r
3486d7f5d3SJohn Marino 
3586d7f5d3SJohn Marino # define asctime_r rpl_asctime_r
3686d7f5d3SJohn Marino # define ctime_r rpl_ctime_r
3786d7f5d3SJohn Marino # define gmtime_r rpl_gmtime_r
3886d7f5d3SJohn Marino # define localtime_r rpl_localtime_r
3986d7f5d3SJohn Marino 
4086d7f5d3SJohn Marino /* See the POSIX:2001 specification
4186d7f5d3SJohn Marino    <http://www.opengroup.org/susv3xsh/asctime.html>.  */
4286d7f5d3SJohn Marino char *asctime_r (struct tm const * restrict, char * restrict);
4386d7f5d3SJohn Marino 
4486d7f5d3SJohn Marino /* See the POSIX:2001 specification
4586d7f5d3SJohn Marino    <http://www.opengroup.org/susv3xsh/ctime.html>.  */
4686d7f5d3SJohn Marino char *ctime_r (time_t const *, char *);
4786d7f5d3SJohn Marino 
4886d7f5d3SJohn Marino /* See the POSIX:2001 specification
4986d7f5d3SJohn Marino    <http://www.opengroup.org/susv3xsh/gmtime.html>.  */
5086d7f5d3SJohn Marino struct tm *gmtime_r (time_t const * restrict, struct tm * restrict);
5186d7f5d3SJohn Marino 
5286d7f5d3SJohn Marino /* See the POSIX:2001 specification
5386d7f5d3SJohn Marino    <http://www.opengroup.org/susv3xsh/localtime.html>.  */
5486d7f5d3SJohn Marino struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
5586d7f5d3SJohn Marino #endif
5686d7f5d3SJohn Marino 
5786d7f5d3SJohn Marino #endif
58