Removed useless variable
Replaced magic number with CTF_ constant
Header offset sanity check
Moved the lookup_type function back to read.c
Reworked the file public API