/* **********************************************************************
 * *                                                                    *
 * *  OUTPUT process function prototypes                                *
 * *                                                                    *
 * **********************************************************************
 * File: iris/output/output_h.h
 *
 *   COPYRIGHT (c) 1993, 1995, 1996, 1997, 1998, 1999, 2001, 2002  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 OUT_LIB_ALLOCATE
#define EXTERN
#ifndef SIGMET_PROJECTION_H
error "Allocation must include projection.h" ;
#endif
#else
#define EXTERN extern
#endif


#ifdef SIGMET_SETUP_H
struct out_net_info
{
  struct network_device Network;

  /* The following is used only for TCPIP connections */
  SINT4 socket;

  /* For pipe file format: Pathname to pipe executable (NULL terminated) */
  char sPipePath[PATHNAME_SIZE];

  /* For script based file copying: Pathname to executable script(NULL terminated) */
  char sCopyScriptPath[PATHNAME_SIZE];

  /* Pathname used by nordrad */
  char sNorUnpackedPath[PATHNAME_SIZE];

  /* Pathname to the temporary directory: NULL terminated */
  char stemp_directory[DIRECTORY_SIZE];

  char ipad_end[2];
};
#endif  /* #ifdef SIGMET_SETUP_H */


/* Variables holding information about the shared memory containing the image data */
#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_PROJECTION_H
EXTERN volatile struct output_to_window_info8 *pshared_control_c;
#endif  /* #ifdef SIGMET_PROJECTION_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */
EXTERN volatile UINT1 *pshared_data_c;
EXTERN UINT4 ishared_size_c;     /* Size of just data portion */
EXTERN SINT4 ishared_total_size_c, ishared_channel_c;
/* Write pipe used to communicate with the window process */
EXTERN int iwrite_pipe_c;

/* Common storage */
/* Storage for pointer to legend definitions. */

EXTERN struct out_legend_def *pout_legend_c;

/* Holds the pointer to the NORDRAD area definition structure, if any */
#ifdef SIGMET_NRD_API_H
EXTERN struct nor_convert_header nor_convert_c;
#endif  /* #ifdef SIGMET_NRD_API_H */

EXTERN SINT4 idevice_c;            /* Device number, origin 1 */
#ifdef SIGMET_SETUP_H
EXTERN struct out_net_info network_c;
#endif  /* #ifdef SIGMET_SETUP_H */
EXTERN UINT2 link_broken_c;        /* Flag to indicate device went down */

/* Stores the pointer to the main in-use file.  Needed for clean exit
 * handling.
 */
#ifdef SIGMET_PRODUCT_H
EXTERN volatile struct one_product_file *pinuse_file_c;
#endif  /* #ifdef SIGMET_PRODUCT_H */


/* Function prototypes of routines in the output directory. */

#ifdef SIGMET_SETUP_H
MESSAGE inetwork_init                       /* File: out_net_tcpip.C */
  (const volatile struct device_def *pdevicedef_a );
#endif  /* #ifdef SIGMET_SETUP_H */

MESSAGE inord_copy                          /* File: inord_copy.C */
  (char *sdest_path_a,
   char *source_path_a,
   UINT2 lcompress_a );

#ifdef SIGMET_PRODUCT_H
MESSAGE isend_to_display                    /* File: isend_to_display.C */
(volatile const struct one_product_file *desc_a,
 UINT2 (*lstop_e)(void) );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_PRODUCT_H
MESSAGE isend_to_network                    /* File: isend_to_network.C */
  (volatile struct one_product_file *desc_a,
   UINT2 (*lstop_e)(void) );
#endif  /* #ifdef SIGMET_PRODUCT_H */

#ifdef SIGMET_SETUP_H
MESSAGE iwindow_init                        /* File: window_subs.C */
(volatile const struct device_def *devicedef_a,
 volatile UINT4 *pCommand_a );       /* Command location to check for shutdown */
#endif  /* #ifdef SIGMET_SETUP_H */

UINT4 iWindowTimeSinceWrite( void );        /* File: window_subs.C */

#ifdef SIGMET_PRODUCT_H
#ifdef SIGMET_PROJECTION_H
MESSAGE LoadAndProcessHeader                /* File: isend_to_display.C */
(volatile const struct one_product_file *desc_a,  /* Entry for file to load */
 struct on_screen_picture8 *pOnScreen_a );      /* Filled in */
#endif  /* #ifdef SIGMET_PROJECTION_H */
#endif  /* #ifdef SIGMET_PRODUCT_H */

MESSAGE network_notify_nordrad              /* File: inord_copy.C */
  (char *sdest_path_a);

MESSAGE network_notify_tcpip                /* File: out_net_tcpip.C */
  (struct out_net_info *network_a,
   const char *sfile_a
   );

void network_pwrdown                        /* File: out_net_tcpip.C */
  ( struct out_net_info *network_a );

void output_state( void );                  /* File: output_state.C */

void outwaitef                              /* File: output.C */
  ( SINT4 idevice_a );

void wait_ack_event                         /* File: window_subs.C */
( UINT2 (*lstop_e)(void) )   /* Function to check for stopping */;

void window_exit_event                      /* File: window_subs.C */
( void );

void window_exit_init( void );              /* File: window_subs.C */

void window_pwrdown                         /* File: window_subs.C */
  ( void );

#ifdef SIGMET_VTV_LIB_H
#ifdef SIGMET_PROJECTION_H
void window_write_image                     /* File: window_subs.C */
(VTV ivtv_a, 
 const struct on_screen_picture8 *pOnScreen_a );
#endif  /* #ifdef SIGMET_PROJECTION_H */
#endif  /* #ifdef SIGMET_VTV_LIB_H */

void WindowWriteNop( void );                /* File: window_subs.C */

#undef EXTERN


