Important: The information in this document is obsolete and should not be used for new development.
Dequeue
You can use theDequeuefunction to remove a queue element directly from an operating-system queue or from a queue that you have created.
FUNCTION Dequeue (qElement: QElemPtr; qHeader: QHdrPtr): OSErr;
qElement- A pointer to a queue element to remove from a queue.
qHeader- A pointer to a queue header.
DESCRIPTION
TheDequeuefunction attempts to find the queue element specified by theqElementparameter in the queue specified by theqHeaderparameter. IfDequeuefinds the element, it removes the element from the queue, adjusts the other elements in the queue accordingly, and returnsnoErr. Otherwise, it returnsqErr, indicating that it could not find the element in the queue. TheDequeuefunction does not deallocate the memory occupied by the queue element.SPECIAL CONSIDERATIONS
TheDequeuefunction disables interrupts as it searches through the queue for the element to be removed. The time during which interrupts are disabled depends on the length of the queue and the position of the entry in the queue. TheDequeuefunction can be called at interrupt time. Whenever possible, use the removal routines listed in Table 6-3 on page 6-12 instead theDequeuefunction.ASSEMBLY-LANGUAGE INFORMATION
The registers on entry and exit for theDequeuefunction are
Registers on entry A0 Pointer to the queue element to be removed A1 Pointer to the queue header
Registers on exit A1 Pointer to the queue header D0 Result code RESULT CODES
noErr 0 No error qErr -1 Entry is not in specified queue SEE ALSO
For a description theQElemrecord, see page 6-14; for a description of theQHdrrecord, see page 6-13.