00001 /* 00002 * Copyright 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* Copyright (C) 1995, 1996, 2001 Free Software Foundation, Inc. 00006 This file is part of GNU Fortran libU77 library. 00007 00008 This library is free software; you can redistribute it and/or modify it 00009 under the terms of the GNU Library General Public License as published 00010 by the Free Software Foundation; either version 2 of the License, or 00011 (at your option) any later version. 00012 00013 GNU Fortran is distributed in the hope that it will be useful, 00014 but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00016 Library General Public License for more details. 00017 00018 You should have received a copy of the GNU Library General Public 00019 License along with GNU Fortran; see the file COPYING.LIB. If 00020 not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00021 Boston, MA 02111-1307, USA. */ 00022 00023 #include "config.h" 00024 #include <stdio.h> 00025 #include <sys/types.h> 00026 #if TIME_WITH_SYS_TIME 00027 # include <sys/time.h> 00028 # include <time.h> 00029 #else 00030 # if HAVE_SYS_TIME_H 00031 # include <sys/time.h> 00032 # else 00033 # include <time.h> 00034 # endif 00035 #endif 00036 #if HAVE_STRING_H 00037 # include <string.h> 00038 #else 00039 # include <strings.h> 00040 #endif 00041 00042 #include "f2c.h" 00043 00044 /* NB. this implementation is for a character*24 function. There's 00045 also a subroutine version. Of course, the calling convention is 00046 essentially the same for both. */ 00047 00048 #ifdef KEY /* Bug 1683, 5019 */ 00049 00050 #include "pathf90_libU_intrin.h" 00051 00052 #define CTIME_BUFLEN 26 00053 00054 void 00055 pathf90_fdate(char *ret_val, int ret_val_len) 00056 { 00057 int s_copy (); 00058 char buf[CTIME_BUFLEN]; 00059 time_t tloc; 00060 tloc = time (NULL); 00061 /* Allow a length other than 24 for compatibility with what other 00062 systems do, despite it being documented as 24. */ 00063 s_copy (ret_val, ctime_r ((time_t *) & tloc, buf), ret_val_len, 24); 00064 } 00065 00066 #else 00067 00068 /* Character *24 */ void 00069 fdate_ (char *ret_val, ftnlen ret_val_len) 00070 { 00071 int s_copy (); 00072 time_t tloc; 00073 tloc = time (NULL); 00074 /* Allow a length other than 24 for compatibility with what other 00075 systems do, despite it being documented as 24. */ 00076 s_copy (ret_val, ctime ((time_t *) & tloc), ret_val_len, 24); 00077 } 00078 #endif /* KEY Bug 1683, 5019 */
1.5.6