git: calendar(1): Sync with FreeBSD

Aaron LI aly at crater.dragonflybsd.org
Sat Nov 9 21:11:51 PST 2019


commit 148ae05012f30ac10fbce91110282aaaf45194e3
Author: Aaron LI <aly at aaronly.me>
Date:   Sun Feb 17 23:44:21 2019 +0800

    calendar(1): Sync with FreeBSD
    
    New features:
    * Support events that span multiple years, because of '-A', '-B' or just
      the three days before the end of the year.
    * Support for lunar events (full moon, new moon), solar events (equinox,
      solstice), and Chinese new year.  Because of this, the options '-U'
      (UTC offset) and '-l' (longitude) are available to compensate if
      reality doesn't match the calculated values.
    * Implement an internal 'cpp'-like parser to parse the calendars, so no
      longer require the external cpp(1).
    
    Changed behavior:
    DragonFly's calendar(1) switched to use the 'calendar.all' file by
    default in 9abdd9620822cc1232dc702a76d95ebf133733b5.  This calendar file
    always exists.  However, it makes calendar(1) print too much entries,
    which I think most users would not need.  So switch to the original
    default calendar file, i.e., 'calendar', the same as other BSDs.
    
    The following minor changes were made:
    1. In 'calendar.c' and 'io.c', delete the unused 'copyright' variable
       to suppress the compilation warnings.
    2. In 'sunpos.c', rename the macro 'MIN(h)' to 'MINUTE(h)' to avoid the
       conflict; meanwhile rename the macro 'SMIN(h)' to 'SMINUTE(h)' for
       better consistency.
    
    More cleanups and improvements to follow.

Summary of changes:
 usr.bin/calendar/Makefile    |    6 +-
 usr.bin/calendar/calendar.1  |  117 ++++-
 usr.bin/calendar/calendar.c  |  183 +++++--
 usr.bin/calendar/calendar.h  |  194 ++++++--
 usr.bin/calendar/dates.c     |  453 +++++++++++++++++
 usr.bin/calendar/day.c       |  473 ++----------------
 usr.bin/calendar/events.c    |  125 +++++
 usr.bin/calendar/io.c        |  659 +++++++++++++------------
 usr.bin/calendar/locale.c    |  168 +++++++
 usr.bin/calendar/ostern.c    |   95 +---
 usr.bin/calendar/parsedata.c | 1118 ++++++++++++++++++++++++++++++++++++++++++
 usr.bin/calendar/paskha.c    |   73 +--
 usr.bin/calendar/pathnames.h |    8 +-
 usr.bin/calendar/pom.c       |  278 +++++++++++
 usr.bin/calendar/sunpos.c    |  450 +++++++++++++++++
 15 files changed, 3441 insertions(+), 959 deletions(-)
 create mode 100644 usr.bin/calendar/dates.c
 create mode 100644 usr.bin/calendar/events.c
 create mode 100644 usr.bin/calendar/locale.c
 create mode 100644 usr.bin/calendar/parsedata.c
 create mode 100644 usr.bin/calendar/pom.c
 create mode 100644 usr.bin/calendar/sunpos.c

http://gitweb.dragonflybsd.org/dragonfly.git/commitdiff/148ae05012f30ac10fbce91110282aaaf45194e3


-- 
DragonFly BSD source repository


More information about the Commits mailing list