/* **********************************************************************
 * *                                                                    *
 * *              IRIS Server Private Headers                           *
 * *                                                                    *
 * **********************************************************************
 * File: iris/server/server.h
 *
 *                        COPYRIGHT (c) 2004  BY
 *          SIGMET INCORPORATED, WESTFORD MASSACHUSETTS, U.S.A.
 * 
 * THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED AND  COPIED
 * ONLY  IN  ACCORDANCE WITH  THE  TERMS  OF  SUCH  LICENSE  AND WITH THE
 * INCLUSION OF THE ABOVE COPYRIGHT NOTICE.  THIS SOFTWARE  OR  ANY OTHER
 * COPIES  THEREOF MAY NOT BE PROVIDED OR OTHERWISE MADE AVAILABLE TO ANY
 * OTHER PERSON.  NO TITLE TO AND OWNERSHIP OF  THE  SOFTWARE  IS  HEREBY
 * TRANSFERED.
 */

#ifdef SERVER_ALLOCATE
#define EXTERN
#else
#define EXTERN extern
#endif

/* Size of the buffer available for data transfer.  This size is somewhat determined
 * by X constraints, and is determined at run time
 */
EXTERN char  siris_menu_c[PATHNAME_SIZE];	/* IRIS_MENU translation */
EXTERN UINT2 ldebug_log_c ;	/* Put debugging messages into the log file */
#ifdef SIGMET_VTV_LIB_H
EXTERN struct vtv_font_list ServerFonts_c;
#endif  /* #ifdef SIGMET_VTV_LIB_H */
#ifdef SIGMET_DSP_LIB_H
EXTERN Dsp *pDsp_c;
#endif  /* #ifdef SIGMET_DSP_LIB_H */

union ams_data
{
  struct mode_switching_entry Setentry;
  SINT4                       Time;
};

struct msg_data
{
  SINT4 iIndex;
};

#ifdef SIGMET_INGEST_H
union ism_data
{
  struct serv_ingest_header_summary Summary;
  struct server_filter              Filter;
};
#endif  /* #ifdef SIGMET_INGEST_H */

#ifdef SIGMET_PRODUCT_H
union pcf_data
{
  struct serv_product_configuration SPcf;
  struct product_configuration      Pcf;
};
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_SETUP_H
union pom_data
{
  struct ServProductLoad       Load;
  struct server_filter         Filter;
  struct server_output_options Options;
  struct vvp_specific_options  VvpOptions;
  struct wind_specific_options WindOptions;
  struct warn_specific_options WarnOptions;
  struct server_pom_scale_def  Scale;
  struct ForecastOptions       Forecast;
  struct overlay_mask_dir      Overlay;
  struct SlideShowList         SlideList;
  SINT4                        iDevice;
  UINT4                        iTypes[1];
};
#endif  /* #ifdef SIGMET_SETUP_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
union psc_data
{
  SPSC_SUM             Summary;
  struct server_filter Filter;
  UINT4                iSite;
};
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_OUTPUT_H
union tap_data
{
  struct server_filter       Filter;
  struct server_tape_product Summary;
};
#endif  /* #ifdef SIGMET_OUTPUT_H */

#ifdef SIGMET_PRODUCT_H
union win_track_data
{
  struct product_hdr PHdr;
};
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
union win_data
{
  struct ServProductLoad Load;
  struct device_update   Update;
  struct home_point      Home;
  char                   String[1];
  union win_track_data   Track;
};
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_INGEST_H
#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_OUTPUT_H
#ifdef SIGMET_SETUP_H
union generic_data
{
  union  ams_data Ams;
  union  ism_data Ism;
  struct msg_data Msg;
  struct server_overlay_set Ovr;
  union  pcf_data Pcf;
  union  pom_data Pom;
  struct projection_configuration Prj;
  union  psc_data Psc;
  union  tap_data Tap;
  union  win_data Win;
  struct task_config_summary Tcf;
  SINT1          Sint1;
  SINT4          iSint4;
};
#endif  /* #ifdef SIGMET_SETUP_H */
#endif  /* #ifdef SIGMET_OUTPUT_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */
#endif  /* #ifdef SIGMET_INGEST_H */
/* ------------- Funtion prototypes ------------- */

UINT4 iproduct_schedule_status  /* In serv_psc.c */
 (UINT4 iptype_a,
  const char *spcf_name_a    /* Null terminated */
  );

void process_ams_command  /* In serv_ams.c */
  (UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   const union ams_data* pdata_a,
   SINT4 isize_a,
   void* sbuf_a
   );

void process_dbg_command  /* In serv_dbg.c */
  (UINT4 iclient_a,
   char* sargs_a[10],
   const char* sreply_a,
   const void* pdata_a,
   SINT4 isize_a,
   void* sbuf_a
   );

#ifdef SIGMET_INGEST_H
void process_ism_command  /* In serv_ism.c */
  (const UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   union ism_data* pdata_a,
   SINT4 isize_a,
   void* sbuf_a
   );
#endif  /* #ifdef SIGMET_INGEST_H */

void process_msg_command  /* In serv_msg.c */
  (const UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   const struct msg_data* pdata_a,
   SINT4 isize_a,
   void* sbuf_a
   );

void process_nst_command  /* In serv_nst.c */
  (UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   void* pdata_a,
   SINT4 isize_a,
   void* sbuf_a
   );

void process_ovr_command  /* In serv_ovr.c */
  (UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   struct server_overlay_set* pdata_a,
   SINT4 isize_a,
   void* sbuf_a
   );

#ifdef SIGMET_PRODUCT_H
void process_pcf_command  /* In serv_pcf.c */
  (const UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   union pcf_data *pdata_a,
   SINT4 isize_a,
   void* sbuf_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void process_pom_command  /* In serv_pom.c */
  (UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   union pom_data* pdata_a,
   SINT4 isize_a,
   void* sbuf_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void process_prj_command  /* In serv_prj.c */
  (const UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   const struct projection_configuration* pdata_a,  /* Pointer to incoming data */
   SINT4 isize_a,        /* Size of incoming data */
   void* sbuf_a );        /* buffer for outgoing data */
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void process_psc_command  /* In serv_psc.c */
  (const UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   union psc_data* pdata_a,
   SINT4 isize_a,
   void* sbuf_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

void process_rss_command  /* In serv_rss.c */
  (UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   const void* pdata_a,
   SINT4 isize_a,
   void* sbuf_a );

void process_rst_command  /* In serv_rst.c */
  (const UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   void* pdata_a,
   SINT4 isize_a,
   void* sbuf_a );

void process_site_command /* In serv_exec.c */
  (const UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   void* pdata_a,
   SINT4 isize_a,
   void* sbuf_a
   );
 
#ifdef SIGMET_OUTPUT_H
void process_tap_command  /* In serv_tap.c */
  (const UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   union tap_data* pdata_a,
   SINT4 isize_a,
   void* sbuf_a );
#endif  /* #ifdef SIGMET_OUTPUT_H */

void process_tcf_command  /* In serv_task.c */
  (const UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   void* pdata_a,
   SINT4 isize_a,
   void* sbuf_a );

void process_tsc_command /* In serv_tsc.c */
  (UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   struct task_config_summary* pdata_a,
   SINT4 isize_a,
   void* sbuf_a );

#ifdef SIGMET_PRODUCT_H
void process_win_command  /* In serv_win.c */
  (UINT4 iclient_a,
   char* sargs_a[10],
   char* sreply_a,
   union win_data* pdata_a,
   SINT4 isize_a,
   void* sbuf_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

void convertPSItoSPSI   /* In serv_pcf.c */
  (int iptype,
   volatile const PSI *entryPSI,
   volatile SPSI *entrySPSI);

volatile struct task_configuration* find_task     /* In serv_tsc.c */
  (const char* sname );

#ifdef SIGMET_PRODUCT_H
UINT2 lnst_product_filter
  (volatile const struct one_product_file *pfile_a,
   UINT4 *ilast_site_a );         /*Site number of last product found, Filled in*/
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
void pom_fill_list
  (volatile struct serv_product_header_summary *psum_a,
   volatile struct one_product_file *pfile_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

void request_to_client                   /* In server.c */
  (const UINT4, 
   const char*,
   const char*,
   const void*,
   const SINT4 );

#ifdef SIGMET_PRODUCT_H
void serv_bigif                          /* In serv_exec */
  (const UINT4 iclient_a,  /* Client connection number */
   const char* scmd_a,
   const char* ireply_a,
   union generic_data* pdata_a,
   const SINT4 isize_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

void simple_request_to_client            /* In server.c */
  ( const UINT4, const char* );                   

#ifdef SIGMET_PRODUCT_H
const char* spsi_text                    /* In serv_psm.c */
  (volatile const struct one_product_file *pfile_a );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_TASK_H
void summary_to_tcf                      /* In serv_tsc.c */
  (struct task_config_summary* tcfsuma_a,
   volatile struct task_configuration* tcf_a
   );

void tcf_to_summary                      /* In serv_tsc.c */
  (struct task_config_summary *tcfsuma_a,
   volatile struct task_configuration* tcf_a );
#endif  /* #ifdef SIGMET_TASK_H */

#undef EXTERN
