Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Contact ADC

Previous Book Contents Book Index Next

Inside Macintosh: Operating System Utilities /
Chapter 6 - Queue Utilities / Queue Utilities Reference
Routines /


You can use the Dequeue function 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;
A pointer to a queue element to remove from a queue.
A pointer to a queue header.
The Dequeue function attempts to find the queue element specified by the qElement parameter in the queue specified by the qHeader parameter. If Dequeue finds the element, it removes the element from the queue, adjusts the other elements in the queue accordingly, and returns noErr. Otherwise, it returns qErr, indicating that it could not find the element in the queue. The Dequeue function does not deallocate the memory occupied by the queue element.

The Dequeue function 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. The Dequeue function can be called at interrupt time. Whenever possible, use the removal routines listed in Table 6-3 on page 6-12 instead the Dequeue function.

The registers on entry and exit for the Dequeue function are
Registers on entry
A0Pointer to the queue element to be removed
A1Pointer to the queue header
Registers on exit
A1Pointer to the queue header
D0Result code

noErr0No error
qErr-1Entry is not in specified queue
For a description the QElem record, see page 6-14; for a description of the QHdr record, see page 6-13.

Previous Book Contents Book Index Next

© Apple Computer, Inc.
6 JUL 1996

Get information on Apple products.
Visit the Apple Store online or at retail locations.

Copyright © 2004 Apple Computer, Inc.
All rights reserved. | Terms of use | Privacy Notice