-- XQueue.mesa
-- Created by Jeff Weinstein on 30-Apr-87 23:07:20

XQueue: DEFINITIONS = 
  BEGIN
  
  --Types
  Data:TYPE = LONG POINTER TO UNSPECIFIED;
  QueuePtr:TYPE = LONG POINTER TO Queue;
  Queue:TYPE = RECORD[
                 count:CARDINAL ← 0,
		 head:RecPtr ← NIL,
		 tail:RecPtr ← NIL
		 ];
  RecPtr:TYPE = LONG POINTER TO Rec;
  Rec:TYPE = RECORD[
                    data:Data ← NIL,
		    size:LONG CARDINAL ← 0,
                    next:RecPtr ← NIL,
		    prev:RecPtr ← NIL
		    ];
		    
  --Procedures
  NewQueue:PROCEDURE RETURNS[q:QueuePtr];
  FreeQueue:PROCEDURE [qPtr:LONG POINTER TO QueuePtr];
  
  EnQueue:PROCEDURE [q:QueuePtr, data:Data, size:LONG CARDINAL ← 0];
  DeQueue:PROCEDURE [q:QueuePtr] RETURNS [data:Data, size:LONG CARDINAL];
  
  QueueCount:PROCEDURE[q:QueuePtr] RETURNS [count:CARDINAL];
  END...