/*
 ******************************************************************************
 *  Copyright 1995 DeltaLink bv. All Rights Reserved.
 ******************************************************************************
 *
 * DeltaLink Mailbox Communication Interface
 *
 * File         :   mci_int.h
 *
 * Version      :   3.00
 *
 * Developed by :   Leon Westervoort.
 *
 */
#ifndef _MCI_INT_DEFS_INCLUDED /* { */
#define _MCI_INT_DEFS_INCLUDED 1

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

/*
 * origination of the dataset
 */
#define    MCI_ORG_MAILBOX          0x00
#define    MCI_ORG_TRIGGER          0x01
#define    MCI_ORG_QUERY            0x02

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

extern MCISYSTEM    _Mci_system;                  /* system information of the MCI */

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

extern TAG          *_Mci_R_ds;                    /* array with remote dataset control tags */
extern char          *_Mci_R_station_id;            /* array with remote station id numbers */

extern TAG          *_Mci_L_ds;                    /* array with local dataset control tags */
extern MCIDS        **_Mci_ds;                    /* array with pointers to dataset information */

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

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

#define        Mci_Set_Org( d, v)      ( (d)->origination = (v) )
#define        Mci_Get_Org( d)          ( (d)->origination )

void           Mci_Swap_Hdr            ( MCIDS *);
MCIDS        *Mci_Array_Ds_Srch        ( MCIDS *);

int            Mci_Q_Ds_Tot_Srch        ( MCISYSTEM *, MCIDS *);
int           Mci_Qi_Query            ( MCISYSTEM *, MCIDS *);

/* name2id.c */

int           Mci_name2tag            ( char *, TAG *);

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

#endif /* _MCI_INT_DEFS_INCLUDED */
