]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MINICERN/packlib/kernlib/kerngen/ccgen/datime.c
Bugfix in AliPoints2Memory
[u/mrichter/AliRoot.git] / MINICERN / packlib / kernlib / kerngen / ccgen / datime.c
CommitLineData
fe4da5cc 1/*
2 * $Id$
3 *
4 * $Log$
5 * Revision 1.5 1997/12/19 16:36:06 mclareni
6 * After 2000, the date in ID, ND will have the old format with the year as 2 digits
7 *
8 * Revision 1.4 1997/12/15 16:52:27 mclareni
9 * Make length of structure slate 40, same as common slate in all the other routines
10 *
11 * Revision 1.3 1997/09/02 14:26:35 mclareni
12 * WINNT correction
13 *
14 * Revision 1.2 1997/02/04 17:34:15 mclareni
15 * Merge Winnt and 97a versions
16 *
17 * Revision 1.1.1.1.2.1 1997/01/21 11:29:24 mclareni
18 * All mods for Winnt 96a on winnt branch
19 *
20 * Revision 1.1.1.1 1996/02/15 17:49:21 mclareni
21 * Kernlib
22 *
23 */
24#include "kerngen/pilot.h"
25#include "kerngen/fortranc.h"
26
27#if defined(CERNLIB_QMIRTD)
28#include "irtdgs/datime.c"
29#else
30/*> ROUTINE DATIME
31 CERN PROGLIB# Z007 DATIME .VERSION KERNFOR 4.40 940929
32*/
33#if !defined(CERNLIB_QMOS9)
34#include <sys/types.h>
35#endif
36#include <time.h>
37
38#if defined(CERNLIB_QX_SC)
39#define slate slate_
40struct { int inum[40]; } slate_;
41void type_of_call datime_(id, it)
42#endif
43#if defined(CERNLIB_QXNO_SC)
44struct { int inum[40]; } slate;
45void type_of_call datime(id, it)
46#endif
47#if defined(CERNLIB_QXCAPT)
48#define slate SLATE
49struct { int inum[40]; } SLATE;
50void type_of_call DATIME(id, it)
51#endif
52 int *id, *it;
53{
54 struct tm *tp;
55#if defined(CERNLIB_QMAPO)
56 int nsl;
57#endif
58
59#if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QX_SC))
60 void type_of_call toslat_();
61#endif
62#if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QXNO_SC))
63 void type_of_call toslat();
64#endif
65
66#if defined(CERNLIB_QXCAPT)
67 void type_of_call TOSLAT();
68#endif
69
70 time_t tloc = time(0);
71 tp = localtime(&tloc);
72 slate.inum[0] = tp->tm_year + 1900;
73 slate.inum[1] = tp->tm_mon + 1;
74 slate.inum[2] = tp->tm_mday;
75 slate.inum[3] = tp->tm_hour;
76 slate.inum[4] = tp->tm_min;
77 slate.inum[5] = tp->tm_sec;
78#if defined(CERNLIB_QMAPO)
79 nsl = 6;
80#endif
81#if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QX_SC))
82 toslat_ (slate.inum, &nsl);
83#endif
84#if (defined(CERNLIB_QMAPO))&&(defined(CERNLIB_QXNO_SC))
85 toslat (slate.inum, &nsl);
86#endif
87 *id = (tp->tm_year % 100 ) * 10000;
88 *id += (tp->tm_mon + 1) * 100;
89 *id += tp->tm_mday;
90 *it = tp->tm_hour * 100;
91 *it += tp->tm_min;
92 return;
93}
94/*> END <----------------------------------------------------------*/
95#endif