RUBRIC
------
This is just a little program I hacked up in a few minutes. It takes in 
an EAN code as a command line argument and prints to STDOUT whether it 
is valid or not. It does this by performing a checksum on the supplied 
EAN.

It can also check:

 - UPC codes (12 digits), just preface them with a zero
 - Four digit codes (PLUs) which some supermarkets with older tills
   use on their till systems to ring up products like bread, fruit, veg...
   basically any loose product. Eancheck can validate them, no prefixing
   needed.

If you want to use the eancheck functions in a program, I invite you to
use eancheck.h in your programs. It provides two functions, one to check
check digits and another to generate them for a given EAN.

COMPATIBILITY
-------------
So far I have tested the main program on Windows and Linux, both times with
the G++ compiler. I have only tested the header file on Linux, but I assume
it works on Windows too.

USING EANCHECK.H
----------------
eancheck.h provides two functions you can use.

* int ec_checkean(char inputean[])
  This function takes an input EAN as a character array (string) and returns
  0 if the check digit is correct, 1 if it is incorrect and 3 if invalid
  characters were found in the string.
* int ec_gencd(char inputean[])
  This function takes an EAN without the check digit and returns either the
  check digit (from 0-9) or 10 if an invalid character was found.

LICENSING INFORMATION
---------------------
I don't care what you do with this code, it's a pissy little program. Do what
thou wilt.