From db90312471536b4db77916558e5ba7bf7632ad2f Mon Sep 17 00:00:00 2001 From: jeremy Date: Sat, 13 Jun 1998 01:09:22 +0000 Subject: Added optional argument for calculating the phase of the moon for a specified date, rather than the current time. --- pom/pom.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'pom/pom.c') diff --git a/pom/pom.c b/pom/pom.c index 510750c7..bec57938 100644 --- a/pom/pom.c +++ b/pom/pom.c @@ -1,4 +1,4 @@ -/* $NetBSD: pom.c,v 1.8 1997/10/12 01:01:39 lukem Exp $ */ +/* $NetBSD: pom.c,v 1.9 1998/06/13 01:09:22 jeremy Exp $ */ /* * Copyright (c) 1989, 1993 @@ -45,7 +45,7 @@ __COPYRIGHT("@(#) Copyright (c) 1989, 1993\n\ #if 0 static char sccsid[] = "@(#)pom.c 8.1 (Berkeley) 5/31/93"; #else -__RCSID("$NetBSD: pom.c,v 1.8 1997/10/12 01:01:39 lukem Exp $"); +__RCSID("$NetBSD: pom.c,v 1.9 1998/06/13 01:09:22 jeremy Exp $"); #endif #endif /* not lint */ @@ -65,6 +65,7 @@ __RCSID("$NetBSD: pom.c,v 1.8 1997/10/12 01:01:39 lukem Exp $"); #include #include #include +#include #include #define PI 3.141592654 @@ -93,8 +94,13 @@ main(argc, argv) double days, today, tomorrow; int cnt; - if (gettimeofday(&tp,&tzp)) - err(1, "gettimeofday"); + if (argc > 1) { + tp.tv_sec = atoi(argv[1]); + tp.tv_usec = 0; + } else { + if (gettimeofday(&tp,&tzp)) + err(1, "gettimeofday"); + } tmpt = tp.tv_sec; GMT = gmtime(&tmpt); days = (GMT->tm_yday + 1) + ((GMT->tm_hour + -- cgit v1.2.3