#ifndef STREAKS_IO_H
#define STREAKS_IO_H 1

streakFiles *openFiles(pmConfig *config, bool remove);

sFile *sFileOpen(pmConfig *config, ippStage stage, psString fileSelect,
    psString outputFilename, bool required);

void sFileFree(sFile *);

void closeImages(streakFiles *sfiles);
void closeImage(sFile *sfile);

void readImage(sFile *sfile, int extnum, ippStage stage);
void copyPHU(streakFiles *sfiles, bool remove);
void copyTable(sFile *out, sFile *in, int extnum);
void copyFitsOptions(sFile *out, sFile *rec, sFile *in);
void setupImageRefs(sFile *out, sFile *recoveryOut, sFile *in, int extnum, bool exciseAll);

void writeImage(sFile *sfile, psString extname, int extnum);
void writeImageCube(sFile *sfile, psArray *imagecube, psString extname, int extnum);
bool replicate(sFile *sfile, void *xattr);
void readImageFrom_pmFile(streakFiles *sf);

bool streakFilesNextExtension(streakFiles *sf);

#endif // STREAKS_IO_H
