Site Tools


documentation:development:opera:pf25:ppgfldr:pgsfldr:spr:01spr106

PrevNode

Gets the previous node in a list.

Synopsis

Node *PrevNode( const Node *node )

Description

This macro returns a pointer to the previous node in a list. If the current node is the first node in the list, the result is a pointer to the head (beginning-of-list) anchor. To determine whether the return value is an actual node rather than the head anchor, use the IsNodeB() procedure.

Example 1: Use of PrevNode in reverse list traversal

for (n = LastNode( l ); IsNodeB( l, n ); n = PrevNode( n )) 
{   . . .   }; 

Arguments

  • node A pointer to the current node.

Return Value

The macro returns a pointer to the previous node in the list or, if the current node is the first node in the list, to the head (beginning-of-list) anchor.

Implementation

Macro implemented in list.h V20.

Associated Files

  • list.h ANSI C Macro definition

See Also

FirstNode(), IsListEmpty(), IsNode(), IsNodeB(), LastNode(), ScanList()


documentation/development/opera/pf25/ppgfldr/pgsfldr/spr/01spr106.txt · Last modified: 2022/10/10 16:54 by 127.0.0.1