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 마지막 갱신 날짜: 2006/08/21
as08490_