/*
 ******************************************************************************
 *  Copyright 1997 DeltaLink bv. All Rights Reserved.
 ******************************************************************************
 *
 * DeltaLink Intertask Mailbox Communication IMX
 *
 * File         :   imx_int.h
 *
 * Version      :   1.00
 *
 * Developed by :   Leon Westervoort.
 *
 */
#ifndef _IMX_INT_DEFS_INCLUDED /* { */
#define _IMX_INT_DEFS_INCLUDED 1

#ifndef HPUX
//#pragma pack(1)
#else
#pragma HP_ALIGN HPUX_WORD PUSH
#endif

/*
 * origination of the dataset
 */
#define    IMX_ORG_MAILBOX          0x00
#define    IMX_ORG_TRIGGER          0x01
#define    IMX_ORG_QUERY            0x02

/*
 * global variable for internal use of the IMX library
 */

extern IMXSYSTEM    _Imx_system;                  /* system information of the IMX */

extern uint          _Imx_num_ds;                  /* total number of registered datasets */

extern TAG          *_Imx_R_ds;                    /* array with remote dataset control tags */
extern char          *_Imx_R_station_id;            /* array with remote station id numbers */

extern TAG          *_Imx_L_ds;                    /* array with local dataset control tags */
extern IMXDS        **_Imx_ds;                    /* array with pointers to dataset information */

extern int          ( **_Imx_fnc)( void *, VAL);  /* array with function pointers to event functions */

/* 
 * functions for internal use of the IMX
 */
#define        Imx_Get_Msg_Len( d)      ( (d)->msg.mbx.mm_msg.m_len )

#define        Imx_Set_Org( d, v)      ( (d)->origination = (v) )
#define        Imx_Get_Org( d)          ( (d)->origination )

void           Imx_Swap_Hdr            ( IMXDS *);
IMXDS         *Imx_Array_Ds_Srch        ( IMXDS *);

int            Imx_Q_Ds_Tot_Srch       ( IMXSYSTEM *, IMXDS *);
int            Imx_Qi_Query            ( IMXSYSTEM *, IMXDS *);

/* name2id.c */

int           Imx_name2tag            ( char *, TAG *);

#ifndef HPUX
//#pragma pack()
#else
#pragma HP_ALIGN POP
#endif

#endif /* _IMX_INT_DEFS_INCLUDED */
