MIAMEX 30: Get queue block contents

xcall MIAMEX, MX_GETQUEUE, blkno, qblock

MX_GETQUEUE retrieves the contents of the queue block specified by the numeric parameter blkno, returning it in the unformatted variable qblock. qblock should be mapped as:

MAP1 Q'BLOCK               ! Queue data block

   MAP2 QNEXT,b,2          ! Pointer to next queue block

   MAP2 QTYPE,b,2          ! Queue block type (see table)

   MAP2 QOWNER,b,2         ! Owner of queue block

   MAP2 QJUNK,b,2          ! Currently unused

   MAP2 QDATA,x,32         ! 32 bytes of data

   MAP2 QD'FLOCK,x,@QDATA  ! Format of FLOCK record

      MAP3 ACTION,b,2      ! Action

      MAP3 MODE,b,2        ! Mode

      MAP3 RECORD,b,4      ! Record number

      MAP3 CHANNEL,b,4     ! Channel number [12] was 2

   MAP2 QD'XLOCK,x,@QDATA  ! Format of XLOCK record

      MAP3 LOCK1,i,4       ! Primary lock code

      MAP3 LOCK2,i,4       ! Secondary lock code

      MAP3 LOCK3,b,2       ! Lock class: 0=xlock

 

Queue block zero is a control record of a different layout, which should not be accessed.

Each of the data queue blocks shares the same first four fields, followed by a 32 byte area whose format depends on the block type (qtype):

Value

Queue block type

0

Unused block

3

FLOCK – normal

4

XLOCK

6

FLOCK – inactive

7

ZLOCK (proprietary format)

8

RLOCK (proprietary format)

9

FLOCK – pending

 

The number of queue blocks is set by the QUEUE= statement in the miame.ini file.

To scan through all of the active queue blocks, start at blkno 2 and then proceed to set each new blkno to the qnext field, until it becomes zero.