cpiElementName

Purpose

Gets the name of the target syntax element. The syntax element name will have been set previously using cniSetElementName or cpiSetElementName.

Syntax

Ccisize           cpiElementName(
  int*            returnCode,
  CciElement*     targetElement,
  const CciChar*  value,
  CciSize         length);

Parameters

returnCode
Receives the return code from the function (output).
Possible return codes are:
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_ELEMENT_OBJECT
  • CCI_INV_DATA_POINTER
  • CCI_INV_DATA_BUFLEN
  • CCI_INV_BUFFER_TOO_SMALL
targetElement
Specifies the address of the target syntax element object (input).
value
Specifies the address of a buffer into which the element name will be copied (input).
length
The length, in characters, specified by the value parameter (input).

Return values

If successful, the element name is copied into the supplied buffer and the number of CciChar characters copied is returned. If the buffer is not large enough to contain the element name, returnCode is set to CCI_BUFFER_TOO_SMALL and the number of characters required is returned. For any other failures, CCI_FAILURE is returned and returnCode indicates the reason for the error.

Sample

cpiElementName(&rc;, element, (CciChar*)&elementName;, sizeof(elementName));
Related concepts
User-defined parsers
User-defined extensions
Related tasks
Creating a parser in C
Related reference
cpiElementType
cpiElementValue group
cpiElementValueValue
C parser utility functions