cpiSetElementCompletePrevious

目的

ターゲット構文エレメントにある 'previous child complete' フラグを、指定した値に設定します。

構文

void cpiSetElementCompletePrevious(
  int*           returnCode,
  CciElement*  targetElement,
  CciBool      value);

パラメーター

returnCode
関数からの戻りコードを受け取ります (出力)。
考えられる戻りコードは以下のとおりです。
  • CCI_SUCCESS
  • CCI_EXCEPTION
  • CCI_INV_ELEMENT_OBJECT
targetElement
ターゲットの構文エレメント・オブジェクトのアドレスを指定します (入力)。
value
フラグに設定される値 (入力)。

戻り値

なし。エラーが発生した場合、returnCode がエラーの理由を示します。

サンプル

この例は、サンプル・パーサー・ファイル BipSampPluginParser.c から取られています (289 行から 318 行)。

/* Get a pointer to the start of the tag */
        startMarker = (char*)pc->iBuffer+(int)pc->iIndex;

        /* Skip over the tag */
        goToNameEnd( (PARSER_CONTEXT_ST *)context, parser );

        /* Get a pointer to the end of the tag */
        endMarker = (char*)pc->iBuffer+(int)pc->iIndex;

        /* Compute the size of the tag */
        markedSize = (size_t)endMarker-(int)startMarker;

        /* Convert the tag into broker form */
        data = CciNString((char *)startMarker, markedSize, pc->iCcsid);

        /* Create a new name element for the tag */
        newElement = cpiCreateElement(&rc, parser);
        cpiSetElementType(&rc, newElement, CCI_ELEMENT_TYPE_NAME);
        cpiSetElementName(&rc, newElement, data);
        cpiSetElementCompletePrevious(&rc, newElement, 0);
        cpiSetElementCompleteNext(&rc, newElement, 0);
        if (pc->trace) {
          const char * mbData = mbString(data, pc->iCcsid);
          fprintf(pc->tracefile, "PLUGIN: New tag found¥n");
          fprintf(pc->tracefile, "PLUGIN: Created new NAME element;
                  object=0x%x type=0x%x name=",
                  newElement, CCI_ELEMENT_TYPE_NAME);
          fprintf(pc->tracefile, "%s¥n", mbData);
          fflush(pc->tracefile);
          free((void *)mbData);
        }
        /* Free the memory allocated in CciNString() */
        free((void *)data);

        /* Add the element */
        cpiAddAsLastChild(&rc, element, newElement);
        cpiSetElementCompletePrevious(&rc, element, 1);
関連概念
ユーザー定義のパーサー
ユーザー定義拡張機能
関連タスク
C でのパーサーの作成
関連資料
cpiSetElementCompleteNext
C パーサー・ユーティリティー関数
特記事項 | 商標 | ダウンロード | ライブラリー | サポート | フィードバック
Copyright IBM Corporation 1999, 2006 最終更新: 08/21/2006
as08490_