CFITSIO uses a C structure (as defined in fitsio.h) to store all the relevant parameters about the format of an opened FITS file. Application programs must first declare a pointer to this structure (which is named 'fitsfile') for each FITS file that is opened. The value of the pointer is defined by the call to open or create the FITS file and then the pointer must be passed as the first argument to all the other CFITSIO routines that read or write the FITS file. The memory that is allocated for the fitsfile structure is freed when the FITS file is closed. 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.
int fits_open_file / ffopen (fitsfile **fptr, const char *filename, int iomode, > int *status)
int fits_create_file / ffinit (fitsfile **fptr, const char *filename, > int *status)
int fits_close_file / ffclos (fitsfile *fptr, > int *status)
int fits_movabs_hdu / ffmahd (fitsfile *fptr, int hdunum, > int *hdutype, int *status)
int fits_create_img / ffcrim ( fitsfile *fptr, int bitpix, int naxis, long *naxes, > int *status)
int fits_create_tbl / ffcrtb (fitsfile *fptr, int tbltype, long naxis2, int tfields, char **ttype, char **tform, char **tunit, char *extname, int *status)