CAL is a nicely-enhanced version of the unix `cal' command for MSDOS.
Features:

 * Hilights today's date when displaying a monthly calendar.

 * Displays an optional user-definable list of `special day'
   descriptions (like appointments) to the right of the monthly
   calendar display.  Cal can be set optionally to ignore appointments
   older than the current day.  Next month's appointments are shown if
   there is room to do so.  Multiple appointment data files may also
   be specified on the commandline.
   
 * You can specify your own appointment and color definition files on the
   commandline, or use the defaults.

 * Date descriptions can display "years since" a given year, useful for
   birthdays and anniversaries.

 * Completely configurable colors -- eight separate color attributes.

 * No ANSI driver needed for colors, and the output may be redirected
   anywhere, just like the unix version.  However, ANSI color control may
   be enabled (e.g. for unix) with a #define in the source code.

 * Commandline-compatible with unix `cal' command, but with several
   enhanced switch settings.

 * Source code included.

This archived collection of files is placed into the Public Domain.
Feel free to redistribute the this archive, but PLEASE make sure the
archive contains all the original files, namely:

        readme.cal        - this file
        cal.exe           - the MSDOS executable program
        cal.doc           - documentation for cal.exe
        cal.dat           - optional sample data file of appointment dates
        cal.col           - optional sample file of color attributes
        source/*.os2      - files about compiling the source for OS/2
        source/*.unx      - unix-related information
        source/cal.1      - unix man page for cal with formatting codes
        source/cal.c      - source code for cal
        source/makefile.* - makefiles

Note:  _I_ think the colors defined in the color definition file
cal.col are ugly!  If you want to use the more attractive (in my
opinion) default colors, just delete or rename cal.col.  This file
is only included to show you how it works.

The source code should be compilable for any OS.  No guarantees are made
in this regard, however.

Requests, bug reports, suggestions, donations, proposals for
contract work, and so forth may be sent to:

        Attn:  Alex Matulich
        Unicorn Research Corporation
        4621 N. Landmark Drive
        Orlando, FL 32817-1235
        USA
        407-657-4974  FAX 407-657-6149

or send e-mail to alex@unicorn.us.com.

Unicorn Research is now on the World Wide Web!  http://unicorn.us.com


Version history:

1.0
Port to MSDOS of original unix-to-Amiga port by Gary L. Brant.

2.0
Modified to display calendar in colors without ANSI.SYS, while retaining
output redirectability.  Added current day indicator in monthly display.
Made all code compatible with unix and ANSI C by putting all MSDOS-specific
code into blocks activated by #define MSDOS at beginning of source file.

2.1
Added display of special date descriptions to monthly calendar.  Re-wrote
some code sections to accommodate this feature.  All arrays are now
dynamic to reduce the size of the executable.

2.2
Fixed an intermittent pointer-trashing bug in the date description section
that caused the monthly display to display garbage at times.

2.3
Removed hardcoded color settings, and added capability to read external
color file.

2.4
Added -d switch to inhibit the display of outdated date descriptions
(changed to --f in version 2.7).

2.5
Fixed two bugs reported by J"urgen Koslowski.  The "last weekday of month"
function in the cal.dat file now works, and the single-month display now
looks fine if the year doesn't have 4 digits.  Also re-wrote the section
that processes command-line arguments.

2.6
Fixed a bug reported by Paul Beam.  Date descriptions longer than 50
characters now do not blank out the next line in the calendar.

2.7 - 29 March 1993
Darrel Hankerson hankedr@mail.auburn.edu and
other contributors added improved commandline switches, allowing the
appointment file and color file to be specified on the commandline, and
also the ability to display next month's appointments on the current
month if there is room to do so.  Processing of commandline arguments
has been completely replaced by the GNU getopt.c library functions.  The
source will now use colors if compiled under OS/2, also, and search PATH
and DPATH for data files.  A potentially serious bug pertaining to path
concatenation was caught.

  New command line options:
    [-nodata] [-data-file=data-file]
  and color options (if compiling with -DUSE_COLOR for OS/2 or MSDOS)
    [-nocolor] [-color-file=color-file]

2.8
Added --europe switch, so that the calendar display has Monday as the
first day of the week, which is a more familiar format in Europe.

2.9 - 05 June 1993
Don Retzlaff (donr@gab.unt.edu, University of North Texas)
sent code with several fine modifications, but it was useful
only for the Borland compiler.  Alex Matulich rewrote it for ANSI compatibility.
The maximum number of appointments to be displayed now defaults to 24, and
is adjustable on the commandline.  Multiple data files may be specified.
Cal no longer stops reading a data file when it has filled up its maximum
number of descriptions; it now reads through the whole file so that it can
sort out all dates to be displayed.

  New command line option: [--maxappts=num]
  Allow multiple --datafile= command line parameters


2.9a&b
a: Fixed a bug in 2.8 and 2.9 that caused cal to attempt to read its color
file before determining its home directory.  Also added a contributor's
suggestion to detect the number of columns for MSDOS displays wider than 
80 columns, so that appointments won't be truncated if they really can fit.
b: Minor changes made for greater compatibility with other compilers.

3.0(a)
(Not significantly new, just the next number in the sequence)
Replaced tabs with spaces, for systems with tab stops other than every 8
characters.  Added an "anniversaries and birthdays" feature whereby if a
date description contains a year in brackets or braces, this number is
converted to the number of years since the year indicated.  3.0a fixes
a problem when the 0th anniversary was displayed as blank.

3.1
Fixed trashed memory pointer when the number of appointments exceeded the
maximum specified number of lines.  Fixed ordinal suffixes for anniversary
dates between 11 and 13.  Added weekly reminder feature (specify a negative
day-of-week number in NW field in cal.dat).  Added daily reminder feature
(specify -9 for DY field in cal.dat).  Fixed problem with January
anniversaries being 1 year off if displayed with December calendar.

3.2
Fixed display problem causing garbage to appear when changing maximum
displayable appointments.  Rewrote commandline argument parsing to be more
efficient.  Commandline arguments can now be preceded with a single '-'
and also a '/' if using MSDOS or OS/2 (the old '--' method still works
for compatibility with previous versions).  Next-month birthdays and
anniversaries are no longer displayed a year older than they should be.

3.3 
Fixed a problem where the "next month" appointment descriptions displayed
during December were those of January that same year, instead of next year.
Fixed problem that sometimes caused weekly reminders to be duplicated.

3.4 - 31 August 1995
Chris Bagwell modified the source extensively to use ANSI color control
instead of hardware control, and made other unix-related changes.  Added
support for periodic reminders (e.g. payday every 14 days).  Added -p flag.
Added -8bit option for enabling 8-bit characters under unix.

3.5 - 11 January 1996
Dan Fandrich dan@fch.wimsey.bc.ca added support for unix "reminder(1)" date file.
Cleaned up source code.  Fixed a bug in periodic reminders that caused all periodic
dates for that month to have todays date on the day of the event.  Added
support for reading an environment variable CALOPT.  If this variable is
set then it will be read in and any command line options will be used.
Cal will now return an error code if it did not successfully run.  Dates
calculated in description text changed.  It now never displays the [] or
{}'s.  If you need them then you can add it to the text by escaping them
with a '\' (such as "\[").  Added -thismonth option to disable appointment
display for next month; this also now requires the -today option to be
specified with more than just -t.

3.5b/c
Added FreeBSD compatibility.  Added PREFIX definition for specifying
default directory for color and data files.  Fixed broken Sep 1752 display
when using -europe switch.  Fixed ANSI-color end-of-line problem when
scrolling a yearly calendar.  3.5c - fixed strok() NULL bug.

4.0
All known bugs fixed.

4.1 (June 2014)
Thanks to Sylvan Butler: Fixed minor bug causing this line in cal.dat
to fail to appear on the day requested:
-999 06 00 16 National Donut Day {1938}
Fixed documentation inconsistencies (there is no 'caldat', only
'cal.dat' or '.cal.dat').
Thanks to Daniel Lange: Fixed segfault if HOME is not set under unix
(like under a web environment). Made PREFIX mandatory to define.
Removed OS/2 makefiles (obsolete).

