Don't include private function prototypes in the header file

This moves the private function prototypes from the header file
to the .c file, and marks all of them static so they aren't part
of the libraries API.

As the regression suite tests the private APIs (for unit tests),
have it include the .c file instead of the header.
Always fflush before ftruncate

ftruncate operates on the file descriptor, not the FILE pointer,
so it's possible that output in buffers may not be accounted for.
Handle APE tags in very large files

This makes the ApeTag offset member an off_t instead of a long.
First, it can never be negative, and second, for very large files,
it could be greater than 4GB.  Switch from ftell to ftello so
that large files are handled correctly.
Fix make clean task

First, clean up older versions of the shared library.  Second,
don't complain if the files to be cleaned do not exist.
Switch from bcopy/bzero to memcpy/memset

I like the bcopy/bzero API better, but it may not be as portable.
Allow overriding of maximum tag size and item count

Instead of using a constant, use a static variable, and add
functions for changing that variable.

While here, move the minimum sizes out of the public header,
since they are only needed internally.
Remove ApeItem_CP typedef

This was only used in a couple of places, and not helpful enough
to warrant a separate typedef.
Switch from u_int32_t to uint32_t

The former is BSD style, while the latter should be more portable.
Move some macros from the header to the .c file

These shouldn't be used externally.
Make ApeTag_remove_field take a const char*

The function doesn't modify the pointer, so it should be const.
While here, do the same for the ApeTag__strcasecpy internal
function.
Major refactoring of the library

This makes ApeTag an opaque type.  The ApeTag struct has been
renamed to sApeTag and moved into the .c file, and now ApeTag
is a pointer to it.  So all users need to switch from using
ApeTag* to ApeTag.

Since ApeTag is now an opaque type, some accessors have been
added for getting information out of it:

ApeTag_get_field: Get single field by key
ApeTag_get_fields: Get all fields in an array
ApeTag_size: Get total size of tag
ApeTag_item_count: Get number of items in the tag
ApeTag_error: Get message related to last error

Other than ApeTag_error, the methods generally should be
called after ApeTag_parse fills in the necessary data.

Callers of ApeTag_get_fields are responsible for freeing the
updated pointer.

While refactoring, reduce duplication in the internals using
a couple of new macros.  Switch to using memset in ApeTag_new
since it should perform better and results in cleaner code.
Switch ApeTag__lookup_genre to take an ApeItem* instead of a
DBT*.

Also, fix the default ID3 genre id used if a genre is present
but it does not match an existing ID3 genre.
Switch from bcmp to memcmp

Also, switch from bzero/bcopy to memset/memcpy in the test suite.
Minor thread-safety fix when loading ID3 genres

Use a local variable instead of the global variable, so if there
is a thread-safety issue, the worst case scenario is minor memory
leakage.

While here, add/update some comments.
Make ApeTag_get_fields and ApeTag_raw take pointer to size

Whenever allocating memory automatically, the size allocated
should be set so the user doesn't have to call a separate
function to determine it.

For ApeTag_raw, the man page recommends using a macro that is
now private to get the size, so in that case there was no
longer a good way to get the size.

Also, for both of these functions, change the handling to
set the pointed to values to NULL and 0 first, and only for
sucessful completion set the actual pointer and size values.

While here, add a check for there being fewer items in the
database that num_fields, so that a partially filed array
won't be returned in that case, since that could easily lead
to crashes later.
Add ApeTag_file_item_count, for the on-disk count

ApeTag_item_count returns the number of items in the database,
not the number of items on-disk, which can be different if the
tag hasn't been parsed yet (used if you want to replace a tag
without reading existing item values).
Consistently associate pointer with value instead of type

Before, a mix of styles was used, but it's better to be
consistent.
Update the man page for recent changes
Update copyright year in the LICENSE
Update path to source control repository in README
Do not do basic parsing of tag in ApeTag_clear_fields

None of the parsed information is used, and it could result in
other types of errors.  Since ApeTag_free calls
ApeTag_clear_fields but has no ways of returning an error, it's
best to reduce the types of errors it can hit.