Legacy Documentclose button

Important: The information in this document is obsolete and should not be used for new development.

Previous Book Contents Book Index Next

Inside Macintosh: Networking With Open Transport / Part 2 - Open Transport Reference
Chapter 27 - Utilities Reference / Functions
OTFIFO List Utility Functions /


OTFindLink

Finds a link in a FIFO list and returns a pointer to it.

C INTERFACE
OTLink* OTFindLink  (OTList* list,
                     OTListSearchProcPtr proc,
                     const void* refPtr)
C++ INTERFACE
None. C++ applications use the C interface to this function.

PARAMETERS
list
A pointer to the FIFO list to be searched.
proc
A pointer to the user-defined procedure to be used in searching for the link. See MyListSearchFunction for information on defining your own list search function.
refPtr
A pointer to a value that is passed to the user-defined search procedure and that is useful to that procedure in finding a link. This value might be the address of a field, the value of a field, or any other kind of data that would help identify the link being sought.
function result
A pointer to the link being sought. The value of this pointer is NULL if no link matching your search criteria is found.
DISCUSSION
This function walks the list (from head to tail) specified by the list parameter, repeatedly calling the search procedure specified by the proc parameter. Each time it calls the search procedure, it passes it the value specified in the refPtr parameter. The OTFindLink function returns a pointer to the first OTLink value for the your proc procedure returned true. A NULL is returned if your proc procedure never returned true.

Use the OTIsInList function to determine whether a link is in a FIFO list.

Use the OTRemoveLink function to remove a link from a FIFO list.

Use the OTFindAndRemoveLink function to find and remove a link in a FIFO list.

Use the OTGetIndexedLink function to find a link in a FIFO list based on its index in the list.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
15 JAN 1998