/--------------------------------------------------------------\
| tcharge - telephone / modem charge watch for X window system |
\--------------------------------------------------------------/

The charges that a modem produces are of course highly dependent on
your telephone company (TC). Prices are changing quite fast, so please
check if the computed charges are correct (see "Testing tcharge"
below). For a few charge files i wouldn't guarantee for nothing since
they are old and supposed to be incomplete. At least you should know
the date of the charge information (try 'tcharge -version' after
install).

It's very easy to modify or even to create a new charge file since
these are highly human readable (in contrast to some program code...).

Requirements:
=============
- The X11 libraries
- gcc (never tried something else)
- if you want to compile (new) charge files you need perl

Installing 'tcharge'
======================
0. If you are german, you don't necessarily have to compile tcharge
   since a binary is included. -- But this is not recommended! The
   included binary is compiled with debugging output enabled. Build a
   smaller and faster version for your daily use!

1. edit 'Makefile':
  - Edit the variables PREFIX (installation path...) and XLIB_DIR if
    needed.
  - Choose the CFLAGS (the one without '-DDEBUG' makes 'tcharge'
    much smaller and more quiet...). Include the flag
    '-DPRINT_CHARGE_STRUCTURE'!
  - If you mistrust tcharge: As long as you do so, include the
    '-DDEBUG' flag in CFLAGS (gives more report on what basis the
    charge is computed).

2. 'make'
  - A list of all countries for that 'tcharge' provides support is
    printed.
  - Let's assume your home country is in the list and has the name
    'my_country'...
  - Read the file `Doc/my_country.README', if it exists.
  - If `my_country' does not exist read README.TC

3. 'make my_country'
  - This will link ./National/my_country.h to ./charge.h, makes
    tcharge and the man page for it.
  - If there were errors, find out if you actually have the X11 libraries
  - If there were no errors start 'tcharge'
  - look at the man page (for example with 'man -l tcharge.1'

4. (after testing, see below): Install
  - 'make clean'
  - Chooes the CFLAGS without '-DDEBUG'
  - 'make all; make install' (this will also install the source files
    of tcharge in SRCDIR=$(PREFIX)/src/tcharge)

5. if you want to use the utilities in Tools/
  - read the file Tools/0README

Tcharge should now be properly installed. Read the next section for
useful tests of tcharge.


Testing 'tcharge' and it's modules
===================================
There are some possibilities to test if tcharge (and especially the
charge definitions) are correct. Here is a list of tests in order of
their simplicity.

for everyone:
- - - - - - -
0. 'tcharge -version'
  - tells you the date of the last change of the charge file you are
    using. It is very likely that the charge file would not mind an
    update if it is e.g. one year old...

for the interested:
- - - - - - - - - -
1. 'tcharge -help-charge'
  - tcharge will print a nice table of the charge structure as given in
    the header file './National/my_country.h' and prints some of the
    defined variables.
  - Check carefully if the result is correct. If not, try to
    find the problem in the charge file; read README.TC; if you can't
    figure out what the problem is, contact the author.

for the advanced:
- - - - - - - - -
2. Regularly start tcharge (without option '-watch-file') using the
  option `-start' and `-end':
  - You should have compiled tcharge with -DDEBUG flag.
  - Give the start- and the end-time of a call.
  - Translate this times into "seconds since 1/1/1970" using the
    included utility "Tools/date2seconds" and let tcharge compute the
    charge for this call. Example:
       tcharge -start 890608400 -end 890908400 -file tcharge.out
  - Tcharge will compute the charge for a call starting on Apr/12/1998
    0:00 and ending on Apr/18/1998 23:59 -- one week!
  - On entering a new band (`timezone') 'tcharge' prints a message
    like this:
    >(DEBUG) Sun, 5:00: Entered 'timezone'[0] (starting at 0:00).
    >        Duration of one unit in zone[0] (price: 0.121 DM) is 240.0 sec.
    >        Current value of units is 75.0 (start of|in|end of band?).
    >        Next 'timezone': no. [1], starting at 5:00.
  - In the file `tcharge.out' you will find something like this:
    >04/18/1998 Connection [Sun, 00:00:00] -> [Sat, 23:59:59]
    >04/18/1998   duration: 167:59:59, units: 4392, charge: 531.43 DM

  - If you like: check all the output (perhaps also by computing the
    charges for yourself with a pocket calculator...)
