From owner-freebsd-bugs@FreeBSD.ORG Sat Mar 19 08:30:04 2005 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id DAEB716A4CE for ; Sat, 19 Mar 2005 08:30:03 +0000 (GMT) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 9B4D143D54 for ; Sat, 19 Mar 2005 08:30:03 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.3/8.13.3) with ESMTP id j2J8U398037900 for ; Sat, 19 Mar 2005 08:30:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.3/8.13.1/Submit) id j2J8U3JG037885; Sat, 19 Mar 2005 08:30:03 GMT (envelope-from gnats) Resent-Date: Sat, 19 Mar 2005 08:30:03 GMT Resent-Message-Id: <200503190830.j2J8U3JG037885@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Gerhard Gonter Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A00D316A4CF for ; Sat, 19 Mar 2005 08:25:37 +0000 (GMT) Received: from alcoholix.wu-wien.ac.at (alcoholix.wu-wien.ac.at [137.208.3.67]) by mx1.FreeBSD.org (Postfix) with ESMTP id D3B9943D1D for ; Sat, 19 Mar 2005 08:25:36 +0000 (GMT) (envelope-from root@alcoholix.wu-wien.ac.at) Received: from alcoholix.wu-wien.ac.at (localhost.wu-wien.ac.at [127.0.0.1]) j2J8OUXM060031; Sat, 19 Mar 2005 09:24:30 +0100 (CET) (envelope-from root@alcoholix.wu-wien.ac.at) Received: (from root@localhost) by alcoholix.wu-wien.ac.at (8.13.1/8.13.1/Submit) id j2J8OUDb060030; Sat, 19 Mar 2005 09:24:30 +0100 (CET) (envelope-from root) Message-Id: <200503190824.j2J8OUDb060030@alcoholix.wu-wien.ac.at> Date: Sat, 19 Mar 2005 09:24:30 +0100 (CET) From: Gerhard Gonter To: FreeBSD-gnats-submit@FreeBSD.org X-Send-Pr-Version: 3.113 cc: Gerhard Gonter Subject: misc/79008: add option for pom to specify EPOCH X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Gerhard Gonter List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 19 Mar 2005 08:30:04 -0000 >Number: 79008 >Category: misc >Synopsis: add option for pom to specify EPOCH >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Sat Mar 19 08:30:02 GMT 2005 >Closed-Date: >Last-Modified: >Originator: Gerhard Gonter >Release: FreeBSD 5.3-STABLE i386 >Organization: none >Environment: System: FreeBSD alcoholix.wu-wien.ac.at 5.3-STABLE FreeBSD 5.3-STABLE #0: Sun Dec 26 12:56:10 CET 2004 root@alcoholix.wu-wien.ac.at:/usr/obj/usr/src/sys/GENERIC i386 Architecture: i386 >Description: The pom command only displays the output for the current time. This submit allows the user to supply a different time expressed in EPOCH to obtain results for that time. >How-To-Repeat: >Fix: diff -ruN pom.orig/pom.6 pom/pom.6 --- pom.orig/pom.6 Sun Jul 15 09:49:21 2001 +++ pom/pom.6 Sun Nov 28 22:02:07 2004 @@ -44,3 +44,16 @@ utility displays the current phase of the moon. Useful for selecting software completion target dates and predicting managerial behavior. +.PP +.\" FIX ME! This should look slightly different! +The options are as follows: +.BL -tag -width indent +.PP +.I \-r seconds +.PP +display phase of moon for the given time (in EPOCH). This is usefull +to explain past or predict future managerial behavior. +.SH HISTORY +The +.I pom +command was derived from software posted to USENET. diff -ruN pom.orig/pom.c pom/pom.c --- pom.orig/pom.c Mon May 5 11:52:25 2003 +++ pom/pom.c Sun Nov 28 10:03:21 2004 @@ -60,6 +60,8 @@ #include #include #include +#include +#include #ifndef PI #define PI 3.14159265358979323846 @@ -76,16 +78,32 @@ static void adj360(double *); static double dtor(double); static double potm(double); +int main_pom (time_t); -int -main() +#ifndef NO_MAIN +int main (argc, argv) + int argc; + char *argv[]; { time_t tt; + (void) time(&tt); + + if (argc > 2 && strcmp (argv [1], "-r") == 0) + tt= atol (argv[2]); + + return main_pom (tt); + +} +#endif /* NO_MAIN */ + +int +main_pom(tt) + time_t tt; +{ struct tm *GMT; double days, today, tomorrow; int cnt; - (void) time(&tt); GMT = gmtime(&tt); days = (GMT->tm_yday + 1) + ((GMT->tm_hour + (GMT->tm_min / 60.0) + (GMT->tm_sec / 3600.0)) / 24.0); >Release-Note: >Audit-Trail: >Unformatted: