새(현재 연결되지 않은) 구문 요소를 지정된 대상 요소의 마지막 하위 요소로 구문 요소 트리에 추가합니다.
void cpiAddAsLastChild( int* returnCode, CciElement* targetElement, CciElement* newElement);
없음. 오류가 발생할 경우, returnCode는 오류의 이유를 표시합니다.
다음 예는 샘플 구문 분석기 파일 BipSampPluginParser.c에서 발췌한 것입니다(209 - 228행).
/* Convert the attribute value into broker form */ data = CciNString((char *)startMarker, markedSize, pc->iCcsid); /* Create a new name-value element for the attribute */ newElement = cpiCreateElement(&rc, parser); cpiSetElementType(&rc, newElement, CCI_ELEMENT_TYPE_NAME_VALUE); cpiSetElementName(&rc, newElement, data); /* Free the memory created in CciNString() */ free((void *)data); /* Add the element */ cpiAddAsLastChild(&rc, element, newElement);