To compile:
-----------

  cc -o pcal pcal.c





Info on usage etc:
------------------

I wrote this because I was interested in writing a routine to figure
out the day of the week for a specific date(as it ended up, I couldn't
get my hands on any algorithm so I got ripped some code from some one's
program in the archives). Any how I ended up writing this calendar program.


I call this program 'pcal' because it it prints out one month per page.
Each month is separated by control-L type form feed character.
For testing, I picked random years and verified them.
Each month is made up of a grid of 7(width) by 5(height) squares. Any
month that requires over 5 squares high wil have the the appropriate
days split in half.


A typical month looks like.


                                      1989

                                     April

    |   SUN   |   MON   |   TUE   |   WED   |   THU   |   FRI   |   SAT   |
    -----------------------------------------------------------------------
    |         |         |         |         |         |         | 1|      |
    |         |         |         |         |         |         |---      |
    |         |         |         |         |         |         |         |
    |         |         |         |         |         |         |         |
    |         |         |         |         |         |         |         |
    -----------------------------------------------------------------------
    | 2|      | 3|      | 4|      | 5|      | 6|      | 7|      | 8|      |
    |---      |---      |---      |---      |---      |---      |---      |
    |         |         |         |         |         |         |         |
    |         |         |         |         |         |         |         |
    |         |         |         |         |         |         |         |
    -----------------------------------------------------------------------
    | 9|      |10|      |11|      |12|      |13|      |14|      |15|      |
    |---      |---      |---      |---      |---      |---      |---      |
    |         |         |         |         |         |         |         |
    |         |         |         |         |         |         |         |
    |         |         |         |         |         |         |         |
    -----------------------------------------------------------------------
    |16|      |17|      |18|      |19|      |20|      |21|      |22|      |
    |---      |---      |---      |---      |---      |---      |---      |
    |         |         |         |         |         |         |         |
    |         |         |         |         |         |         |         |
    |         |         |         |         |         |         |         |
    -----------------------------------------------------------------------
    |23|    _/|24|      |25|      |26|      |27|      |28|      |29|      |
    |---  _/  |---      |---      |---      |---      |---      |---      |
    |   _/    |         |         |         |         |         |         |
    | _/   ---|         |         |         |         |         |         |
    |/     |30|         |         |         |         |         |         |
    -----------------------------------------------------------------------
       



Usage: pcal [-l] [-m startmonth]
            [-n nummonths] [-u] [-y startyear]
       startmonth:day of month to start on(1=jan...12=dec)
       startyear :year to start on(1989=1989, 89=0089)
                  default startday=1, startmonth=1,
                  startyear=current year
       nummonths :#of months to print out(default is 12)
       -l        :suppress printing of ^L's after each month
                  default is to print them
       -u        :print this synopsis



Examples:
   Say todays date is March 17, 1989.


   pcal   -> print out a 12 month calendar for the year 1989.
             Each month is printed on a separate page.

   pcal -n 3     ->print out Jan,Feb,March of 1989, each on a separate
                   page.

   pcal -n 3 -l  ->print out Jan,Feb,March of 1989. Each month is printed
                   one after another.

   pcal -m 4 -n 1 -> prints out the month of April, 1989 and a form feed.

   pcal -m 4 -y 1992 -n 24 ->prints out months from April, 1992 to 
                             April, 1994. Each month separated by a control-L.


Feel free to make any changes to the code, but leave my name at the top
of the code file(s).

