/* listfits.c -- program to list FITS headers. Use: listfits < fitsfile > headlist.out or listfits < fitsfile | more This program is a modified version of Barry Schlesinger's program /FITS/software/headlist.c available via anonymous-FTP on host nssdca.gsfc.nasa.gov. Modifications by Don Wells, NRAO-CV, July 91: (1) commented out #include , (2) added function printcard() which truncates trailing blanks and suppresses blank header lines, (3) added test for SIMPLE at beginning of file, (4) added print of XTENSION cards, (5) fixed bug in recognition of END cards (8chars instead of 4), (6) executed indent(1) with default parameters to reformat the text, (7) made the comments more verbose, (8) added print of number of bytes&records skipped, (9) changed type of "c" to int in main() and readunit() so that EOF test works properly, (10) added static totalbytes variable with a remainder analysis printed at EOF. This version of listfits.c has been tested with: (1) GNU gcc compiler on Sun-3 under SunOS_4.0.3, (2) Borland Turbo-C compiler on PC-XT clone under DOS, (3) "cc" compiler on IBM RS/6000 under AIX, (4) Convex "cc" compiler on Convex C-1. In all four cases the default compiler options were sufficient. Bugs/Deficiencies: (1) needs protection against non-printing characters, (2) probably should predict number of data records to be skipped and then check against prediction. */