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/ltime_.c,v 1.1.1.1 2005/10/21 19:00:00 marcel Exp $ */ 00035 /* 00036 * 00037 * return broken down time 00038 * 00039 * calling sequence: 00040 * integer time, t[9] 00041 * call ltime(time, t) 00042 * where: 00043 * time is a system time. (see time(3F)) 00044 * t will receive the broken down time corrected for local timezone. 00045 * (see ctime(3)) 00046 */ 00047 00048 #include <time.h> 00049 00050 #ifdef KEY /* Bug 1683, 5019 */ 00051 00052 #include "pathf90_libU_intrin.h" 00053 00054 void 00055 pathf90_ltime(pathf90_i4 *clock, pathf90_i4 *t) 00056 { 00057 int i; 00058 struct tm temp; 00059 00060 localtime_r((time_t *)clock, &temp); 00061 t[0] = temp.tm_sec; 00062 t[1] = temp.tm_min; 00063 t[2] = temp.tm_hour; 00064 t[3] = temp.tm_mday; 00065 t[4] = temp.tm_mon; 00066 t[5] = temp.tm_year; 00067 t[6] = temp.tm_wday; 00068 t[7] = temp.tm_yday; 00069 t[8] = temp.tm_isdst; 00070 } 00071 00072 #else 00073 00074 extern void 00075 ltime_ (int *clock, int *t) 00076 { 00077 int i; 00078 int *l; 00079 00080 l = (int *) localtime((time_t *)clock); 00081 for (i=0; i<9; i++) 00082 *t++ = *l++; 00083 } 00084 00085 #endif /* KEY Bug 1683, 5019 */
1.5.6