#ifndef _MESSAGEDEFS_H_
#define _MESSAGEDEFS_H_

/*-=-=-=-=-=-=-=-=-=-=-=- RCCL/RCI Notice of Copyright -=-=-=-=-=-=-=-=-=-=-*
 *									    *
 *	Copyright (C) 1991 by John E. Lloyd.				    *
 *									    *
 *	Information on copyright permissions, as well as a complete	    *
 *	disclaimer of warranty, is given in the file COPYRIGHT.		    *
 *									    *
 *-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=*/
/*---------------------------------------------------------------------------
 *
 * DESCRIPTION:	Private definitions used by the RCI message passing
 *		primitives.
 * 
 * AUTHOR/DATE:	John Lloyd, Fall 1987
 *
 * MODIFICATION HISTORY:
 *
 *--------------------------------------------------------------------------*/

#include "../h/mutex.h"
#include "../h/rciTask.h"
#include "../h/rciMessage.h"

#define NOTICE_BUF_SIZE		MAX_OUTSTANDING_MSGS+1
#define MAX_NOTICE_PACKETS NOTICE_BUF_SIZE*MAX_RCI_TASKS

typedef struct _MSG_NOTICE {
	int offset;
	short int size;
	char senderID;
} MSG_NOTICE;

typedef struct _NOTICE_BUF {
	MUTEX mutex;
	short int first;
	short int last;
	MSG_NOTICE buf[NOTICE_BUF_SIZE];
} NOTICE_BUF;

typedef struct _NOTICE_PACKET {
	struct _NOTICE_PACKET *next;
	struct _NOTICE_PACKET *prev;
	MSG_NOTICE n;
} NOTICE_PACKET;

typedef struct _MSG_ROOT {
	NOTICE_BUF *recv;
	NOTICE_BUF *free;
	NOTICE_PACKET *msgs;
	int outstanding;
} MSG_ROOT;

#endif
