Go ahead an add all of cfitsio to cextern, along with a README intended mainly for system packagers.
A little miscellaneous style cleanup
Remove old cfitsio files from src
Add new cfitsio files from cextern to sources to compile
Remove the _pyfits_ prefix from function names (this will be handled though #defines) and rename a few FITSfile struct members that have a different name in the newer CFITSIO version.  Still lots of stuff broken though.
Clean up handling of the ZSCALE/ZZERO/ZBLANK compressed tile columns. It appears that when this code was first written it's possible that CFITSIO did not fully support them, so modifications were made to add that.  But now it is no longer necessary for us to manually pass in the values for those columns--CFITSIO handles them appropriately already.
Add another source file we need; include fitsio2.h instead of fitsio.h (the former includes the latter, plus some other stuff we need)
Removed the need to copy the compressed data column array and pass that in as an argument to decompressData.  That seems like an obvious move to make...but now it highlights where things become difficult, and where it becomes clear why the CFITSIO routines were modified the way they were:  There's no obvious to just hand the data off to CFITSIO, which wants to work on an entire FITS file either on disk or in memory.  This would still work in some cases, particularly the on-disk issue.  But PyFITS is much more flexible about allowing work on individual HDUs without them being necessarily part of a file.  It's hard to do that with CFITSIO without either unnecessarily copying the data in memory, or otherwise imposing some restrictions on compressed image HDUs.  All that said, I think I may have found a somewhat elegant solution, but I will have to try it to be sure it can work....
Added most of the other .c files in cfitsio to the build for now, so that we can at least build and import the module with CFITSIO compiled into it.  I did however do a little bit of culling, specifically of source files that contain sample programs.  There will be plenty more to cut eventually.
Remove this line too
commented out the currently broken decompresData and compressData functions to start working on the new implementations.
Proof of concept code for the new decompression method mostly working for a specific test file.  There's still a problem with this in that the data array for a table containing variable length fields (as is the case for compression data) does *not* include the heap as part of the Numpy array.  Confusingly, this was still partially working because, since I was using memmap, part of the heap was still being swapped into memory.  But it wasn't the entire heap, so only part of the file was being decompressed properly.  Without memmap the heap isn't read into user memory at all and decompression compeltely fails.  Need to consider reworking how access to the heap is incorporated into this.
a much simplified solution that works for the most common case of having an unchanged compressed file on disk--just pass on the filename to CFITSIO and let it handle everything normally.  Still need to make a few adjustments to this, however, to ensure that the correct HDU is always used.  Still will need to make some deeper changes to PyFITS' handling of VLAs in order to handle the more general case of having some HDU data in memory
WIP: Got decompression of in-memory HDU data working.  There were two things that needed to be fixed: If table data includes a heap, the table recarray is now based off an ndarray created from the string buffer. This way the entire HDU data--both the table columns and the heap--can be found later in the buffer passed to CFITSIO.  Now that this is basically working, started cleaning things up a bit--adding error handling, type checking, and generalizing the code (currently it's just hacked together to work on a specific file)
WIP: Add an argument to the get_header_* functions to control whether or not they can return an error code when the keyword is not found.
WIP: Get rid of a lot of repetitious pointer dereferencing. Start filling in some of the compression configuration code ported from compressed.py
WIP: 1) Fixed some bugs from the last commit related to the Fptr.  2) Yet another different error handling mechanism for the get_header_* functions.  I think this is better--they now return values via pointer, and return an integer error code.  0 means keyword found, 1 means keyword not found; default used.
WIP: Was able to use decompress_hdu fully in place of the old Python code in CompImageHDU.data.  Still need to work on scaling issues.
WIP: Eliminated a few more bits of code from compression_decompress_hdu that was particular to the test image.
Use PyMem_Malloc/Free