cpiNextSibling

Purpose

Returns the address of the syntax element object that is the next (right) sibling of the specified target element.

Syntax

CciElement* cpiNextSibling(
  int*               returnCode,
  const CciElement*  targetElement);

Parameters

returnCode
Receives the return code from the function (output).
targetElement
Specifies the address of the target syntax element object (input).

Return values

The address of the requested syntax element object is returned, unless there is no next sibling in which case zero is returned. If an error occurs, zero (CCI_NULL_ADDR) is returned and returnCode indicates the reason for the error.

Sample

This example is taken from the sample node file BipSampPluginParser.c (lines 494 to 496):

while ((!cpiElementCompleteNext(&rc, cpiParent(&rc, element))) &&
         (!cpiNextSibling(&rc, element))       &&
         (pc->iCurrentElement))

Related concepts
User-defined parsers
User-defined extensions

Related tasks
Creating a parser in C

Related reference
Parser utility functions