Clock 1.1.0

by Kevin Athey

Behold! Software (c)1995-1996


Instructions
------------
Always start with a very simple clock and then build it up to what you
want. Your first HTML piece should look something like this:

<img src=/cgi-bin/clock.exe?>

If this doesn't work, you will have to look carefully at how you have things
coded.


Usage
-----
Usage: clock [-f<fg clr>] [-b<bg clr> | -t<t idx>] [-s<style>]
[-d<GIF dir>] [-r] [-l<LAYOUT>] [-z]
-f<fg clr> - color to render foreground in.
-b<bg clr> - color to render background in.
-t<t idx> - index to color which should be transparent.
-s<style> - name of number style (#style.gif).
-d<GIF dir> - directory where digits are located.
relative to the location of this program.
-r - raw, no HTTP prefix. not useful in HTML,
only on the command line.
-l<LAYOUT> - specify format of time. (default: ZH:MM)
CASE is SIGNIFICANT.
HH - 24-hour clock (no zero pad). No zero pad means
ZH - 24-hour clock (zero pad). that if the time
hh - 12-hour clock (no zero pad). is 5:03 it won't
zh - 12-hour clock (zero pad). display as 05:03
MM - the minutes.
SS - the seconds.
m - the meridiem. (AM or PM).
-z - time zone in minutes to add to local to achieve UTC.

Some More Advanced And Complicated Examples
-------------------------------------------

HTML Example: <img src=clock.exe?-f0000FF+-bFF0000>

This will put the graphic in your page. The time will be displayed as a
24-hour clock without seconds: 20:54 or 08:54, depending on PM or AM.
This will create BLUE numbers on a RED background using the default digits.


Another HTML Example: <img src=clock.exe?-t0+-f00FF00>

This will create GREEN numbers on a TRANSPARENT background using the
default digits.


Yet Another HTML Example: <img src=clock.exe?-lhh:MM:SSm>

This will use the default digits to present the time and make it look
something like this: 8:54:32pm or 8:54:32am.


Specifying Colors
-----------------
When you are specifying colors you must use the following format.
RRGGBB, where each pair represents a hexadecimal number. You must include
all necessary zeros. More numbers representing the different colors can
be found on the following pages:
http://www.fament.com/colorpg.htm
http://www.fament.com/colorcodes.htm

Example: FF0000 - Bright Red
Example: 00FF00 - Bright Green
Example: 0000FF - Bright Blue


Specifying Digit Directory
--------------------------
The default is "digits" and is relative to the location of the program.
When specifying a different directory, remember to make it relative to
where the program resides.

Example: <img src=clock.exe?-dmydigits+-smine>

Clock will produce its GIF using the following GIF files:
mydigits/0mine.gif, mydigits/1mine.gif, mydigits/2mine.gif, ...


Adding Your Own Digits
----------------------
You can create your own digits. They must be GIFs and they must all be
the same height in one group. The naming convention is the digit
followed by the style name. And for the colon (or separator) use 'c' to
replace the digit. For AM use 'a' to replace the digit. For PM use 'p' to
replace the digit. So your new complete set will have the following files
in it:

0mine.gif
1mine.gif
2mine.gif
3mine.gif
4mine.gif
5mine.gif
6mine.gif
7mine.gif
8mine.gif
9mine.gif
cmine.gif
amine.gif
pmine.gif

The style name will be 'mine'.

Time Zone
---------
This is a tricky parameter. In brief, the number you specify is the number
of minutes you would need to subtract from UTC (GMT) to end up with the time
you want. You should ignore Daylight Savings Time, because I do my best to
adjust for it automatically.

So, for example, if you live in California, you are 8 hours behind GMT, so you
should specify -480, because that is 8 times 60 to give you minutes and make
it negative because you need to subtract it because California is always later
than England.

My solution for this is not perfect. If, for instance, the server has a
time zone which has Daylight Savings Time, and the time you want to show,
doesn't have Daylight Savings Time, the time will be incorrect. The only
real way to address this problem is for me to adjust the program and for you
the user to specify a very long descriptive name of the time zone.
(In other words, virtually impossible! <G>)

CREDITS
-------
This product uses "gd 1.2" for the GIF manipulation.
You can acquire this library at the following location:
<http://www.boutell.com/gd/>

Here are all the copyrights required by it:

gd 1.2 is copyright 1994, 1995, Quest Protein Database Center, Cold Spring
Harbor Labs. Permission granted to copy and distribute this work provided that
this notice remains intact. Credit for the library must be given to the Quest
Protein Database Center, Cold Spring Harbor Labs, in all derived works. This
does not affect your ownership of the derived work itself, and the intent is
to assure proper credit for Quest, not to interfere with your use of gd. If
you have questions, ask. ("Derived works" includes all programs that utilize
the library. Credit must be given in user-visible documentation.)

The Quest Protein Database Center is funded under Grant P41-RR02188 by the
National Institutes of Health.

Written by Thomas Boutell (boutell@boutell.com), 2/94 - 7/95.

The GIF compression code is based on that found in the pbmplus utilities,
which in turn is based on GIFENCOD by David Rowley. See the notice below:

/*
** Based on GIFENCOD by David Rowley .A
** Lempel-Zim compression based on "compress".
**
** Modified by Marcel Wijkstra
**
** Copyright (C) 1989 by Jef Poskanzer.
**
** Permission to use, copy, modify, and distribute this software and its
** documentation for any purpose and without fee is hereby granted, provided
** that the above copyright notice appear in all copies and that both that
** copyright notice and this permission notice appear in supporting
** documentation. This software is provided "as is" without express or
** implied warranty.
**
** The Graphics Interchange Format(c) is the Copyright property of
** CompuServe Incorporated. GIF(sm) is a Service Mark property of
** CompuServe Incorporated.
*/

The GIF decompression is based on that found in the pbmplus utilities, which
in turn is based on GIFDECOD by David Koblas. See the notice below:

/* +-------------------------------------------------------------------+ */
/* | Copyright 1990, 1991, 1993, David Koblas. (koblas@netcom.com) | */
/* | Permission to use, copy, modify, and distribute this software | */
/* | and its documentation for any purpose and without fee is hereby | */
/* | granted, provided that the above copyright notice appear in all | */
/* | copies and that both that copyright notice and this permission | */
/* | notice appear in supporting documentation. This software is | */
/* | provided "as is" without express or implied warranty. | */
/* +-------------------------------------------------------------------+ */


Warranty and Liability
----------------------
I have done my best to provide bug free code, but there is no possible way
for an imperfect human to create the perfect program. Hence, I must say that
I can't possible be held accountable in way, shape or form (especially
financially) for any damage to your system or software which might result
from using this program. But I can give you the unconditional guarantee that
I have done nothing malicious and that I have made every possible effort to
make this the best possible program I can.


Distribution
------------
You may freely redistribute this archive to all your friends at no cost to
them unless you charge them for the media on which they receive it.
The cost may not reasonably exceed the cost of the media on which this
archive resides. You may never distribute this archive in pieces. You must
distribute the archive from which you extracted this file (readme.txt).


* -kevin- *
* sick with the good infection *
* kathey@behold-software.com *
* http://www.behold-software.com *