#ifndef XM_QMESSAGES_H_

/*
 * $Id: qmessages.h,v 1.1 2012/05/21 20:59:54 ntn Exp $
 *
 * Description: Contains common X-Midas system message definitions,
 * declared structures of their types, and the bit values used by
 * MSGMASK
 *
 * Author:   Copy of qmessages.h from XM4.10
 * Modified: DR 503943 13-Sep-2004 bdil24, removed VMS conditional.
 */

#include <qmessdecl.h>
#include "msgmask.h"

#ifdef __cplusplus
// People often pass an MQ_DATA struct as a buffer to get/send the
// data associated with messages defined in qmessdef.h.  For
// convenience, make C++ signatures that accept this struct directly
// filling in the length of the buffer if needed.

extern "C" {

  int_4 m$get_msg_ (MQ_HEADER&, void*, const int_4&,
		    const real_4&, const int_4&);
  void m$send_msg_ (MQ_HEADER&, const void*,
		    const int_4&, const int_4&);
}

inline int m_get_msg (MQ_HEADER& mqh, MQ_DATA& mqd, real_4 wait, int_4 mask)
{ return m$get_msg_(mqh, &mqd, L_mqd, wait, mask); }

inline void m_send_msg (MQ_HEADER& mqh, const MQ_DATA& mqd,
			int_4 reader, int_4 mask)
{ m$send_msg_(mqh, &mqd, reader, mask); }

#endif /* __cplusplus */

#define XM_QMESSAGES_H_
#endif /* XM_QMESSAGES_H_ */
