calendar(1): Sync with FreeBSD
authorAaron LI <aly@aaronly.me>
Sun, 17 Feb 2019 15:44:21 +0000 (23:44 +0800)
committerAaron LI <aly@aaronly.me>
Sun, 10 Nov 2019 04:56:03 +0000 (12:56 +0800)
commit148ae05012f30ac10fbce91110282aaaf45194e3
treefb3df65f4547eba1516f3b9e074ea0804536afb0
parent54dbcd50cdda04d13db52aea66ec46b76bb7ce15
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.
15 files changed:
usr.bin/calendar/Makefile
usr.bin/calendar/calendar.1
usr.bin/calendar/calendar.c
usr.bin/calendar/calendar.h
usr.bin/calendar/dates.c [new file with mode: 0644]
usr.bin/calendar/day.c
usr.bin/calendar/events.c [new file with mode: 0644]
usr.bin/calendar/io.c
usr.bin/calendar/locale.c [new file with mode: 0644]
usr.bin/calendar/ostern.c
usr.bin/calendar/parsedata.c [new file with mode: 0644]
usr.bin/calendar/paskha.c
usr.bin/calendar/pathnames.h
usr.bin/calendar/pom.c [new file with mode: 0644]
usr.bin/calendar/sunpos.c [new file with mode: 0644]