next up previous contents Back To Software Index
Next: Disk FilesMemory-Resident Up: Basic CFITSIO Conventions Previous: Basic CFITSIO Conventions

CFITSIO definitions

Any program that uses the CFITSIO interface must include the fitsio.h header file with the statement

  #include "fitsio.h"
This file contains the prototypes for all the CFITSIO user interface routines as well as various symbolic names or constants used in the interface. It also defines a C structure named `fitsfile' that is used by CFITSIO to store the relevant parameters that define the format of a particular FITS file. Application programs must define a pointer to this structure for each FITS file that is to be opened with a declaration at the beginning of the program similar to:

  fitsfile *fptr;
This structure is initialized (i.e., memory is allocated for the structure) when the FITS file is first opened or created with the fits_open_file or fits_create_file routines. This fitsfile pointer is then passed as the first argument to every other CFITSIO routine that operates on the FITS file. Application programs must not directly read or write information in this fitsfile structure because the definition of the structure may change in future versions of CFITSIO. The cookbook.c program that is included with the CFITSIO library contains example programs illustrating this usage.