/*
   queue.h --- queue library definitions.

   (c) Copyright 1995 SHW Wabnitz
   Written by Bernhard Fastenrath (fasten@shw.com)

   This file may be distributed under the terms
   of the GNU General Public License.
*/

#ifndef QUEUE_H
#define QUEUE_H

typedef APTR QHandle;

typedef struct {
  struct MinNode  qm_MinNode;
  USHORT	  qm_Status;
  USHORT	  qm_Refs;
  ULONG		  qm_Replies;
  QHandle         qm_Owner;
} QMessage;

/* modes for QOpen (name, mode) */
#define QMODE_LISTEN 0x1
#define QMODE_SEND   0x2

QHandle QOpen (STRPTR name, ULONG mode, ULONG sigbit);
ULONG QClose (QHandle qh);
void QAddMsg (QHandle qh, QMessage *msg);
void QRemMsg (QHandle qh, QMessage *msg);
QMessage *QGetMsg (QHandle qh);
ULONG QReplyMsg (QHandle qh);
ULONG QFlush (QHandle qh);

#endif /* QUEUE_H */
