# include <signal.h>

struct {
  int Ntimes;         unsigned long *tstart, *tstop;
  int PhotCodeSelect; int photcode;
  int LabelSelect;    char *Label;
} criteria;

struct {
  int delete;
  int modify;

  int HST;
  int verbose;
  int convert;
  char *table;
  char *bintable;
  char *cadctable;

  int equiv;
  int offset;
  char *db;
  int photcodenames;
} output;

enum {UNLOCK, LOCK, IGNORE};

int args (int argc, char **argv);
int regargs (int argc, char **argv, PhotPars *);

void DeleteSubset (FITS_DB *db, PhotPars *photpars, int Nphotpars, int *match, int Nmatch);
int *match_criteria (PhotPars *photpars, int Nphotpars, int *Nmatch);

void OutputSubset (PhotPars *photpars, int Nphotpars, int *match, int Nmatch);

void DumpFitsBintable (char *filename, PhotPars *image, int *match, int Nmatch);
void DumpFitsTable (char *filename, PhotPars *image, int *match, int Nmatch);
int PrintSubset (PhotPars *image, int *match, int Nmatch);

void set_timezone (double dt);
void getImageData (char *Image, char *ImageCCD, char *ImageMode);
int escape (int mode, char *message);

PhotPars *PhotParsOld_to_PhotPars (PhotParsOld *input, int Nphotpars);

