cpiAddAsLastChild

目的

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

構文

void cpiAddAsLastChild(
  int*           returnCode,
  CciElement*  targetElement,
  CciElement*  newElement);

パラメーター

returnCode
関数からの戻りコードを受け取ります (出力)。
考えられる戻りコードは以下のとおりです。
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_ELEMENT_OBJECT
targetElement
ターゲットの構文エレメント・オブジェクトのアドレスを指定します (入力)。
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);
関連概念
ユーザー定義のパーサー
ユーザー定義拡張機能
関連タスク
C でのパーサーの作成
関連資料
cpiAddAsFirstChild
C パーサー・ユーティリティー関数
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック
Copyright IBM Corporation 1999, 2006 最終更新: 08/21/2006
as08380_