+/* $NetBSD: pom.c,v 1.6 1996/02/06 22:47:29 jtc Exp $ */
+
/*
- * Copyright (c) 1989 The Regents of the University of California.
- * All rights reserved.
+ * Copyright (c) 1989, 1993
+ * The Regents of the University of California. All rights reserved.
*
* This code is derived from software posted to USENET.
*
*/
#ifndef lint
-char copyright[] =
-"@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
+static char copyright[] =
+"@(#) Copyright (c) 1989, 1993\n\
+ The Regents of the University of California. All rights reserved.\n";
#endif /* not lint */
#ifndef lint
-/*static char sccsid[] = "from: @(#)pom.c 5.3 (Berkeley) 2/28/91";*/
-static char rcsid[] = "$Id: pom.c,v 1.2 1993/08/01 18:53:16 mycroft Exp $";
+#if 0
+static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93";
+#else
+static char rcsid[] = "$NetBSD: pom.c,v 1.6 1996/02/06 22:47:29 jtc Exp $";
+#endif
#endif /* not lint */
/*
#include <sys/time.h>
#include <stdio.h>
+#include <string.h>
#include <tzfile.h>
#include <math.h>
+#include <errno.h>
#define PI 3.141592654
#define EPOCH 85
main()
{
- extern int errno;
struct timeval tp;
struct timezone tzp;
struct tm *GMT, *gmtime();
+ time_t tmpt;
double days, today, tomorrow;
int cnt;
- char *strerror();
if (gettimeofday(&tp,&tzp)) {
(void)fprintf(stderr, "pom: %s\n", strerror(errno));
exit(1);
}
- GMT = gmtime(&tp.tv_sec);
+ tmpt = tp.tv_sec;
+ GMT = gmtime(&tmpt);
days = (GMT->tm_yday + 1) + ((GMT->tm_hour +
(GMT->tm_min / 60.0) + (GMT->tm_sec / 3600.0)) / 24.0);
for (cnt = EPOCH; cnt < GMT->tm_year; ++cnt)
today);
}
}
+ exit(0);
}
/*