PICTools Programmer's Reference
QUEUE

A data structure specifying a circular queue.  A Pegasus operation has an input or Get, queue and an output, or Put, queue. See the Queue Management section in the PICTools and AIMTools Programmer's Guide for additional information about using this structure with an ordinary linear buffer.  See also Appendix 1 in this document for a description of how to use the input and output buffers as circular queues.

 
Copy Code
typedef struct {
   BYTE PICHUGE*          FrontEnd;
   BYTE PICHUGE*          Start;
   BYTE PICHUGE*          Front;
   BYTE PICHUGE*          Rear;
   BYTE PICHUGE*          End;
   BYTE PICHUGE*          RearEnd;
   DWORD                  QFlags;
} QUEUE;                               

Fields:

Name Description

FrontEnd 

Reserved for Pegasus.

Start

Points to the first byte of the buffer being used for the queue.

Front

Rear

If Front equals Rear, then the queue is empty.

If the Q_REVERSE flag is clear in QFlags then the queue is a forward queue and Front points to the next byte of valid data to be consumed.  Valid data extends from Front forward (towards End) to the byte preceding Rear.  If Rear is less than Front, then the queue data has wrapped around from End to Start.

If the Q_REVERSE flag is set in QFlags, then the queue is a reversed queue and Front points to the first byte following the next byte of valid data to be consumed.  Valid data extends from that next byte of valid data back (towards Start) to the byte pointed to by Rear.  If Rear is greater than Front, then the queue data has wrapped around from Start to End.

End

Points to the first byte following the buffer being used for the queue.

RearEnd

Reserved for Pegasus.

QFlags

Value

Meaning

Q_EOF

Specifies that there is no more data.  The application sets this bit in QFlags after the end of the data has been placed in the Get queue.  This bit is input by the application.

Q_REVERSE

Causes the queue to operate in a back to front, or reversed, manner (see the Queue Management section in the PICTools and AIMTools Programmer's Guide for a more complete explanation of this flag).  This bit is input by the application.

Q_IO_ERR

Set if an input or output error occurred.  This bit is input by the application.  It allows the application to terminate the operation at a low-level point where it may be more convenient to the application than calling Pegasus with REQ_TERM.

Q_READ_WRAP

Not used.

Q_DID_WRITE

Set by some opcodes (OP_LIE3 and OP_LIP3) if a RES_PUT_NEED_SPACE response has been returned by Pegasus since the Put queue was allocated.  This bit is output by Pegasus.

Q_READING

Set at RES_PUT_NEED_SPACE if the data in the Put queue are not modified.  In that case, and if the data are available at another location, the application may optionally discard the data instead of saving the data.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback