/* ===========================================================================

  IRIS_SERVER.H    Global variables and functions for IRIS_SERVER 

=============================================================================*/
#ifndef IRIS_SERVER_H
#define IRIS_SERVER_H

#ifdef IRIS_SERVER_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif

EXTERN struct server_site_info      siteinfo_c;
EXTERN struct status_fault_summary  statusFaultSummary_c;

class IrisServer
{
   private :
      void       irisServer();
      SINT4      iClntRecvPID;
      SINT4      iClntRecvReadFD;
      UINT4      iClntRcvPrognum;
      char       sClntRcvHostname[50];
      XtInputId  clntRecvAppInputID;
      UINT2      lConnectionGood;
      char       sServerHostname[50];
      UINT2      lStartingClntRcv;
      void       tokenizePacketizedData(char *value_a, UINT4 ilen_a);
      void       decodeTokenizedData(char* stoks_a[10], char* idata_ptr_a,
                   SINT4 idata_len_a);
      UINT2      requestStartupData(void);
      void       execClntRecv(void);
   public :
      UINT4     iConnectState;
      void      packetizeReceivedData(char *read_buf_a, SINT4 iread_buf_size_a);
      UINT2     checkAlive(void);
      void      connect(void);
      void      disconnect(void);
      UINT2     request(const char* scmd_a, const char* sreply_a,
                     const void* pidata_a, const SINT4 ilen_a );
      UINT2     simpleRequest(char* scmd_a );
      SINT4     getClntRecvPID(void);
      void      getProductList(UINT4 *prod_list_a[], SINT4 *prod_cnt_a);
      
};
EXTERN IrisServer irisServer;

#undef EXTERN
#endif
