Next: void F_inputTree(topNodePtriostream&infile) Up: Nonmember Functions Previous: void F_addChild(parentNodePtrnewNodePtr)

void F_getChild(parentNodePtr,nodeWantedPtr,int index)

nodeWantedPtr is made to point at one child of the parent node, i.e. the node at which parentNodePtr points. The type of nodeWantedPtr is checked, and nodeWantedPtr will be made to point at a child of that type. index specifies which child of that type to return. If there is only one child, index must be 0. If there are two children, index may be 0 or 1 to select one or the other. If there is no child satisfying the desired type and index, NULL is returned.

The following makes erpPtr point at the i-th erp child of the event node.


eventNode *ev;
erpNode *erpPtr;
...
F_getChild(ev,erpPtr,i);


walter@
Wed Aug 10 11:53:26 PDT 1994