00001 /* 00002 * Copyright 2002, 2003, 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 /* --------------------------------------------------- */ 00035 /* | All Rights Reserved. | */ 00036 /* --------------------------------------------------- */ 00037 /* $Header: /proj/osprey/CVS/open64/osprey1.0/libU77/itime_.c,v 1.1.1.1 2005/10/21 19:00:00 marcel Exp $ */ 00038 /* 00039 * 00040 * return the current time in numerical form 00041 * 00042 * calling sequence: 00043 * integer iarray(3) 00044 * call itime(iarray) 00045 * where: 00046 * iarray will receive the current time; hour, min, sec. 00047 */ 00048 00049 #include <sys/types.h> 00050 #if defined(_SYSV) || defined(_SYSTYPE_SVR4) || defined(KEY) 00051 #include <time.h> 00052 #else 00053 #include <sys/time.h> 00054 #endif 00055 00056 typedef struct { 00057 int ihr; 00058 int imin; 00059 int isec; 00060 } itime_struct; 00061 00062 #ifdef KEY /* Bug 1683, 5019 */ 00063 00064 #include "pathf90_libU_intrin.h" 00065 00066 void 00067 pathf90_itime(pathf90_i4 *iar) 00068 { 00069 struct tm lclt; 00070 time_t t; 00071 00072 t = time(0); 00073 localtime_r(&t, &lclt); 00074 iar[0] = lclt.tm_hour; 00075 iar[1] = lclt.tm_min; 00076 iar[2] = lclt.tm_sec; 00077 } 00078 00079 #else 00080 00081 extern void 00082 itime_ (itime_struct *iar) 00083 { 00084 struct tm *lclt; 00085 time_t t; 00086 00087 t = time(0); 00088 lclt = localtime(&t); 00089 iar->ihr = lclt->tm_hour; 00090 iar->imin = lclt->tm_min; 00091 iar->isec = lclt->tm_sec; 00092 } 00093 00094 #endif /* KEY Bug 1683, 5019 */
1.5.6