/* ****************************************************************
 * *                                                              *
 * * Header file for the Link driver                              *
 * *                                                              *
 * ****************************************************************
 * File: libs/include/link_lib.h
 *
 *          COPYRIGHT (c) 1994, 1995, 1996, 1998, 1999, 2003 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.
 */
#ifndef SIGMET_LINK_LIB_H
#define SIGMET_LINK_LIB_H 1

#ifdef __cplusplus
extern "C" {
#endif

/* Possible error values: 
 */
#define      BAD_LINKTYPE  1
#define LINK_BAD_LINKTYPE (LINK_FACILITY + BAD_LINKTYPE)
#define      LINKOPEN      2
#define LINK_LINKOPEN     (LINK_FACILITY + LINKOPEN)

#ifndef MESSAGE_ONLY

/* These are the Hong Kong Link Format picture types */
#define HK_PICT_PPI       (1)
#define HK_PICT_CAP64R3   (2)
#define HK_PICT_CAP64V    (3)
#define HK_PICT_CAP64R2   (4)
#define HK_PICT_CAP128R3  (5)
#define HK_PICT_CAP128V   (6)
#define HK_PICT_CAP128R2  (7)
#define HK_PICT_CAP250R   (8)
#define HK_PICT_CAP250V   (9)
#define HK_PICT_DEFAULT   (10)

/* Function prototypes for the library routines */

void link_close
  ( void );

MESSAGE link_open
  (volatile const char *sDevice_a,
   UINT4 iFormat_a,
   SINT4 iwidth_a,
   SINT4 iheight_a,
   SINT4 iSerialUnit_a  /* Unit number for serial line, zero for file */
   );

MESSAGE link_open_file_hkro
  (const char* spath_a,
   SINT4 iwidth_a,
   SINT4 iheight_a
   );

void link_send_header
  (SINT4 istation_a,
   UINT4 ipicture_type_a,
   SINT4 iheight_a,              /* Height of cappi, zero otherwise */
   const struct ymds_time *time,
   SINT4 itime_diff_a            /* Time difference to GMT from system time */
   );

void link_sendline
  (UINT1 *in_data_a,
   SINT4 iline_a,
   const UINT1 imap_a[256]
   );

#endif /* #ifndef MESSAGE_ONLY */

#ifdef __cplusplus
}
#endif
#endif /* #ifndef SIGMET_LINK_LIB_H */
