00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #include "kerngen/pilot.h"
00030 #include "kerngen/fortranc.h"
00031
00032 #if defined(CERNLIB_QMIRTD)
00033 #include "irtdgs/datime.c"
00034 #else
00035
00036
00037
00038 #if !defined(CERNLIB_QMOS9)
00039 #include <sys/types.h>
00040 #endif
00041 #include <time.h>
00042
00043 #if defined(CERNLIB_QX_SC)
00044 #define slate slate_
00045 struct { int inum[40]; } slate_;
00046 void type_of_call datime_(id, it)
00047 #endif
00048 #if defined(CERNLIB_QXNO_SC)
00049 struct { int inum[40]; } slate;
00050 void type_of_call datime(id, it)
00051 #endif
00052 #if defined(CERNLIB_QXCAPT)
00053 #define slate SLATE
00054 struct { int inum[40]; } SLATE;
00055 void type_of_call DATIME(id, it)
00056 #endif
00057 int *id, *it;
00058 {
00059 struct tm *tp;
00060 #if defined(CERNLIB_QMAPO)
00061 int nsl;
00062 #endif
00063
00064 #if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QX_SC))
00065 void type_of_call toslat_();
00066 #endif
00067 #if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QXNO_SC))
00068 void type_of_call toslat();
00069 #endif
00070
00071 #if defined(CERNLIB_QXCAPT)
00072 void type_of_call TOSLAT();
00073 #endif
00074
00075 time_t tloc = time(0);
00076 tp = localtime(&tloc);
00077 slate.inum[0] = tp->tm_year + 1900;
00078 slate.inum[1] = tp->tm_mon + 1;
00079 slate.inum[2] = tp->tm_mday;
00080 slate.inum[3] = tp->tm_hour;
00081 slate.inum[4] = tp->tm_min;
00082 slate.inum[5] = tp->tm_sec;
00083 #if defined(CERNLIB_QMAPO)
00084 nsl = 6;
00085 #endif
00086 #if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QX_SC))
00087 toslat_ (slate.inum, &nsl);
00088 #endif
00089 #if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QXNO_SC))
00090 toslat (slate.inum, &nsl);
00091 #endif
00092 *id = (tp->tm_year % 100 ) * 10000;
00093 *id += (tp->tm_mon + 1) * 100;
00094 *id += tp->tm_mday;
00095 *it = tp->tm_hour * 100;
00096 *it += tp->tm_min;
00097 return;
00098 }
00099
00100 #endif