이 함수는 입력 메시지 표현에 사용되는 인코딩 및 코딩 문자 세트를 제공하는 기존 cpiParseBuffer() 구현 함수에서 제공하는 기능을 확장하여 제공합니다. 이 구현 함수가 CPI_VFT 구조에 제공된 경우, cpiParseBuffer()와 cpiParseBufferFormatted() 모두 지정할 수 없습니다. CCI_INVALID_IMPL_FUNCTION 리턴 코드가 표시되면서 cpiDefineParserClass() 함수가 작동 중지되기 때문입니다.
정의 대상 | 유형 | 구성원 |
CPI_VFT | 조건부 | iFpParseBufferEncoded |
int cpiParseBufferEncoded( CciParser* parser, CciContext* context, int encoding, int ccsid);
구문 분석기가 소유하는 메시지 버퍼의 나머지 부분 크기(바이트 단위).
다음 예는 샘플 구문 분석기 파일 BipSampPluginParser.c에서 발췌한 것입니다(428 - 466행).
int cpiParseBufferEncoded( CciParser* parser, CciContext* context, int encoding, int ccsid ){ PARSER_CONTEXT_ST* pc = (PARSER_CONTEXT_ST *)context ; int rc; /* Get a pointer to the message buffer and set the offset */ pc->iBuffer = (void *)cpiBufferPointer(&rc, parser); pc->iIndex = 0; /* Save the format of the buffer */ pc->iEncoding = encoding; pc->iCcsid = ccsid; /* Save size of the buffer */ pc->iSize = cpiBufferSize(&rc, parser); /* Prime the first byte in the stream */ pc->iCurrentCharacter = cpiBufferByte(&rc, parser, pc->iIndex); /* Set the current element to the root element */ pc->iCurrentElement = cpiRootElement(&rc, parser); /* Reset flag to ensure parsing is reset correctly */ pc->iInTag = 0; if (pc->trace) { fprintf(pc->tracefile, "PLUGIN: <- cpiParseBufferEncoded() retvalue=%d\n", pc->iSize); fflush(pc->tracefile); }