新しい (現在接続されていない) 構文エレメントを、 指定したターゲット・エレメントの最後の子として構文エレメント・ツリーに追加します。
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);