ACPI_NAMESPACE_NODE * AcpiNsGetNextNode ( ACPI_OBJECT_TYPE Type, ACPI_NAMESPACE_NODE *ParentNode, ACPI_NAMESPACE_NODE *ChildNode) { ACPI_NAMESPACE_NODE *NextNode = NULL; ACPI_FUNCTION_ENTRY (); if (!ChildNode) { /* It's really the parent's _scope_ that we want */ NextNode = ParentNode->Child; } else { /* Start search at the NEXT node */ NextNode = AcpiNsGetNextValidNode (ChildNode); } /* If any type is OK, we are done */ if (Type == ACPI_TYPE_ANY) { /* NextNode is NULL if we are at the end-of-list */ return (NextNode); } /* Must search for the node -- but within this scope only */ while (NextNode) { /* If type matches, we are done */ if (NextNode->Type == Type) { return (NextNode); } /* Otherwise, move on to the next node */ NextNode = AcpiNsGetNextValidNode (NextNode); } /* Not found */ return (NULL); }
ACPI_NAMESPACE_NODE * AcpiNsGetNextNodeTyped ( ACPI_OBJECT_TYPE Type, ACPI_NAMESPACE_NODE *ParentNode, ACPI_NAMESPACE_NODE *ChildNode) { ACPI_NAMESPACE_NODE *NextNode = NULL; ACPI_FUNCTION_ENTRY (); NextNode = AcpiNsGetNextNode (ParentNode, ChildNode); /* If any type is OK, we are done */ if (Type == ACPI_TYPE_ANY) { /* NextNode is NULL if we are at the end-of-list */ return (NextNode); } /* Must search for the node -- but within this scope only */ while (NextNode) { /* If type matches, we are done */ if (NextNode->Type == Type) { return (NextNode); } /* Otherwise, move on to the next node */ NextNode = AcpiNsGetNextValidNode (NextNode); } /* Not found */ return (NULL); }