00001 /* 00002 * Copyright 2004, 2005, 2006 PathScale, Inc. All Rights Reserved. 00003 */ 00004 00005 /* 00006 00007 Copyright (C) 1999-2001, Silicon Graphics, Inc. All Rights Reserved. 00008 00009 This program is free software; you can redistribute it and/or modify it 00010 under the terms of version 2.1 of the GNU Lesser General Public License 00011 as published by the Free Software Foundation. 00012 00013 This program is distributed in the hope that it would be useful, but 00014 WITHOUT ANY WARRANTY; without even the implied warranty of 00015 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. Further, any 00016 license provided herein, whether implied or otherwise, is limited to 00017 this program in accordance with the express provisions of the 00018 GNU Lesser General Public License. 00019 00020 Patent licenses, if any, provided herein do not apply to combinations 00021 of this program with other product or programs, or any other product 00022 whatsoever. This program is distributed without any warranty that the 00023 program is delivered free of the rightful claim of any third person by 00024 way of infringement or the like. 00025 00026 See the GNU Lesser General Public License for more details. 00027 00028 You should have received a copy of the GNU General Public License along 00029 with this program; if not, write the Free Software Foundation, Inc., 59 00030 Temple Place - Suite 330, Boston MA 02111-1307, USA. 00031 00032 */ 00033 00034 /* $Header: /proj/osprey/CVS/open64/osprey1.0/libU77/ctime_.c,v 1.1.1.1 2005/10/21 19:00:00 marcel Exp $ */ 00035 /* 00036 * 00037 * convert system time to ascii string 00038 * 00039 * calling sequence: 00040 * character*24 string, ctime 00041 * integer clock 00042 * string = ctime (clock) 00043 * where: 00044 * string will receive the ascii equivalent of the integer clock time. 00045 */ 00046 00047 #include <sys/types.h> 00048 #include <time.h> 00049 #include "externals.h" 00050 00051 #ifdef KEY /* Bug 1683, 5019 */ 00052 00053 #include "pathf90_libU_intrin.h" 00054 00055 #define CTIME_BUFLEN 26 00056 00057 void 00058 pathf90_ctime4(char *str, int len, pathf90_i4 *clock) 00059 { 00060 char buf[CTIME_BUFLEN]; 00061 time_t ctemp = (time_t) *clock; 00062 char *s = ctime_r(&ctemp, buf); 00063 s[24] = '\0'; 00064 b_char(s, str, len); 00065 } 00066 00067 void 00068 pathf90_subr_ctime4(pathf90_i4 *clock, char *str, int len) 00069 { 00070 pathf90_ctime4(str, len, clock); 00071 } 00072 00073 void 00074 pathf90_ctime8(char *str, int len, pathf90_i8 *clock) 00075 { 00076 char buf[CTIME_BUFLEN]; 00077 time_t ctemp = (time_t) *clock; 00078 char *s = ctime_r(&ctemp, buf); 00079 s[24] = '\0'; 00080 b_char(s, str, len); 00081 } 00082 00083 void 00084 pathf90_subr_ctime8(pathf90_i8 *clock, char *str, int len) 00085 { 00086 pathf90_ctime8(str, len, clock); 00087 } 00088 00089 #else 00090 00091 extern void 00092 ctime_ (char *str, int len, int *clock) 00093 { 00094 char *s = ctime((time_t *)clock); 00095 s[24] = '\0'; 00096 b_char(s, str, len); 00097 } 00098 #endif /* KEY Bug 1683, 5019 */
1.5.6