PATH 
ADC Home > Documentation > Hardware > Device Managers and Drivers > PCI Card Services > Designing PCI Cards and Drivers for Power Macintosh Computers


  

Using Iterate Routines

Writing code to interate through a set of names consists of a call to begin the iteration, the iteration loop, and a call to end the iteration. The call to end the iteration should be made even in the case of an error, so that allocated data structures can be freed. Here is the basic code structure for traversing names in the Name Registry:

Create(...)
Set(...)                    // optional
do {
        Iterate(...);       // or Search(...);
} while (!done);
Dispose(...);

Two different name entry iterations are provided, direction oriented and search oriented. The type of iteration is indicated by the call used to retrieve the next name entry. All the Mac OS routines used are described in Name Iteration and Searching. Rules for direction iteration are given below; rules for search iteration are given in the next section.

Here are some hints for using relationships while iterating:


© 1999 Apple Computer, Inc. – (Last Updated 26 March 99)