xref: /original-bsd/usr.bin/pascal/pxp/version.c (revision 2bb802fc)
1 /*
2  * Copyright (c) 1980 Regents of the University of California.
3  * All rights reserved.  The Berkeley software License Agreement
4  * specifies the terms and conditions for redistribution.
5  */
6 
7 #ifndef lint
8 char copyright[] =
9 "@(#) Copyright (c) 1980 Regents of the University of California.\n\
10  All rights reserved.\n";
11 #endif not lint
12 
13 #ifndef lint
14 static char sccsid[] = "@(#)version.c	5.1 (Berkeley) 06/05/85";
15 #endif not lint
16 
17 #include <sys/time.h>
18 #include <stdio.h>
19 
20 extern char	version[];
21 
22 main()
23 {
24     long	time();
25     long	clock;
26     struct tm	*localtime();
27     struct tm	*tmp;
28     int		major;
29     int		minor;
30 
31     time(&clock);
32     tmp = localtime(&clock);
33     sscanf(version, "%d.%d", &major, &minor);
34     minor += 1;
35     printf("char	version[] = \"%d.%d (%d/%d/%d)\";\n",
36 	    major, minor, tmp->tm_mon+1, tmp->tm_mday, tmp->tm_year);
37 }
38