이 구현 함수가 CPI_VFT 구조에 제공된 경우, cpiParseBuffer()와 cpiParseBufferEncoded() 모두 지정할 수 없습니다. CCI_INVALID_IMPL_FUNCTION 리턴 코드가 표시되면서 cpiDefineParserClass() 함수가 작동 중지되기 때문입니다.
정의 대상 | 유형 | 구성원 |
CPI_VFT | 조건부 | iFpParseBufferFormatted |
int cpiParseBufferFormatted( CciParser* parser, CciContext* context, int encoding, int ccsid, CciChar* set, CciChar* type, CciChar* format);
구문 분석기가 소유하는 메시지 버퍼의 나머지 부분 크기(바이트 단위).
다음 예는 샘플 구문 분석기 파일 BipSampPluginParser.c에서 발췌한 것입니다(428 - 466행).
int cpiParseBufferFormatted( CciParser* parser, CciContext* context, int encoding, int ccsid, CciChar* set, CciChar* type, CciChar* format ){ 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: <- cpiParseBufferFormatted() retvalue=%d\n", pc->iSize); fflush(pc->tracefile); }