Index: trunk/Ohana/src/addstar/include/addstar.h
===================================================================
--- trunk/Ohana/src/addstar/include/addstar.h	(revision 2457)
+++ trunk/Ohana/src/addstar/include/addstar.h	(revision 3339)
@@ -24,4 +24,5 @@
 double DEFAULT_RADIUS, NSIGMA, SNLIMIT;
 double ZeroPt;
+double Latitude, SiderealTime;
 int    VERBOSE;
 int    SKIP_MISSED;
@@ -40,4 +41,6 @@
 char AirmassKeyword[64];
 char CCDNumKeyword[64];
+char STKeyword[64];
+char SubpixDatafile[256];
 
 int CalReference;
@@ -47,11 +50,22 @@
 int ONLY_IMAGES;
 int FORCE_READ;
+int SKYPROBE;
+int ADDREFS;
+int REPLACE;
+int ONLY_MATCH;
 
+time_t TIMEREF;
+
+int main (int argc, char **argv);
 int Shutdown ();  
 void TrapSignal (int sig);
-int main (int argc, char **argv);
 int SetSignals ();
+void help ();
+int args (int argc, char **argv);
+void SetProtect (int mode);
+
 int gcatalog (Catalog *catalog);
-GSCRegion *gregions (Image *image, int *Nregions);
+void gregion_star (Stars *star, GSCRegion *region);
+GSCRegion *gregion_image (Image *image, int *Nregions);
 Image *gimages (FILE *f, Image *image, int *Npimage);
 int edge_check (double *x1, double *y1, double *x2, double *y2);
@@ -59,21 +73,49 @@
 void wimage (FILE *f, int dbstate, Image *image, int Nstars);
 Stars *gstars (char *file, int *NSTARS, Image *image);
+void find_matches_refstars (GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog);
 void find_matches (GSCRegion *region, Stars *stars, int Nstars, Catalog *catalog, Image *image, Image *pimage, int Nimage);
 int in_image (double r, double d, Image *image);
 void wcatalog (Catalog *catalog);
+void ConfigInit (int *argc, char **argv);
+void aregion (GSCRegion *region, FILE *f, double ra, double dec);
+void wimage (FILE *f, int dbstate, Image *image, int Nstars);
+double airmass (double ra, double dec, double st, double latitude);
+void InitCalibration ();
+void SaveCalibration (float M, float dM, float Mr, float dMr, float Mc, float A, int N, float ra, float dec, float x, float y);
+void FindCalibration (Image *image);
+double get_subpix (double x, double y);
+void load_subpix ();
+double scat_subpix (double x, double y);
+void mkcatalog (GSCRegion *region, Catalog *catalog);
+Stars *grefstars (char *file, int *Nstars);
+Stars *find_subset (GSCRegion *region, Stars *stars, int Nstars, int *NSTARS);
+int match_refstars (Stars *stars, int Nstars);
+int parse_time (Header *header);
+
+void check_permissions (char *basefile);
+void make_backup (char *filename);
+void uppercase (char *string);
+
 void sort_lists (float *X, float *Y, int *S, int N);
 void fsort (float *X, int N);
-void ConfigInit (int *argc, char **argv);
+void fsort2 (float *X, float *Y, int N);
+
+char *sec_to_date (time_t second);
+double sec_to_jd (time_t second);
+int chk_time (char *line);
+int dms_to_ddd (double *Value, char *string);
 int hms_to_deg (double *h0, double *h1, double *d0, double *d1, char *string);
-void aregion (GSCRegion *region, FILE *f, double ra, double dec);
-void wimage (FILE *f, int dbstate, Image *image, int Nstars);
-void check_permissions (char *basefile);
-void make_backup (char *filename);
-void InitCalibration ();
-void SaveCalibration (float M, float dM, float Mr, float Mc, float A, int N, float ra, float dec, float x, float y);
-void FindCalibration (Image *image);
-void help ();
-int args (int argc, char **argv);
-int parse_time (Header *header);
-void uppercase (char *string);
-void mkcatalog (GSCRegion *region, Catalog *catalog);
+int str_to_dtime (char *line, double *second);
+int str_to_radec (double *ra, double *dec, char *str1, char *str2);
+int str_to_time (char *line, time_t *second);
+time_t jd_to_sec (double jd);
+time_t date_to_sec (char *date);
+
+/** 
+  there is an inconsistency to be resolved: fixed structures (like Image)
+  need a fixed bit-length time (e_time), but these functions all use the
+  UNIX time_t types, which may be 32 or 64 bits, depending on the machine.
+  This can be resolved by using time_t with these functions, but casting 
+  between e_time and time_t when necessary (ie, cannot return data to an
+  e_time pointer from one of these functions)
+**/
