Index: trunk/Ohana/src/addstar/include/addstar.h
===================================================================
--- trunk/Ohana/src/addstar/include/addstar.h	(revision 5239)
+++ trunk/Ohana/src/addstar/include/addstar.h	(revision 5270)
@@ -1,3 +1,3 @@
-# include <ohana.h>
+# include "base.h" 
 # include <dvo.h>
 # include <signal.h>
@@ -5,4 +5,10 @@
 # include <time.h>
 # include <zlib.h>
+# include <netinet/ip.h>
+# include <netdb.h>
+# include <arpa/inet.h>
+
+/* this is generated locally from the entries in addstar/def */
+# include "commcode.h"
 
 /* used in find_matches, find_matches_refstars */
@@ -18,36 +24,5 @@
     exit (0); }
 
-# if (0)
-/* this structure is used for loading the data from the FITS smp file */
-typedef struct {
-  float X;
-  float Y;
-  float M;
-  float dM;
-  float Mgal;
-  float Map;
-  float sky;
-  float fx;
-  float fy;
-  float df;
-  char  dophot;
-  char  dummy[3];
-} StarData;
-# endif
-
-typedef struct {
-  double X;
-  double Y;
-  double R;
-  double D;
-  double M, dM;
-  char   dophot;
-  double sky;
-  double fx, fy, df;
-  double Mgal, Map;
-  int found;
-  short int code;
-  e_time t;
-} Stars;
+typedef struct sockaddr_in SockAddress;
 
 enum {M_IMAGE, M_REFLIST, M_REFCAT};
@@ -55,6 +30,4 @@
 /* global variables set in parameter file */
 char   ImageCat[256];
-char   ImageTemplate[256];
-char   CatTemplate[256];
 char   GSCFILE[256];
 char   CATDIR[256];
@@ -65,51 +38,50 @@
 char   GSCDIR[256];
 char   CDROM[256];
+char   DateKeyword[64];
+char   DateMode[64];
+char   UTKeyword[64];
+char   MJDKeyword[64];
+char   JDKeyword[64];
+char   ExptimeKeyword[64];
+char   AirmassKeyword[64];
+char   CCDNumKeyword[64];
+char   STKeyword[64];
+char   SubpixDatafile[256];
 double DEFAULT_RADIUS, NSIGMA, SNLIMIT;
 double ZeroPt;
 double Latitude, SiderealTime;
-int    VERBOSE;
-int    FITS_INPUT;
-int    SKIP_MISSED;
 int    XOVERSCAN, YOVERSCAN;
 int    XMIN, XMAX, YMIN, YMAX;
-int    ACCEPT_ASTROM;
-int    TEXTMODE;
+char   PASSWORD[80];
+char   HOSTNAME[80];
+int    NVALID, *VALID_IP;
 
-PhotCode *thiscode;
-GSCRegion UserPatch;
-Coords *MOSAIC;
+/* globals set by command-line options */
+int   CALIBRATE;
+int   DUMP_MATCHES;
+int   ONLY_IMAGES;
+int   EXISTING_REGIONS;
+int   FORCE_READ;
+int   SKYPROBE;
+int   ADDREFS;
+int   REPLACE;
+int   ONLY_MATCH;
+int   CLOSEST;
+int   VERBOSE;
+int   FITS_INPUT;
+int   SKIP_MISSED;
+int   ACCEPT_ASTROM;
+int   TEXTMODE;
+int   NOSORT;
+int   UPDATE;
+int   MODE;
 
-char DateKeyword[64];
-char DateMode[64];
-char UTKeyword[64];
-char MJDKeyword[64];
-char JDKeyword[64];
-char ExptimeKeyword[64];
-char AirmassKeyword[64];
-char CCDNumKeyword[64];
-char STKeyword[64];
-char SubpixDatafile[256];
-
-int CalReference;
-int CalColor;
-int CALIBRATE;
-int DUMP_MATCHES;
-int ONLY_IMAGES;
-int EXISTING_REGIONS;
-int FORCE_READ;
-int SKYPROBE;
-int ADDREFS;
-int REPLACE;
-int ONLY_MATCH;
-int CLOSEST;
-
-int NOSORT;
-int UPDATE;
-
-int MODE;
 char *DUMP;
 char *SELECT_2MASS_QUALITY;
 
-time_t TIMEREF;
+time_t    TIMEREF;
+PhotCode *thiscode;
+GSCRegion UserPatch;
+Coords   *MOSAIC;
 
 /*** addstar prototypes ***/
@@ -195,4 +167,8 @@
 Missing *sort_missing (Average *average, int Naverage, Missing *missing, int Nmissing, int *next_miss);
 
+int InitServerSocket (char *hostname, SockAddress *Address);
+int WaitServerSocket (int InitSocket, SockAddress *Address, int *validIP, int Nvalid);
+int GetClientSocket (char *hostname);
+
 /** 
   there is an inconsistency to be resolved: fixed structures (like Image)
@@ -204,2 +180,7 @@
 **/
 
+AddstarClientOptions args_client (int argc, char **argv);
+
+int args_server (int argc, char **argv);
+int CheckPassword (int BindSocket);
+int NewImage (int BindSocket);
